| Codice: |
function printPages($start, $sort, $count, $h_op) {
global $gl_cat_id;
$j=0;
$pages = number_format(($count/5), 1);
$pages++;
if ($start - 5 < 0) {
$content .= "Back";
}
else {
$content .= "<a href=\"modules.php?name=Hot_Or_Not&h_op=$h_op&cat=$gl_cat_id&sort=$sort&i=".($start-5)."\">Back</a>";
}
$content .= "&::&";
for ($i=1;$i<$pages;$i++) {
if ($j != $start) {
$content .= "<a href=\"modules.php?name=Hot_Or_Not&h_op=$h_op&cat=$gl_cat_id&sort=$sort&i=$j\">$i</a> ";
} else {
$content .= "<b><u>$i</u></b> ";
}
$j = $j + 5;
}
$content .= " :: ";
if ($start + 5 < $count) {
$content .= "<a href=\"modules.php?name=Hot_Or_Not&h_op=$h_op&cat=$gl_cat_id&sort=$sort&i=".($start+5)."\">Next</a>";
}
else {
$content .= "Next";
}
return $content;
}
function gettablecontent() {
global $dbi, $prefix;
$files = array();
$i = 0;
//get images from table and put in 2 dimensional array $files[dir][file_number] = file_name
$result = sql_query("select vote_dir, vote_file from ".$prefix."_hotornot_votes order by vote_dir, vote_file", $dbi);
while (list($vote_dir, $vote_file) = sql_fetch_row($result, $dbi)) {
$files[$vote_dir][$i] = $vote_file;
$i++;
}
return $files;
}
|