+ Fixed bug with DB Size in check_script.php + Deleted a lot of indexes in check_script_data.php + Deleted cache index and forum lastpost section in cache_index.php and cache_forum.php + Fixed other bugs in warnings + Fixed pagination in search.php + Replaced DSF logo to uForum logo + Moved differend elements in skin + Added "WHOIS" option in "Admin/Mod Pool" in view topic + Fixed bug in add warnings: couldn't add warn for admin/mod git-svn-id: https://svn.pioder.pl/uf-svn/uF@29 72ec579a-5ced-4fa4-82f3-afba5d98df2f
68 lines
1.5 KiB
PHP
68 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* @package uForum
|
|
* @file includes/cache/cache_forums.php
|
|
* @version $Id$
|
|
* @copyright 2009(c) PioDer <pioder@wp.pl>
|
|
* @link http://pioder.gim2przemysl.int.pl/
|
|
* @license GNU GPL v3
|
|
**/
|
|
if(!defined('IN_uF'))
|
|
{
|
|
die('Hacking attempt');
|
|
}
|
|
//cache forums and posts - version v1.0 Alpha 2---------------------------------
|
|
$default_skin = ViewSkinName();
|
|
$sql = "SELECT `name`,`lock` FROM ".FORUMS_TABLE." WHERE `f_id`='$fid' LIMIT 1";
|
|
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain forum information'));
|
|
if ($result['name']=='')
|
|
{
|
|
message_forum($lng['no_forum'],'index.php');
|
|
}
|
|
$forum = array(
|
|
'name'=>$result['name'],
|
|
'lock'=>$result['lock']
|
|
);
|
|
//
|
|
//generate output pages
|
|
//
|
|
if ($_SESSION['uid']>0)
|
|
{
|
|
$limiter = $userdata['limit_ftid'];
|
|
}
|
|
else
|
|
{
|
|
$limiter = $forum_config['limit_ftid'];
|
|
}
|
|
if (isset($_GET['page'])&&($_GET['page']!=1))
|
|
{
|
|
if (!is_numeric($_GET['page']))
|
|
{
|
|
die('Hacking attempt');
|
|
}
|
|
$value = ($_GET['page']-1)*$limiter;
|
|
$limit = 'LIMIT '.$value . ', '.$limiter;
|
|
$page = $_GET['page'];
|
|
}
|
|
else
|
|
{
|
|
$limit = 'LIMIT 0, '.$limiter;
|
|
$page=1;
|
|
}
|
|
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id`
|
|
FROM ".TOPICS_TABLE." WHERE `f_id`='$fid'",GENERAL,'Could not obtain count amout of topics'));
|
|
$count = $count['t_id'];
|
|
$count = ceil($count / $limiter);
|
|
if ($count==0)
|
|
{
|
|
$count +=1;
|
|
}
|
|
if(isset($_GET['page']) && ($_GET['page']>$count))
|
|
{
|
|
message_forum($lng['invalidpage'],'index.php');
|
|
}
|
|
//
|
|
//end generating pages
|
|
//
|
|
?>
|