1
Hi
I would like to put a hit counter classification in smartmedia block instead of last upload... Anyone know how can i do this ?
Here is the
smartmedia_clips_recent.html block code:
Quote:
<ul>
<{foreach item=clip from=$block.clips}>
<li><{$clip.itemlink}></li>
<{/foreach}>
</ul>
<div style="text-align:right; padding: 5px;">
<a href="<{$xoops_url}>/modules/smartmedia/"><{$block.lang_visititem}></a>
</div>
So the thing might be simple: to show the number of hits near the item link and sort by most rated (i already modify the
clips_recent.php file to sort by most rated hits) but i don't see how to integrate in the php code:
Quote:
function b_smartmedia_clips_recent_show($options)
{
// This must contain the name of the folder in which reside SmartClient
if( !defined("SMARTMEDIA_DIRNAME") ){
define("SMARTMEDIA_DIRNAME", 'smartmedia');
}
include_once(XOOPS_ROOT_PATH."/modules/" . SMARTMEDIA_DIRNAME . "/include/common.php");
//$max_clips = $options[0];
$title_length = $options[0];
$max_clips = $options[1];
$clipsArray =& $smartmedia_clip_handler->getClipsFromAdmin(0, $max_clips, 'clips.counter', 'DESC', 'all');
If ($clipsArray) {
foreach ($clipsArray as $clipArray) {
$clip = array();
$clip['itemlink'] = '<a href="' . SMARTMEDIA_URL . 'clip.php?categoryid=' . $clipArray['categoryid'] . '&folderid=' . $clipArray['folderid'] . '&clipid=' . $clipArray['clipid'] . '">' . $clipArray['title']. '</a>';
$block['clips'][] = $clip;
unset ($clip);
}
}
$block['smartmedia_url'] = SMARTMEDIA_URL;
return $block;
}
Thanks a lot
...FIxED