- Code: Select all
<?php
require_once("./admin/database.php");
require_once("./admin/functions.php");
require('./admin/smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = './admin/templates';
$smarty->compile_dir = './admin/smarty/templates_c';
$smarty->cache_dir = './admin/smarty/cache';
$smarty->config_dir = './admin/smarty/configs';
$links = mysql_query("SELECT COUNT('id') FROM links");
echo mysql_error();
if (mysql_num_rows($links)) {
while($row = mysql_fetch_array($links)){
$links_total = number_format($row['0']);
}
}
$smarty->assign('links_total', $links_total);
$categories = mysql_query("SELECT COUNT('id') FROM categories");
echo mysql_error();
if (mysql_num_rows($categories)) {
while($row = mysql_fetch_array($categories)){
$categories_total = number_format($row['0']);
}
}
$smarty->assign('categories_total', $categories_total);
$pages = mysql_query("SELECT COUNT('id') FROM pages");
echo mysql_error();
if (mysql_num_rows($pages)) {
while($row = mysql_fetch_array($pages)){
$pages_total = number_format($row['0']);
}
}
$smarty->assign('pages_total', $pages_total);
$smarty->display('latest.html');
?>
Shows the number of pages, categories and links but can't get the script to show the latest 10 links on my custom page, is blank, what is missing to show latest 10 links on a custom page ? Thanks
