Latest 10 links custom page

Core code customizations and Smarty markup and Template design help in regards to ADP.

Moderator: pgolovko

Latest 10 links custom page

Postby Szise » 02/22/2009 8:41 am

Again me, i created a new file, latest.php and placed this code :



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
Szise
 
Posts: 11
Joined: 02/22/2009 1:18 am


Return to Customization & Templates

Who is online

Users browsing this forum: No registered users and 0 guests

cron