Location: PHPKode > projects > PHP Enter > www/categories.php
<?php
//PHP Enter 3.0.
//Copyright (C) 2011  Predrag Rukavina hide@address.com
//This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License
//as published by the Free Software Foundation; either version 2
//of the License, or (at your option) any later version.
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//You should have received a copy of the GNU General Public License
//along with this program; if not, write to the Free Software
//Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
$id=$_GET['id'];
include('settings.php');
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$tmp = mysql_query("SELECT * FROM categori ORDER BY name ASC"); 
while ($aclrow = mysql_fetch_assoc($tmp))
{
$ccval[] = $aclrow;
}
$smarty->assign('rewrite',$rewrite);
$smarty->assign('path',$path);
$smarty->assign('title',$title);
$smarty->assign('temp',$temp);
$smarty->assign('categori', @$ccval);
function get_db_results() {
$id = (int)$_GET['id'];
$_query = sprintf("SELECT SQL_CALC_FOUND_ROWS * FROM newser where idblog = '" . mysql_real_escape_string($id) ."' order by blogid desc LIMIT %d,%d",
            SmartyPaginate::getCurrentIndex(), SmartyPaginate::getLimit());
$_result = mysql_query($_query);
while ($_row = mysql_fetch_array($_result, MYSQL_ASSOC)) {
$_data[] = $_row;
        }
$_query = "SELECT FOUND_ROWS() as total";
$_result = mysql_query($_query);
$_row = mysql_fetch_array($_result, MYSQL_ASSOC);
SmartyPaginate::setTotal($_row['total']);
mysql_free_result($_result);
return @$_data;
}
require('libs/SmartyPaginate.class.php');
SmartyPaginate::connect();
SmartyPaginate::setLimit(10);
SmartyPaginate::setUrl('categories.php');
$smarty->caching = 1;
$smarty->assign('results', get_db_results());
SmartyPaginate::assign($smarty);
$galres = mysql_query("select * from vgalery order by galid desc LIMIT 6")
or die(mysql_error()); 
while($gevrow=mysql_fetch_array($galres)){
$geval[] = $gevrow;
}
$smarty->assign('vgalery', $geval);
$smarty->display('categories.php', $REQUEST_URI);
$smarty->display('footer.php');
?>
Return current item: PHP Enter