+ Changed generating last post and post count in forum and topic.php
+ Deleted not used template file: post_add_body.tpl + Replaced MCP images git-svn-id: https://svn.pioder.pl/uf-svn/uF@21 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
@@ -18,7 +18,7 @@ class Forum
|
||||
global $forum_config;
|
||||
$forum = Topic::TopicInformation($tid,'f_id');
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id`",'GENERAL','Could not obtain forum information');
|
||||
$query = DataBase::sql_query("SELECT `name`, `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id`",GENERAL,'Could not obtain forum information');
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
@@ -38,7 +38,7 @@ class Forum
|
||||
function PostsInForum($forum_name)
|
||||
{
|
||||
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE." WHERE f_id='$forum_name'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain posts information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain posts information.');
|
||||
$result = DataBase::fetch($query);
|
||||
return $result['p_id'];
|
||||
}
|
||||
@@ -132,7 +132,7 @@ class Forum
|
||||
function ForumInformation($fid, $inf)
|
||||
{
|
||||
$sql = "SELECT `f_id`, `$inf` FROM ".FORUMS_TABLE." WHERE f_id='$fid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forum information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result[$inf];
|
||||
return $result;
|
||||
|
||||
@@ -16,9 +16,9 @@ class Mod
|
||||
function MoveTopic($tid, $fid)
|
||||
{
|
||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update topic');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update topic');
|
||||
$sql = "UPDATE `".POSTS_TABLE."` SET `f_id`='$fid' WHERE `t_id`='$tid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update post');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update post');
|
||||
}
|
||||
|
||||
function TopicLocked($tid)
|
||||
@@ -39,37 +39,37 @@ class Mod
|
||||
function DeleteTopic($topicid)
|
||||
{
|
||||
$sql="SELECT * FROM ".POSTS_TABLE." WHERE `t_id`='$topicid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain post information');
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$uid = Topic::PostInformation($item['p_id'],'u_id');
|
||||
$posts = User::UserInformation($uid,'posts');
|
||||
$posts = $posts -1;
|
||||
$sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update user amout of posts');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update user amout of posts');
|
||||
}
|
||||
$sql = "DELETE FROM ".POSTS_TABLE." WHERE t_id='$topicid';";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete topic posts.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete topic posts.');
|
||||
$sql = "DELETE FROM ".TOPICS_TABLE." WHERE t_id='$topicid';";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete topic posts.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete topic posts.');
|
||||
}
|
||||
|
||||
function LockTopic($topicid)
|
||||
{
|
||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '1' WHERE `t_id` =$topicid;";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not lock topic.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not lock topic.');
|
||||
}
|
||||
|
||||
function StickTopic($topicid, $mode)
|
||||
{
|
||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `sticky` = '$mode' WHERE `t_id` =$topicid;";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not stick topic.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not stick topic.');
|
||||
}
|
||||
|
||||
function UnlockTopic($topicid)
|
||||
{
|
||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `lock` = '0' WHERE `t_id` =$topicid;";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not unlock topic.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not unlock topic.');
|
||||
}
|
||||
|
||||
function DeletePost($postid)
|
||||
@@ -79,25 +79,25 @@ class Mod
|
||||
$posts = User::UserInformation($uid,'posts');
|
||||
$posts = $posts -1;
|
||||
$sql = "UPDATE `".USERS_TABLE."` SET `posts`='$posts' WHERE `u_id`='$uid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update user amout of posts');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update user amout of posts');
|
||||
$sql2 = "DELETE FROM ".POSTS_TABLE." WHERE p_id='$postid';";
|
||||
DataBase::sql_query($sql2,'GENERAL','Could not delete post.');
|
||||
DataBase::sql_query($sql2,GENERAL,'Could not delete post.');
|
||||
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id>'$postid' AND `t_id`='$tid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain post information.');
|
||||
while($item=DataBase::fetch($query))
|
||||
{
|
||||
$number = $item['tp_id'];
|
||||
$number = $number-1;
|
||||
$number2 = $item['p_id'];
|
||||
$sql3 = "UPDATE `".POSTS_TABLE."` SET `tp_id` = '$number' WHERE `p_id` =$number2;";
|
||||
DataBase::sql_query($sql3,'GENERAL','Could not update post.');
|
||||
DataBase::sql_query($sql3,GENERAL,'Could not update post.');
|
||||
}
|
||||
}
|
||||
|
||||
function AcceptPost($postid)
|
||||
{
|
||||
$sql = "UPDATE `".POSTS_TABLE."` SET `moderated`='0' WHERE `p_id`='$postid'";
|
||||
DataBase::sql_query($sql, 'GENERAL', 'Could not accept post');
|
||||
DataBase::sql_query($sql, GENERAL, 'Could not accept post');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -50,12 +50,12 @@ class Pms
|
||||
function DeleteMsgUser($mid)
|
||||
{
|
||||
$sql = "DELETE FROM `".PM_INBOX_TABLE."` WHERE `m_id`='$mid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete message in inbox');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete message in inbox');
|
||||
}
|
||||
function DeleteMsgAuthor($mid)
|
||||
{
|
||||
$sql = "DELETE FROM `".PM_SENTBOX_TABLE."` WHERE `m_id`='$mid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete message in sentbox');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete message in sentbox');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,14 +66,14 @@ class NewMessage
|
||||
$last = DataBase::new_id(PM_INBOX_TABLE);
|
||||
$time = time();
|
||||
$sql = "INSERT INTO `".PM_INBOX_TABLE."` VALUES ('$last', '$uid', '$name', '$text', '$time', '$unid','0')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add new message at inbox');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add new message at inbox');
|
||||
}
|
||||
function AddToSentbox($text, $name, $unid, $uid)
|
||||
{
|
||||
$last=DataBase::new_id(PM_SENTBOX_TABLE);
|
||||
$time = time();
|
||||
$sql = "INSERT INTO `".PM_SENTBOX_TABLE."` VALUES ('$last', '$uid', '$name', '$text', '$time', '$unid')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add new message at inbox');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add new message at inbox');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -19,7 +19,7 @@ class Post
|
||||
$last = DataBase::new_id(POSTS_TABLE);
|
||||
#read last post in topic
|
||||
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE t_id='$tid' ORDER BY tp_id DESC LIMIT 1;";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not last post information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not last post information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$forum = $result['f_id'];//forum id
|
||||
$moderate = Forum::ForumInformation($forum,'moderate');
|
||||
@@ -29,20 +29,20 @@ class Post
|
||||
$time = time();
|
||||
#add new post
|
||||
$sql = "INSERT INTO `".POSTS_TABLE."` VALUES ('$last','$tid', '$uid', '$post', '".$_SERVER['HTTP_USER_AGENT']."', '$time', '$tpid', '$forum','$moderate','".$_SERVER['REMOTE_ADDR']."')";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not add new post.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not add new post.');
|
||||
$result=User::UserInformation($uid,'posts');
|
||||
$result = $result+1;
|
||||
$sql="UPDATE ".TOPICS_TABLE." SET lastpost_time='$time' WHERE t_id='$tid' ";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.');
|
||||
TriggerStats($forum, 1);
|
||||
TriggerStats($tid, 2);
|
||||
$sql="UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' ";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not update user information.');
|
||||
return $tpid;
|
||||
}
|
||||
|
||||
function EditPost($postid, $text)
|
||||
{
|
||||
$sql = "UPDATE `".POSTS_TABLE."` SET text='$text' WHERE `p_id`='$postid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not edit post.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not edit post.');
|
||||
}
|
||||
|
||||
function NewTopic($posttext, $ntopic, $forum, $uid, $sticky)
|
||||
@@ -51,21 +51,25 @@ class Post
|
||||
$moderate = Forum::ForumInformation($forum,'moderate');
|
||||
$time = time();
|
||||
$lastt=DataBase::new_id(TOPICS_TABLE);
|
||||
$sql = "INSERT INTO ".TOPICS_TABLE." VALUES ('$lastt', '$forum', '0', '$sticky', '$ntopic', '$uid','$time')";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not add new topic');
|
||||
$sql = "INSERT INTO ".TOPICS_TABLE." VALUES ('$lastt', '$forum', '0', '$sticky', '$ntopic', '$uid','$time', '', '')";
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not add new topic');
|
||||
//add post
|
||||
//select last post
|
||||
$last = DataBase::new_id(POSTS_TABLE);
|
||||
//add post
|
||||
$sql = "INSERT INTO ".POSTS_TABLE." VALUES ('$last','$lastt', '$uid', '$posttext','".$_SERVER['HTTP_USER_AGENT']."', '$time', '1', '$forum', '$moderate','".$_SERVER['REMOTE_ADDR']."');";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not add new post.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not add new post.');
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['posts'];
|
||||
$result = $result+1;
|
||||
|
||||
TriggerStats($forum, 1);
|
||||
TriggerStats($lastt, 2);
|
||||
|
||||
$sql = "UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' ";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not update user information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not update user information.');
|
||||
return $lastt;
|
||||
}
|
||||
|
||||
@@ -74,7 +78,7 @@ class Post
|
||||
$text ='';
|
||||
$result='';
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Cold not obtain smiles information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Cold not obtain smiles information.');
|
||||
$i = 1;
|
||||
while($smile = DataBase::fetch($query))
|
||||
{
|
||||
@@ -98,7 +102,7 @@ class Post
|
||||
function SmilesReplace($text)
|
||||
{
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain emoticons information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain emoticons information.');
|
||||
$i = 1;
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
@@ -16,13 +16,15 @@ class Topic
|
||||
function LastPostInTopic($topic)
|
||||
{
|
||||
global $lng;
|
||||
global $lastpost;
|
||||
global $last_post;
|
||||
global $forum_config;
|
||||
global $userdata;
|
||||
$id = $lastpost[$topic]['tp_id'];
|
||||
$userid = $lastpost[$topic]['u_id'];
|
||||
$un = $lastpost[$topic]['user_nick'];
|
||||
$rank = $lastpost[$topic]['user_rank'];
|
||||
|
||||
$id = $last_post[0];
|
||||
$userid = $last_post[1];
|
||||
$un = $last_post[4];
|
||||
$rank = $last_post[3];
|
||||
|
||||
switch($rank)
|
||||
{
|
||||
case '0':
|
||||
@@ -58,18 +60,18 @@ class Topic
|
||||
{
|
||||
$page='';
|
||||
}
|
||||
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($lastpost[$topic]['time']).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>Post #'.$id.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>';
|
||||
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($last_post[2]).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>Post #'.$id.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>';
|
||||
}
|
||||
|
||||
function LastPostImg()
|
||||
{
|
||||
global $lastpost;
|
||||
global $last_post;
|
||||
global $record;
|
||||
global $default_skin;
|
||||
$time = time()-129600;
|
||||
if ($_SESSION['uid']>0)
|
||||
{
|
||||
if ($lastpost[$record['t_id']]['time']>$time)
|
||||
if ($last_post[2]>$time)
|
||||
{
|
||||
return 'folder_new_posts';
|
||||
}
|
||||
@@ -115,7 +117,7 @@ class Topic
|
||||
function TopicInformation($tid, $mode)
|
||||
{
|
||||
$sql = "SELECT * FROM ".TOPICS_TABLE." WHERE t_id='$tid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain topic information');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result[$mode];
|
||||
return $result;
|
||||
@@ -124,7 +126,7 @@ class Topic
|
||||
function PostInformation($pid, $mode)
|
||||
{
|
||||
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain topic information');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result[$mode];
|
||||
return $result;
|
||||
|
||||
@@ -24,7 +24,7 @@ class User
|
||||
function UserInformation($uid, $inf)
|
||||
{
|
||||
$sql = "SELECT `$inf` FROM ".USERS_TABLE." WHERE u_id='$uid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result[$inf];
|
||||
return $result;
|
||||
@@ -33,7 +33,7 @@ class User
|
||||
function UserIdByNick($nick)
|
||||
{
|
||||
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick';";
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'));
|
||||
$result = $result['u_id'];
|
||||
/*if ($result=='')
|
||||
{
|
||||
@@ -46,13 +46,13 @@ class User
|
||||
{
|
||||
$last= DataBase::new_id(USERS_GROUP_TABLE);
|
||||
$sql = "INSERT INTO `".USERS_GROUP_TABLE."` VALUES ('$last','$uid', '$gid')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add user to group.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add user to group.');
|
||||
}
|
||||
|
||||
function DeleteFromGroup($uid, $gid)
|
||||
{
|
||||
$sql = "DELETE FROM `".USERS_GROUP_TABLE."` WHERE `u_id`='$uid' AND `g_id`='$gid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete user for group.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete user for group.');
|
||||
}
|
||||
|
||||
function LogedAs($sid, $uid)
|
||||
@@ -119,7 +119,7 @@ class User
|
||||
if ($uid>0)
|
||||
{
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user`s rank information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user`s rank information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$rank = $result['rank'];
|
||||
if (($rank=='1') or ($rank=='2'))
|
||||
@@ -156,7 +156,7 @@ class User
|
||||
`view_shoutbox` = '$allow_shoutbox',
|
||||
`limit_users` = '$limit_users'
|
||||
WHERE `u_id` ='$uid' LIMIT 1 ;";
|
||||
DataBase::sql_query($sql,'CRITICAL','Could not update user information');
|
||||
DataBase::sql_query($sql,CRITICAL,'Could not update user information');
|
||||
}
|
||||
|
||||
function UpdateAdminPools($uid, $posts, $rank, $active, $nick)
|
||||
@@ -167,7 +167,7 @@ class User
|
||||
`active` = '$active',
|
||||
`nick` = '$nick'
|
||||
WHERE `u_id` ='$uid' LIMIT 1 ;";
|
||||
DataBase::sql_query($sql,'CRITICAL','Could not update user information');
|
||||
DataBase::sql_query($sql,CRITICAL,'Could not update user information');
|
||||
}
|
||||
|
||||
function UpdatePassword($uid, $pass)
|
||||
@@ -175,7 +175,7 @@ class User
|
||||
$sql ="UPDATE `".USERS_TABLE."` SET
|
||||
`pass` = '$pass'
|
||||
WHERE `u_id` ='$uid' LIMIT 1 ;";
|
||||
DataBase::sql_query($sql,'CRITICAL','Could not update user information');
|
||||
DataBase::sql_query($sql,CRITICAL,'Could not update user information');
|
||||
}
|
||||
|
||||
function CreateProfile($nick, $pass, $email, $gg, $allow_gg, $allow_email, $allow_qr, $sig, $av, $interests)
|
||||
@@ -185,7 +185,7 @@ class User
|
||||
$time = time();
|
||||
$sql = "INSERT INTO ".USERS_TABLE." VALUES
|
||||
('$last', '$nick', '$pass', '$email', '0', '$time', '0', '$gg', '$allow_gg', '$allow_email', '$allow_qr', '".$forum_config['view_shoutbox']."', '".$forum_config['defaultskin']."', '".$forum_config['defaultlang']."','".$forum_config['limit_tpid']."', '".$forum_config['limit_ftid']."', '".$forum_config['limit_users']."', '$sig', '$av', '1','0','$interests');";
|
||||
DataBase::sql_query($sql,'CRITICAL','Could not create new user');
|
||||
DataBase::sql_query($sql,CRITICAL,'Could not create new user');
|
||||
}
|
||||
|
||||
function UserMsgs()
|
||||
@@ -194,7 +194,7 @@ class User
|
||||
if($uid>0)
|
||||
{
|
||||
$sql = "SELECT count(*) as `m_id` FROM ".PM_INBOX_TABLE." WHERE `u_id`='$uid' AND `read`='0'";
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain amounts PM of User.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain amounts PM of User.'));
|
||||
$result = $result['m_id'];
|
||||
if ($result>0)
|
||||
{
|
||||
@@ -210,14 +210,14 @@ class User
|
||||
function UserAddWarn($uid, $value, $motive)
|
||||
{
|
||||
$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.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add new warn.');
|
||||
if (User::UserLevelWarns($uid)==100)
|
||||
{
|
||||
$ban_ip = '0.0.0.0';
|
||||
$ban_uid = $uid;
|
||||
$ban_motive = $lng['warns_ban'];
|
||||
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('', '$ban_uid', '$ban_ip', '$ban_motive')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update add ban.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update add ban.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT * FROM ".FORUMS_TABLE." WHERE f_id='$fid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forum information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['f_id'];
|
||||
if ($result=='')
|
||||
@@ -31,7 +31,7 @@ class Secure
|
||||
if ($forum_config['use_censorlist'])
|
||||
{
|
||||
$sql = "SELECT * FROM ".CENSORLIST_TABLE.";";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain censorlist information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain censorlist information.');
|
||||
while($word = DataBase::fetch($query))
|
||||
{
|
||||
$text = str_replace($word['word'],'[censored]', $text);
|
||||
@@ -68,7 +68,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['m_id'];
|
||||
if ($result=='')
|
||||
@@ -80,7 +80,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['u_n_id'];
|
||||
if ($result!=$_SESSION['uid'])
|
||||
@@ -92,7 +92,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT * FROM ".PM_INBOX_TABLE." WHERE m_id='$mid'";
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'));
|
||||
$result = $result['u_id'];
|
||||
if ($result!=$_SESSION['uid'])
|
||||
{
|
||||
@@ -103,7 +103,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT * FROM ".PM_SENTBOX_TABLE." WHERE m_id='$mid'";
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'));
|
||||
$result = $result['m_id'];
|
||||
if ($result=='')
|
||||
{
|
||||
@@ -114,7 +114,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT * FROM `".TOPICS_TABLE."` WHERE `t_id`='$tid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain topic information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['t_id'];
|
||||
if ($result=='')
|
||||
@@ -126,7 +126,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information.');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain topic information.');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['p_id'];
|
||||
if ($result=='')
|
||||
@@ -138,7 +138,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'";
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain user information.'));
|
||||
$result = $result['u_id'];
|
||||
if (($result=='') or ($result=='-1'))
|
||||
{
|
||||
@@ -149,7 +149,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT `g_id` FROM `".GROUPS_TABLE."` WHERE g_id='$gid'";
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain group information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain group information.'));
|
||||
$result = $result['g_id'];
|
||||
if ($result=='')
|
||||
{
|
||||
@@ -170,10 +170,10 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT `f_id`,`lock` FROM `".TOPICS_TABLE."` WHERE `t_id`='$tid'";
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain topic information'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain topic information'));
|
||||
$fid = $result['f_id'];
|
||||
$sql2 = "SELECT `lock` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'";
|
||||
$result2 = DataBase::fetch(DataBase::sql_query($sql2,'GENERAL','Could not obtain forum information'));
|
||||
$result2 = DataBase::fetch(DataBase::sql_query($sql2,GENERAL,'Could not obtain forum information'));
|
||||
if (($result['lock']=='1') or ($result2['lock']=='1'))
|
||||
{
|
||||
message_forum($lng['no_posting_topic_locked'],'topic.php?t='.$tid);
|
||||
@@ -183,7 +183,7 @@ class Secure
|
||||
{
|
||||
global $lng;
|
||||
$sql = "SELECT `lock` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'";
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,GENERAL,'Could not obtain forum information'));
|
||||
if ($result['lock']=='1')
|
||||
{
|
||||
message_forum($lng['no_posting_forum_locked'],'forum.php?f='.$fid);
|
||||
|
||||
Reference in New Issue
Block a user