Skip to content

Instantly share code, notes, and snippets.

@johnduhart
Created October 2, 2009 02:56
Show Gist options
  • Save johnduhart/199430 to your computer and use it in GitHub Desktop.
Save johnduhart/199430 to your computer and use it in GitHub Desktop.
function page_admin_sets($page=1) {
if(!check_auth('login')) {
return page_deny();
}
$title = "Sets - ACP";
$total = mysql_fetch_array(mysql_query("SELECT COUNT(*) AS total FROM sets"));
$total = $total['total'];
$pages = ceil($total / 20);
$start = ($page - 1) * 20;
$q = 'SELECT * FROM sets ORDER BY `id` DESC LIMIT '.$start.', 20';
$r = mysql_query($q);
$page_links = "";
for($i = 1; $i <= $pages; $i++) {
if($i == $page) {
$page_links .= "<strong>".$i."</strong> ";
} else {
$page_links .= "<a href=\"".getUrl('admin/sets/p/'.$i)."\">".$i."</a> ";
}
}
include("pages/header.temp.php");
include("pages/admin.sets.temp.php");
include("pages/footer.temp.php");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment