<?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_photo_show($options) {
	global $db, $myts;
	$block = array();
	$block['title'] = _MB_MYALBUM_TITLE3;
	$block['content'] = "<center><table bgcolor=black width=1% border=0 cellspacing=0 cellpadding=1><tbody>";
	$result = $db->query("SELECT lid,ext FROM ".$db->prefix("myalbum_photos")." WHERE status > 0 ORDER BY RAND() limit ".$options[1]);
	
	while ($myrow = $db->fetchArray($result)) {
	$img = "<a href='".XOOPS_URL."/modules/myalbum/photo.php?lid=".$myrow['lid']."'>
	<img  width=147 src='".XOOPS_URL."/modules/myalbum/photos/thumbs/".$myrow['lid'].".".$myrow['ext']."'>";
	$block['content'] .= "
	<tr>
	<td>$img</td>
	</tr>
	";
	}
    	$block['content'] .= "</tbody></table></center>";
	
	return $block;
	
	while($myrow = $db->fetchArray($result)){
		$link = $myts->makeTboxData4Show($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/mylinks/singlelink.php?lid=".$myrow['lid']."'>".$link."</a> ";
		if($options[0] == "date"){
			$block['content'] .= "(".formatTimestamp($myrow['date'],"s").")<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_photo_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;
}
?>
