I know there is a randome image block for Gallery, but is there a block avaiable for the last xx images viewed, or maybe one that does most populat images? That would be nice. Or maybe a universal block (modified random block) that you can make work in either random/last xx viewed or most popular??? There is another gallery program called MyeGallery that has a block for the last 4 images viewed, its a nice block, but I do not like MyeGallery as well as I like Gallery.
Thanks!
Posts: 5
I am sure if I knew PHP better I could modify the PHP file from MyeGallery Last 4 Posts: Her eis the PHP file (That is all there is to it):
<?php
/********************************************************/
/* i-Block- Last 4 Pic - MeG v1.0 */
/* Written by: MagicX */
/* http://www.portalzine.de */
/* translation by: Vuckor */
/* http://www.vuckor.com */
/********************************************************/
$blocks_modules['i-last4pics'] = array (
'func_display' => 'blocks_4pic_egallery_display',
'text_type' => 'ilast4pic',
'text_type_long' => 'i-Block [Last 4 Pictures -MeG 1.0]',
'allow_multiple' => true,
'form_content' => false,
'form_refresh' => false,
'show_preview' => true
);
addinstanceschemainfo('iBlock_Last4_Pic::', '::');
function blocks_4pic_egallery_display($row)
{
global $pntable, $prefix;
if (!authorised(0, 'iBlock_Last4_Pic::', '::', ACCESS_OVERVIEW)) {
return;
}
$a = 1;
$result = mysql_query("SELECT a.pid, a.gid, a.img, a.description, b.galloc from $prefix"._gallery_pictures." a left join $prefix"._gallery_categories."
b on a.gid =b.gallid ORDER by date DESC limit 4");
while (list($pid, $gid, $img, $description, $galloc) = mysql_fetch_row($result)) {
$thumbs = $galloc."/thumb/";
$ph[$a] = "<a href="modules.php?op=modload&name=My_eGallery&file=index&do=showpic&pid=".$pid."&orderby=hitsD" target="_self"><img
width="55" height="43" border="0" alt="".$description."" src="/modules/My_eGallery/gallery/".$thumbs.$img.""></a>";
$a ++;
}
$content = "<br><table border="1" cellspacing="0" cellpadding="0" bordercolor="#000000"
align=center>n<tr><td>$ph[1]</td><td>$ph[2]</td></tr>n<tr><td>$ph[3]</td><td>$ph[4]</td></tr></table>";
$row[content]=$content;
themesideblock($row);
}
?>