Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Mon Jun 23, 2003 9:03 pm Post subject:
ok, let me sleep on it and i'll dig through some code tomorrow and see what i can come up with. if you can email me your block file, i can take a look at it as well.
Joined: Mar 03, 2003 Posts: 6287 Location: Washington Township, NJ, USA
Posted: Wed Jun 25, 2003 9:29 am Post subject: Re: Updated Gallery Block Problem/Question
the error has been fixed. it stemmed from a couple of things. First, the user was being hosted on a virtual hosted system, so the values for WEB_DIR,etc had to be hardcoded in. Second, a coding error on our part here. We neglected to check to see if the count of parent albums was zero. This raised a huge SQL error. here is the fix.
in the block-updatedGallery.php file, find the line that reads:
Code: › while(!$the_end) {
immediately above that line, add:
Code: › if(count($parentCountList) != 0) {
and close out the if block by adding a
Code: › }
after the lines reading
Code: › else $k = key($parentCountList);
}
the final chunk of code will look like this:
Code: › if(count($parentCountList) != 0) {
while(!$the_end) {
$myAlbum = new Album();
$myAlbum->load($k);
echo "setting up gallery database, name= ".$myAlbum->fields['name'];
$res = sql_query("UPDATE ".$prefix."_gallery SET num_children = ".$parentCountList[$k]." WHERE album_name = '".$myAlbum->fields['name']."'", $dbi) or die(mysql_error());
$s = next($parentCountList);
if ($s == false) $the_end = true;
else $k = key($parentCountList);
}
}
When a user is not logged in, the block is correctly displayed and says to log in..when the user logs in, the following error is displayed:
"Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/k/public_html/includes/sql_layer.php on line 286"
The block header is displayed along with the updated gallery folder, however the block border is not drawn and everything else is misaligned due to the error.
I took a look at the file and couldnt find anything that was funky.
I've also looked around here and tried all the suggestions I could find--No luck. Any ideas?
Thanks,
Bob
P.s. Finally got random block 'stabilized'. It only works correctly on the right side, and when its not the first block at the top. Otherwise it errors out. Anyone else have this problem?
Last edited by krathis on Sun Jul 13, 2003 11:26 am; edited 1 time in total
Posted: Mon Jul 07, 2003 9:52 am Post subject: Re: Updated Gallery Block Problem/Question
Ah ha! I am POSITIVE I ran the add_fields scripts and got a successful result. However, after your comment, I went in a looked at the db and found the field were in fact, not there. I ran it again, and it "took", and now everything seems groovy.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum