define(WEB_DIR, '/home/chonpin/public_html/blog/archives/images/000235'); include(WEB_DIR.'/db.php'); $top = $_GET["top"]; $w = $_GET["w"]; $h = $_GET["h"]; if ($top=='') $top=10; if ($w=='') $w=900; if ($h=='') $h=600; $sql = "select item, name, view, vote from event_mobile01_20080326 order by vote desc LIMIT 0 , $top"; $result = $db->sql_query($sql); while ( $row = $db->sql_fetchrow($result) ) { $item .= $row["item"].","; $name .= "'".$row["name"]."',"; $view .= $row["view"].","; $vote .= $row["vote"].","; } $item = substr($item, 0, strlen($item)-1); $name = substr($name, 0, strlen($name)-1); $view = substr($view, 0, strlen($view)-1); $vote = substr($vote, 0, strlen($vote)-1); ?>