<?php
//  ------------------------------------------------------------------------ //
// 本模組由 tad 製作
// 製作日期：2008-02-28
// $Id: tad_hot_media.php,v 1.1 2008/05/05 03:24:03 tad Exp $
// ------------------------------------------------------------------------- //

//區塊主函式 (依人氣值挑出熱門影片)
function tad_player_b_show_3($options){
	global $xoopsDB;

	$sql = "SELECT `psn`, `title`, `creator`, `location`, `image`, `info`, `uid`, `post_date`, `enable_group`, `counter` FROM ".$xoopsDB->prefix("tad_player")." order by counter desc limit 0,{$options[0]}";
	$result = $xoopsDB->query($sql) or redirect_header($_SERVER['PHP_SELF'],3, mysql_error());


  $block="<table>";

  while(list($psn,$title,$creator,$location,$image,$info,$uid,$post_date,$enable_group,$counter)=$xoopsDB->fetchRow($result)){
    $block.="<tr><td><a href='".XOOPS_URL."/modules/tad_player/play.php?psn={$psn}'>$title</a></td></tr>";
  }


	$block.="</table>";
	return $block;

}

//區塊編輯函式
function tad_tad_hot_media_edit($options){

	$form="
	"._MB_TADPLAYER_TAD_TAD_HOT_MEDIA_EDIT_BITEM0."
	<INPUT type='text' name='options[0]' value='{$options[0]}'>
	";
	return $form;
}

?>