Jump to content


Patch For Random Child Gallery Thumbs


  • You cannot reply to this topic
No replies to this topic

#1 mutatron

    Etomite Forum Newbie

  • Member
  • 1 posts

Posted 03 July 2006 - 06:38 AM

In the EtoGal snippet, search for children.
Remove the limit from the getIntTableRows that loads the $thumb array.
Add a variable $pic and make it equal to rand(0,count-1).
Find the line with $thumb[0]['filename'] and replace the 0 with $pic.

Here is the patched section if you just want to copy and paste.

foreach($children as $child) {
	$thumb=$etomite->getIntTableRows("filename", $gtable, "gal_id='" . $child['id'] . "'",$order_by,$order_direction);
	if($thumb[0]['filename']=="") continue;
	if($number_in_row==0) {
	  $returnstring.="<tr>";
	}
	$childself = "index.php?id=".$child['id']; //MF removed use of alias
	$pic=rand(0,count($thumb)-1);

	$returnstring.="
	  <td align=\"center\" style=\"width:" . floor(100/$pics_in_a_row) . "%\">
	  <a href=\"".$childself."\">
	  <img src=\"".$path_to_galleries.$child['id']."/tn_".$thumb[$pic]['filename']."\" class=\"EGthumbnail\" title=\"" .$strings['go_to_gallery'] . "\" alt=\"" . $strings['go_to_gallery'] . "\" />






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users