Added files - test

git-svn-id: https://svn.pioder.pl/uf-svn/uF@11 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
pioder
2009-05-01 08:28:11 +00:00
commit 968d0b7b53
429 changed files with 15882 additions and 0 deletions

83
includes/cache/cache_forums.php vendored Normal file
View File

@@ -0,0 +1,83 @@
<?php
/**
* @package Dynamic Script Forum
* @file includes/cache/cache_forums.php
* @version 1.0.x, 02-12-2007, 14:00
* @copyright 2008(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/dsf.html
* @license GNU GPL v3
**/
if(!defined('IN_uF'))
{
die('Hacking attempt');
}
//cache forums and posts - version v1.0 Alpha 2---------------------------------
$default_skin = Over::ViewSkinName();
$sql = "SELECT `name`,`lock` FROM ".FORUMS_TABLE." WHERE `f_id`='$fid' LIMIT 1";
$result = @mysql_fetch_array(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']
);
$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`";
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum');
while($result = @mysql_fetch_array($query))
{
$count_topic[$result['t_id']]=$result['p_id'];
}
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `f_id`='$fid' ORDER BY `ptime`";
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum');
while($result = @mysql_fetch_array($query))
{
$lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
$lastpost[$result['t_id']]['u_id']=$result['u_id'];
$lastpost[$result['t_id']]['time']=$result['ptime'];
$lastpost[$result['t_id']]['user_nick']=$result['nick'];
$lastpost[$result['t_id']]['user_rank']=$result['rank'];
}
//
//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 = @mysql_fetch_array(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
//
?>

48
includes/cache/cache_index.php vendored Normal file
View File

@@ -0,0 +1,48 @@
<?php
/**
* @package Dynamic Script Forum
* @file includes/cache/cache_index.php
* @version 1.0.x, 10-04-2007, 17:04
* @copyright 2008(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/dsf.html
* @license GNU GPL v3
**/
if(!defined('IN_uF'))
{
die('Hacking attempt');
}
//
//cache forums and posts - version v1.0 Alpha 2---------------------------------
//
//lastpost in forum cache
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".POSTS_TABLE.".u_id = ".USERS_TABLE.".u_id GROUP BY `f_id`, `ptime` ORDER BY `ptime`";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain last post in topic', true);
$post_count = @mysql_num_rows($query);
while($result = @mysql_fetch_array($query))
{
$last_post[$result['f_id']]['tp_id'] = $result['tp_id'];
$last_post[$result['f_id']]['u_id'] = $result['u_id'];
$last_post[$result['f_id']]['t_id'] = $result['t_id'];
$last_post[$result['f_id']]['time'] = $result['ptime'];
$last_post[$result['f_id']]['user_rank'] = $result['rank'];
$last_post[$result['f_id']]['user_nick'] = $result['nick'];
}
//cache forums --don't modify!!!
$cache_id=1;
$sql = "SELECT ".FORUMS_TABLE.".*, COUNT(".POSTS_TABLE.".p_id) as amout, ".POSTS_TABLE.".f_id AS count FROM ".FORUMS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".FORUMS_TABLE.".f_id= ".POSTS_TABLE.".f_id GROUP BY `f_id` ORDER BY `c_id`, `sort`";
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.');
while($result = @mysql_fetch_array($query))
{
$forum[$cache_id]['f_id'] = $result['f_id'];
$forum[$cache_id]['name'] = $result['name'];
$forum[$cache_id]['desc'] = $result['desc'];
$forum[$cache_id]['c_id'] = $result['c_id'];
$forum[$cache_id]['sort'] = $result['sort'];
$count_forum[$result['f_id']] = $result['amout'];
$cache_id+=1;
}
$sql = "SELECT `u_id`,`nick`, `regdate` AS count FROM ".USERS_TABLE." ORDER BY `regdate` DESC";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain amout of count users information');
$lastuser = @mysql_fetch_array($query);
$count_users = @mysql_num_rows($query) -1;
?>

95
includes/cache/cache_topic.php vendored Normal file
View File

@@ -0,0 +1,95 @@
<?php
/**
* @package Dynamic Script Forum
* @file includes/cache/cache_topic.php
* @version 1.0.x, 02-12-2007, 14:16
* @copyright 2008(c) PioDer <pioder@wp.pl>
* @link http://pioder.gim2przemysl.int.pl/dsf.html
* @license GNU GPL v3
**/
if(!defined('IN_uF'))
{
die('Hacking attempt');
}
//||topic.php script cache ------------------------------------------------------------------------------
$sql = "SELECT ".TOPICS_TABLE.".*, ".TOPICS_TABLE.".name AS topic_name, ".TOPICS_TABLE.".lock AS topic_lock, ".FORUMS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".FORUMS_TABLE." ON ".TOPICS_TABLE.".f_id = ".FORUMS_TABLE.".f_id WHERE `t_id`='$tid' LIMIT 1";
$result = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'));
if ($result['t_id']=='')
{
message_forum($lng['no_topic'], 'index.php');
}
$topic['name']=$result['topic_name'];
$topic['lock']=$result['topic_lock'];
$topic['sticky']=$result['sticky'];
$topic['f_id']=$result['f_id'];
$fid = $topic['f_id'];
$forum['name']=$result['name'];
$forum['lock']=$result['lock'];
$forum['moderate']=$result['moderate'];
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."`";
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information');
$result = mysql_num_rows($query);
while ($result = @mysql_fetch_array($query))
{
if(!isset($user_warnlevel[$result['u_id']]))
{
$user_warnlevel[$result['u_id']]=0;
}
if ($result['value']=='-')
{
$user_warnlevel[$result['u_id']] -=1;
}
else
{
$user_warnlevel[$result['u_id']] +=1;
}
}
//check online for user
$sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE time+1250>".time();
$query = DataBase::sql_query($sql, 'GENERAL', 'Could not read user active.');
while($result = @mysql_fetch_array($query))
{
$user[$result['u_id']]['online']='1';
}
unset($sql, $query, $result);
//
//generate output pages
//
if ($_SESSION['uid']>0)
{
$limiter = $userdata['limit_tpid'];
}
else
{
$limiter = $forum_config['limit_tpid'];
}
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 = @mysql_fetch_array(DataBase::sql_query("SELECT COUNT(`p_id`) as `p_id`
FROM ".POSTS_TABLE." WHERE `t_id`='$tid'",'GENERAL','Could not obtain count amout of posts'));
$count = $count['p_id'];
$count = ceil($count / $limiter);
if(isset($_GET['page']) && ($_GET['page']>$count))
{
message_forum($lng['invalidpage'],'index.php');
}
//
//end generating pages
//
?>

15
includes/cache/index.html vendored Normal file
View File

@@ -0,0 +1,15 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled</title>
<meta http-equiv="refresh" content="0; url=../../index.php" />
</head>
<body>
<p>
</p>
</body>
</html>