<?php
//v1.3 www.bcoos.net 2006-08 GPL
//v1.2 www.exoops.info 2006/03 GPL
/******************************************************************************
 * Function: b_mylinks_top_show
 * Input   : $options[0] = date for the most recent links
 *                    hits for the most popular links
 *           $block['content'] = The optional above content
 *           $options[1]   = How many reviews are displayes
 * Output  : Returns the desired most recent or most popular links
 ******************************************************************************/
function b_myalbum_top_show($options) {
	global $db;
	$block = array();
	$block['content'] = "";
	$result = $db->query("SELECT lid, cid, title, date, hits FROM ".$db->prefix("myalbum_photos")." WHERE status>0 ORDER BY ".$options[0]." DESC",$options[1],0);
	while($myrow = $db->fetchArray($result)){
//		$link = $myts->makeTboxData4Show-($myrow["title"]);
		$link = ($myrow["title"]);
		if ( !XOOPS_USE_MULTIBYTES ){
			if (strlen($link) >= 19) {
				$link = substr($link,0,18)."...";
			}
		}
		$block['content'] .= "&nbsp;&nbsp;<strong><big>&middot;</big></strong>&nbsp;<a href='".XOOPS_URL."/modules/myalbum/photo.php?lid=".$myrow['lid']."'>".$link."</a> ";
		if($options[0] == "date"){
			$block['content'] .= "(".formatTimestamp($myrow['date'],"d/m/Y").")<br />";
			$block['title'] = _MB_MYALBUM_TITLE1;
		}elseif($options[0] == "hits"){
			$block['content'] .= "(".$myrow['hits'].")<br />";
			$block['title'] = _MB_MYALBUM_TITLE2;
		}
	}
	return $block;
}
function b_myalbum_top_edit($options) {
	$form = ""._MB_MYLINKS_DISP."&nbsp;";
	$form .= "<input type='hidden' name='options[]' value='";
	if($options[0] == "date"){
		$form .= "date'";
	}else {
		$form .= "hits'";
	}
	$form .= " />";
	$form .= "<input type='text' class=text size=6 name='options[]' value='".$options[1]."' />&nbsp;"._MB_MYLINKS_LINKS."";
	return $form;
}
?>
