+ Censorlist was extended - added replacement parametr
+ 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
This commit is contained in:
16
includes/cache/cache_forums.php
vendored
16
includes/cache/cache_forums.php
vendored
@@ -23,22 +23,6 @@ $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 = DataBase::fetch($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 = DataBase::fetch($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
|
||||
//
|
||||
|
||||
6
includes/cache/cache_index.php
vendored
6
includes/cache/cache_index.php
vendored
@@ -17,7 +17,9 @@ if(!defined('IN_uF'))
|
||||
//lastpost in forum cache
|
||||
//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`";
|
||||
$sql = "SELECT ".FORUMS_TABLE.".*
|
||||
FROM ".FORUMS_TABLE."
|
||||
ORDER BY `c_id`, `sort`";
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
@@ -27,7 +29,7 @@ while($result = DataBase::fetch($query))
|
||||
$forum[$cache_id]['c_id'] = $result['c_id'];
|
||||
$forum[$cache_id]['sort'] = $result['sort'];
|
||||
$forum[$cache_id]['lastpost'] = $result['lastpost'];
|
||||
$count_forum[$result['f_id']] = $result['amout'];
|
||||
$count_forum[$result['f_id']] = $result['posts'];
|
||||
$cache_id+=1;
|
||||
}
|
||||
$sql = "SELECT `u_id`,`nick`, `regdate` AS count FROM ".USERS_TABLE." ORDER BY `regdate` DESC";
|
||||
|
||||
25
includes/cache/cache_topic.php
vendored
25
includes/cache/cache_topic.php
vendored
@@ -18,16 +18,23 @@ 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'];
|
||||
|
||||
$topic = array(
|
||||
'name' => $result['topic_name'],
|
||||
'lock' => $result['topic_lock'],
|
||||
'sticky' => $result['sticky'],
|
||||
'f_id' => $result['f_id']
|
||||
);
|
||||
|
||||
$forum = array(
|
||||
'name' => $result['name'],
|
||||
'lock' => $result['lock'],
|
||||
'moderate' => $result['moderate']
|
||||
);
|
||||
|
||||
$fid = $topic['f_id'];
|
||||
$forum['name']=$result['name'];
|
||||
$forum['lock']=$result['lock'];
|
||||
$forum['moderate']=$result['moderate'];
|
||||
|
||||
|
||||
//user warnings level
|
||||
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."`";
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information');
|
||||
$result = DataBase::num_rows($query);
|
||||
@@ -54,7 +61,9 @@ while($result = DataBase::fetch($query))
|
||||
{
|
||||
$user[$result['u_id']]['online']='1';
|
||||
}
|
||||
|
||||
unset($sql, $query, $result);
|
||||
|
||||
//
|
||||
//generate output pages
|
||||
//
|
||||
|
||||
@@ -209,6 +209,7 @@ class User
|
||||
|
||||
function UserAddWarn($uid, $value, $motive)
|
||||
{
|
||||
global $lng;
|
||||
$sql = "INSERT INTO `".WARNINGS_TABLE."` ( `w_id` , `u_id` , `value` , `motive` ) VALUES('','$uid','$value','$motive');";
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add new warn.');
|
||||
if (User::UserLevelWarns($uid)==100)
|
||||
@@ -220,5 +221,31 @@ class User
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update add ban.');
|
||||
}
|
||||
}
|
||||
|
||||
function UserLevelWarns($uid)
|
||||
{
|
||||
$level =0;
|
||||
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information');
|
||||
$result = DataBase::num_rows($query);
|
||||
while ($result = @DataBase::fetch($query))
|
||||
{
|
||||
if ($result['value']=='-')
|
||||
{
|
||||
$level = $level -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$level = $level +1;
|
||||
}
|
||||
}
|
||||
//version 1.0 Alpha 2
|
||||
//delete second query
|
||||
if ($level>0)
|
||||
{
|
||||
$level = $level*10;
|
||||
}
|
||||
return $level;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -33,8 +33,8 @@ class Secure
|
||||
$sql = "SELECT * FROM ".CENSORLIST_TABLE.";";
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain censorlist information.');
|
||||
while($word = DataBase::fetch($query))
|
||||
{
|
||||
$text = str_replace($word['word'],'[censored]', $text);
|
||||
{
|
||||
$text = str_replace($word['word'],$word['replace'], $text);
|
||||
}
|
||||
}
|
||||
return $text;
|
||||
|
||||
@@ -64,7 +64,6 @@ class DataBase
|
||||
|
||||
function num_rows($query)
|
||||
{
|
||||
// return $query->num_rows;
|
||||
if ($query===true || $query===false)
|
||||
{
|
||||
return 0;
|
||||
|
||||
@@ -138,7 +138,7 @@ function UserAgent($agent)
|
||||
function GenerateTime($request_time)
|
||||
{
|
||||
global $lng;
|
||||
if (date('d-m-Y',$request_time)== date('d-m-Y',time()))
|
||||
if (date('d M Y',$request_time)== date('d M Y',time()))
|
||||
{
|
||||
$date = $lng['today'].', '.date('G:i', $request_time);
|
||||
}
|
||||
@@ -150,7 +150,7 @@ function GenerateTime($request_time)
|
||||
}
|
||||
else
|
||||
{
|
||||
$date = date('d-m-Y, G:i',$request_time);
|
||||
$date = date('d M Y, G:i',$request_time);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -284,12 +284,12 @@ function TotalPosts()
|
||||
return($result);
|
||||
}
|
||||
|
||||
function DefaultLang()
|
||||
function DefaultLang($active = false)
|
||||
{
|
||||
global $forum_config;
|
||||
global $userdata;
|
||||
|
||||
if ($_SESSION['uid']>0)
|
||||
if ($_SESSION['uid']>0 && !$active)
|
||||
{
|
||||
return $userdata['lang'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user