Jump to content


Featured Gallery Block


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

#1 miguelmayo

    Newbie

  • Members
  • Pip
  • 6 posts

Posted 02 March 2010 - 05:04 AM

this is a block I made updated from the old random 5 block from upportal 2.0 - I modified it to accept only pinned gallery entries so that I did not have undesireable pictures on my homepage, if you have several pinned photos they display randomly, also they are medium size photos it sorts by file size and choses the medium size pic if its a large file so that your members are not stuck with a 6 mega pixle featured picture.


<table class='ipb_table' cellspacing="1">
    <tbody>
        <tr>
            <td class='row2'>
<?php 
echo('<Center><table border=0><TR>');
$MZresult = $this->DB->query("SELECT ibf_gallery_images.id as picid,ibf_members.members_display_name as mname,`file_size`,`medium_file_name`,`masked_file_name`,`directory`,`caption`,`description`,`comments`,`views` 
FROM `ibf_gallery_images` , `ibf_members` 
WHERE ibf_gallery_images.member_id = ibf_members.member_id and ibf_gallery_images.approved=1 and ibf_gallery_images.pinned=1 
ORDER BY rand() LIMIT 1");
WHILE ($MZrow = $this->DB->fetch($MZresult))
if (($MZrow['file_size']) < 90000)
{ echo('<TD ALIGN=center width=99%><a href="../forum/index.php?app=gallery&module=images&section=viewimage&img='.$MZrow['picid'].'">');
echo('<B>'.$MZrow['caption'].'</B><BR><BR><IMG SRC="../forum/uploads/');
echo($MZrow['directory']. '/'.$MZrow['masked_file_name'].'" alt="click HERE more info on the image"'. 'class="linked-image"'. 'border=0 ></a><BR><i>'.$MZrow['description'].'</i><BR><BR>by '.$MZrow['mname'].'<br><img src="../forum/public/style_images/light/blog/comments.png">  <b>Comments</b>: '.$MZrow['comments'].' :: <a href="../forum/index.php?app=gallery&module=images&section=viewimage&img='.$MZrow['picid'].'">View Comments</a>');
echo (' :: <img src="../forum/public/style_images/light/blog/views.png">  Views: '.$MZrow['views'].'</TD></TR></TR>');
}
else
{ echo('<TD ALIGN=center width=99%><a href="../forum/index.php?app=gallery&module=images&section=viewimage&img='.$MZrow['picid'].'">');
echo('<B>'.$MZrow['caption'].'</B><BR><BR><IMG SRC="../forum/uploads/');
echo($MZrow['directory']. '/'.$MZrow['medium_file_name'].'" alt="click HERE more info on the image"'. 'class="linked-image"'. 'border=0 ></a><BR><i>'.$MZrow['description'].'</i><BR><BR>by '.$MZrow['mname'].'<br><img src="../forum/public/style_images/light/blog/comments.png"> <b>Comments</b>: '.$MZrow['comments'].' :: <a href="../forum/index.php?app=gallery&module=images&section=viewimage&img='.$MZrow['picid'].'">View Comments</a>');
echo (' :: <img src="../forum/public/style_images/light/blog/views.png"> Views: '.$MZrow['views'].'</TD></TR></TR>');
}
echo('</TR></TABLE>');
?>

            </td>
        </tr>
    </tbody>
</table>






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users