+ Changed from MySQL to MySQLi native driver.
+ Added 2 new functions in DataBase class: fetch($query) and num_rows($query) git-svn-id: https://svn.pioder.pl/uf-svn/uF@20 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
@@ -36,7 +36,7 @@ function GenerateDefaultDisplay()
|
||||
$cache_id=1;
|
||||
$sql = "SELECT * FROM ".FORUMS_TABLE." ORDER BY `c_id`, `sort`";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.');
|
||||
while($result = @mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$forum[$cache_id]['f_id'] = $result['f_id'];
|
||||
$forum[$cache_id]['name'] = $result['name'];
|
||||
@@ -59,7 +59,7 @@ function GenerateDefaultDisplay()
|
||||
//add forums and categories
|
||||
$sql = "SELECT * FROM `".CATS_TABLE."` ORDER BY `sort`";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain categories information.');
|
||||
while($result = mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'category' => $result['name'],
|
||||
@@ -115,11 +115,11 @@ switch($_GET['mode'])
|
||||
{
|
||||
$cat_name = strip_tags($_POST['cat_name']);
|
||||
$sql = "SELECT `sort` FROM `".CATS_TABLE."` ORDER BY `sort` DESC LIMIT 1";
|
||||
$last = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain last category sort id'));
|
||||
$last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last category sort id'));
|
||||
$sort = $last ['sort'];
|
||||
$sort = $sort+1;
|
||||
$sql = "SELECT `c_id` FROM `".CATS_TABLE."` ORDER BY `c_id` DESC LIMIT 1";
|
||||
$last = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain last category id'));
|
||||
$last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last category id'));
|
||||
$last = $last['c_id'];
|
||||
$last = $last +1;
|
||||
$sql = "INSERT INTO `".CATS_TABLE."` VALUES ('$last','$cat_name','$sort')";
|
||||
@@ -169,11 +169,11 @@ switch($_GET['mode'])
|
||||
$forum_lock = (isset($_POST['forum_locked'])) ? 1 : 0;
|
||||
$allow_moderate = (isset($_POST['allow_moderate'])) ? 1 : 0;
|
||||
$sql = "SELECT `sort`, `c_id` FROM `".FORUMS_TABLE."` WHERE `c_id`='$forum_cat' ORDER BY `sort` DESC LIMIT 1";
|
||||
$last = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum sort id'));
|
||||
$last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum sort id'));
|
||||
$sort = $last ['sort'];
|
||||
$sort = $sort+1;
|
||||
$sql = "SELECT `f_id` FROM `".FORUMS_TABLE."` ORDER BY `f_id` DESC LIMIT 1";
|
||||
$last = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum id'));
|
||||
$last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum id'));
|
||||
$last = $last['f_id'];
|
||||
$last = $last +1;
|
||||
$sql = "INSERT INTO `".FORUMS_TABLE."` VALUES ('$last','$forum_lock','$allow_moderate', '$forum_name', '$forum_desc','$forum_cat','$sort')";
|
||||
@@ -243,13 +243,13 @@ switch($_GET['mode'])
|
||||
{
|
||||
$i1 = $_GET['c'];
|
||||
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `c_id`='$i1'";
|
||||
$s1 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$s1 = $s1['sort'];
|
||||
$s2 = $s1 -1;
|
||||
if ($s1>1)
|
||||
{
|
||||
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `sort`='$s2'";
|
||||
$s2 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$i2 = $s2['c_id'];
|
||||
$s2 = $s2['sort'];
|
||||
$sql = "UPDATE ".CATS_TABLE." SET `sort`='$s2' WHERE `c_id`='$i1'";
|
||||
@@ -266,14 +266,14 @@ switch($_GET['mode'])
|
||||
{
|
||||
$i1 = $_GET['f'];
|
||||
$sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='$i1'";
|
||||
$s1 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'));
|
||||
$s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'));
|
||||
$cid = $s1['c_id'];
|
||||
$s1 = $s1['sort'];
|
||||
$s2 = $s1 -1;
|
||||
if ($s1>1)
|
||||
{
|
||||
$sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `sort`='$s2' AND `c_id`='$cid'";
|
||||
$s2 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not forum forum information.'));
|
||||
$s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not forum forum information.'));
|
||||
$i2 = $s2['f_id'];
|
||||
$s2 = $s2['sort'];
|
||||
$sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s2' WHERE `f_id`='$i1'";
|
||||
@@ -306,15 +306,15 @@ switch($_GET['mode'])
|
||||
$i1 = $_GET['c'];
|
||||
$i2 = $i1 +1;
|
||||
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `c_id`='$i1'";
|
||||
$s1 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$s1 = $s1['sort'];
|
||||
$s2 = $s1 +1;
|
||||
$sql = "SELECT `c_id` FROM ".CATS_TABLE;
|
||||
$count = @mysql_num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$count = DataBase::num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
if ($s1<$count)
|
||||
{
|
||||
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `sort`='$s2'";
|
||||
$s2 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain category information.'));
|
||||
$i2 = $s2['c_id'];
|
||||
$s2 = $s2['sort'];
|
||||
$sql = "UPDATE ".CATS_TABLE." SET `sort`='$s2' WHERE `c_id`='$i1'";
|
||||
@@ -332,16 +332,16 @@ switch($_GET['mode'])
|
||||
$i1 = $_GET['f'];
|
||||
$i2 = $i1 +1;
|
||||
$sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='$i1'";
|
||||
$s1 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'));
|
||||
$s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'));
|
||||
$cid = $s1['c_id'];
|
||||
$s1 = $s1['sort'];
|
||||
$s2 = $s1 +1;
|
||||
$sql = "SELECT `f_id` FROM ".FORUMS_TABLE." WHERE `c_id`='$cid'";
|
||||
$count = @mysql_num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'));
|
||||
$count = DataBase::num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'));
|
||||
if ($s1<$count)
|
||||
{
|
||||
$sql = "SELECT `sort`, `f_id` FROM ".FORUMS_TABLE." WHERE `sort`='$s2'";
|
||||
$s2 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'));
|
||||
$s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.'));
|
||||
$i2 = $s2['f_id'];
|
||||
$s2 = $s2['sort'];
|
||||
$sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s2' WHERE `f_id`='$i1'";
|
||||
@@ -369,11 +369,11 @@ switch($_GET['mode'])
|
||||
$cid = intval($_GET['c']);
|
||||
$sql = "SELECT * FROM `".CATS_TABLE."` WHERE `c_id`='$cid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain category information');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$sort = $result['sort'];
|
||||
$sql = "SELECT * FROM `".CATS_TABLE."` WHERE `sort`>'$sort'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain categories information');
|
||||
while($item = @mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$new_sort = $item['sort']-1;
|
||||
$cid2 = $item['c_id'];
|
||||
@@ -382,7 +382,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
$sql = "SELECT `f_id` FROM `".FORUMS_TABLE."` WHERE `c_id`='$cid'";
|
||||
$query = DataBase::sql_query($sql, 'GENERAL','Could not obtain forum information.');
|
||||
while($item = @mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$fid = $item['f_id'];
|
||||
$sql="DELETE FROM `".POSTS_TABLE."` WHERE `f_id`='$fid'";
|
||||
@@ -403,11 +403,11 @@ switch($_GET['mode'])
|
||||
$fid = intval($_GET['f']);
|
||||
$sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$sort = $result['sort'];
|
||||
$sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `sort`>'$sort'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forums information');
|
||||
while($item = @mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$new_sort = $item['sort']-1;
|
||||
$fid1 = $item['f_id'];
|
||||
@@ -439,7 +439,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
$cat_name = strip_tags($_POST['cat_name']);
|
||||
$sql = "SELECT `sort`, `c_id` FROM `".FORUMS_TABLE."` WHERE `c_id`='$cat_name' ORDER BY `sort` DESC LIMIT 1";
|
||||
$last = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum sort id'));
|
||||
$last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last forum sort id'));
|
||||
$sort = $last ['sort'];
|
||||
$sort = $sort+1;
|
||||
$sql = "UPDATE `".CATS_TABLE."` SET `name`='$cat_name', `sort`='$sort' WHERE `c_id`='$cid'";
|
||||
@@ -455,7 +455,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp = mysql_fetch_array(DataBase::sql_query("SELECT `name` FROM `".CATS_TABLE."` WHERE `c_id`='$cid'",'GENERAL','Could not obtain category information'));
|
||||
$tmp = DataBase::fetch(DataBase::sql_query("SELECT `name` FROM `".CATS_TABLE."` WHERE `c_id`='$cid'",'GENERAL','Could not obtain category information'));
|
||||
$tmp = $tmp['name'];
|
||||
$_POST['cat_name'] = $tmp;
|
||||
if($tmp['name']=='')
|
||||
@@ -496,14 +496,14 @@ switch($_GET['mode'])
|
||||
$forum_cat = $_POST['forum_cat'];
|
||||
$sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$actual_cid = $result['c_id'];
|
||||
$sort = $result['sort'];
|
||||
if ($actual_cid != $forum_cat)
|
||||
{
|
||||
$sql = "SELECT * FROM `".FORUMS_TABLE."` WHERE `c_id`='$forum_cat' ORDER BY `sort` DESC LIMIT 1";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forums information');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$sort = $result['sort']+1;
|
||||
}
|
||||
|
||||
@@ -535,7 +535,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp = mysql_fetch_array(DataBase::sql_query("SELECT `name`, `desc` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'",'GENERAL','Could not obtain forum information'));
|
||||
$tmp = DataBase::fetch(DataBase::sql_query("SELECT `name`, `desc` FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'",'GENERAL','Could not obtain forum information'));
|
||||
$_POST['forum_name'] = $tmp['name'];
|
||||
$msg='./../skins/'.$default_skin.'/blank.tpl';
|
||||
$_POST['forum_desc'] = $tmp['desc'];
|
||||
|
||||
@@ -42,7 +42,7 @@ function GenerateDefaultDisplay()
|
||||
include('./template/groups_beam_body.tpl');
|
||||
$sql = "SELECT `g_id`, `name`, `desc` FROM `".GROUPS_TABLE."` ORDER BY `sort`";
|
||||
$query = DataBase::sql_query($sql, 'GENERAL', 'Could not obtain groups information.');
|
||||
while($item = mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'g_id'=>$item['g_id'],
|
||||
@@ -87,11 +87,11 @@ switch($_GET['mode'])
|
||||
$group_name = htmlspecialchars($_POST['group_name']);
|
||||
$group_desc = htmlspecialchars($_POST['group_desc']);
|
||||
$group_mod = User::UserIdByNick(htmlspecialchars($_POST['group_mod']));
|
||||
$result = @mysql_fetch_array(DataBase::sql_query("SELECT `sort` FROM `".GROUPS_TABLE."`
|
||||
$result = DataBase::fetch(DataBase::sql_query("SELECT `sort` FROM `".GROUPS_TABLE."`
|
||||
ORDER BY `sort` DESC LIMIT 1",'GENERAL','Could not obtain last category sort id'));
|
||||
$group_sort = $result['sort'];
|
||||
$group_sort = $group_sort+1;
|
||||
$result = @mysql_fetch_array(DataBase::sql_query("SELECT
|
||||
$result = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`g_id` FROM ".GROUPS_TABLE." ORDER BY `g_id` DESC LIMIT 1",'GENERAL','Could not obtain last group id.'));
|
||||
$group_id = $result['g_id'];
|
||||
$group_id = $group_id+1;
|
||||
@@ -161,7 +161,7 @@ switch($_GET['mode'])
|
||||
else
|
||||
{
|
||||
$sql = "SELECT * FROM `".GROUPS_TABLE."` WHERE `g_id`='$gid'";
|
||||
$g = @mysql_fetch_array(DataBase::sql_query($sql, 'GENERAL','Could not obtain group information.'));
|
||||
$g = DataBase::fetch(DataBase::sql_query($sql, 'GENERAL','Could not obtain group information.'));
|
||||
$_POST['group_name'] = $g['name'];
|
||||
$_POST['group_desc'] = $g['desc'];
|
||||
$_POST['group_mod'] = User::UserInformation($g['m_id'],'nick');
|
||||
@@ -188,13 +188,13 @@ switch($_GET['mode'])
|
||||
{
|
||||
$i1 = intval($_GET['id']);
|
||||
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `g_id`='$i1'";
|
||||
$s1 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$s1 = $s1['sort'];
|
||||
$s2 = $s1 -1;
|
||||
if ($s1>1)
|
||||
{
|
||||
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `sort`='$s2'";
|
||||
$s2 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$i2 = $s2['g_id'];
|
||||
$s2 = $s2['sort'];
|
||||
$sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s2' WHERE `g_id`='$i1'";
|
||||
@@ -213,15 +213,15 @@ switch($_GET['mode'])
|
||||
$i1 = intval($_GET['id']);
|
||||
$i2 = $i1 +1;
|
||||
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `g_id`='$i1'";
|
||||
$s1 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$s1 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$s1 = $s1['sort'];
|
||||
$s2 = $s1 +1;
|
||||
$sql = "SELECT `g_id` FROM ".GROUPS_TABLE;
|
||||
$count = @mysql_num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$count = DataBase::num_rows(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
if ($s1<$count)
|
||||
{
|
||||
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `sort`='$s2'";
|
||||
$s2 = @mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$s2 = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain group information.'));
|
||||
$i2 = $s2['g_id'];
|
||||
$s2 = $s2['sort'];
|
||||
$sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s2' WHERE `g_id`='$i1'";
|
||||
|
||||
@@ -34,7 +34,7 @@ function AddSkins()
|
||||
global $forum_config;
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information');
|
||||
while($t = @mysql_fetch_array($query))
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
if ($t['s_id']==$forum_config['defaultskin'])
|
||||
|
||||
@@ -196,7 +196,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
}
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='$uid'";
|
||||
$userinfo = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain user information'));
|
||||
$userinfo = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain user information'));
|
||||
if ($userinfo['rank']=='')
|
||||
{
|
||||
admin_message_forum($lng['no_user'],'admin_users.php?mode=view');
|
||||
@@ -296,7 +296,7 @@ switch($_GET['mode'])
|
||||
$limit = 'LIMIT 0, 30';
|
||||
$page=1;
|
||||
}
|
||||
$count = @mysql_fetch_array(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id`
|
||||
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id`
|
||||
FROM ".USERS_TABLE,'GENERAL','Could not obtain count amout of users'));
|
||||
$count = $count['u_id'];
|
||||
$count = ceil($count /30);
|
||||
@@ -429,7 +429,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
}
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain user information.');
|
||||
while($result = mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'id'=>$result['u_id'],
|
||||
|
||||
@@ -113,7 +113,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
message_forum($lng['no_ban_me'],'banlist.php?mode=view');
|
||||
}
|
||||
$bid =$bid = @mysql_fetch_array(DataBase::sql_query("SELECT
|
||||
$bid =$bid = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL',
|
||||
'Could not obtain last ban id'));
|
||||
$bid = $bid['b_id'];
|
||||
@@ -167,7 +167,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
message_forum($lng['no_ban_me'],'banlist.php?mode=view');
|
||||
}
|
||||
$bid =$bid = @mysql_fetch_array(DataBase::sql_query("SELECT
|
||||
$bid =$bid = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL',
|
||||
'Could not obtain last ban id'));
|
||||
$bid = $bid['b_id'];
|
||||
@@ -214,7 +214,7 @@ switch($_GET['mode'])
|
||||
$open = fopen($catalog.$_FILES['file']['name'],'r');
|
||||
$file = fread($open, filesize($catalog.$_FILES['file']['name']));
|
||||
$item = @explode("\n",$file);
|
||||
$bid = $bid = @mysql_fetch_array(DataBase::sql_query("SELECT
|
||||
$bid = $bid = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL',
|
||||
'Could not obtain last ban id'));
|
||||
$bid = $bid['b_id'];
|
||||
@@ -296,7 +296,7 @@ switch($_GET['mode'])
|
||||
$bid = $_GET['id'];
|
||||
$sql = "SELECT * FROM ".BANLIST_TABLE." WHERE `b_id`='$bid'";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain banlist item information');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$_POST['ip']=$result['IP'];
|
||||
$_POST['motive'] = $result['motive'];
|
||||
$_POST['u_id'] = ($result['u_id']>0) ? User::UserInformation($result['u_id'],'nick') : 'No profile';
|
||||
@@ -327,7 +327,7 @@ switch($_GET['mode'])
|
||||
case 'view':
|
||||
{
|
||||
$query = DataBase::sql_query("SELECT `u_id`, `nick` FROM ".USERS_TABLE,'GENERAL','Could not obtain user information');
|
||||
while($result = @mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$user[$result['u_id']]['nick'] = $result['nick'];
|
||||
}
|
||||
@@ -344,14 +344,14 @@ switch($_GET['mode'])
|
||||
);
|
||||
Admin_Over::GenerateHeader();
|
||||
include('./template/banlist_view_body.tpl');
|
||||
if (@mysql_num_rows($query)<1)
|
||||
if (DataBase::num_rows($query)<1)
|
||||
{
|
||||
echo '<tr><td width="'.TABLES_WIDTH.'" colspan="5" height="19"
|
||||
class="fitem"><p class="fstandard" align="center">'.$lng['banlist_no_items'].'!</p></td></tr>';
|
||||
}
|
||||
else
|
||||
{
|
||||
while($item = @mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'user_name'=>($item['u_id']>-1) ? $user[$item['u_id']]['nick'] : 'No profile',
|
||||
|
||||
@@ -51,7 +51,7 @@ switch($_GET['mode'])
|
||||
$file = fread($open, filesize($catalog.$_FILES['file']['name']));
|
||||
$item = @explode(',',$file);
|
||||
$sql = "SELECT `w_id` FROM ".CENSORLIST_TABLE." ORDER BY `w_id` DESC";
|
||||
$last = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain last word id'));
|
||||
$last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last word id'));
|
||||
$last = $last['w_id'];
|
||||
$last= $last +1;
|
||||
for($i=0;$i<count($item);$i++)
|
||||
@@ -91,7 +91,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
$word = strip_tags($_POST['word']);
|
||||
$sql = "SELECT `w_id` FROM ".CENSORLIST_TABLE." ORDER BY `w_id` DESC";
|
||||
$last = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain last word id'));
|
||||
$last = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain last word id'));
|
||||
$last = $last['w_id'];
|
||||
$last= $last +1;
|
||||
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",'GENERAL','Could not add censored word.');
|
||||
@@ -128,7 +128,7 @@ switch($_GET['mode'])
|
||||
$wid = intval($_GET['w']);
|
||||
$sql = "SELECT * FROM ".CENSORLIST_TABLE." WHERE `w_id`='$wid'";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain censorlist words');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$_POST['word']=$result['word'];
|
||||
$skin = array(
|
||||
'action'=>'censorlist.php?mode=edit&w='.$wid,
|
||||
@@ -160,14 +160,14 @@ switch($_GET['mode'])
|
||||
);
|
||||
Admin_Over::GenerateHeader();
|
||||
include('./template/censorlist_view_body.tpl');
|
||||
if (@mysql_num_rows($query)<1)
|
||||
if (DataBase::num_rows($query)<1)
|
||||
{
|
||||
echo '<table class="maintable"><tr><td width="'.TABLES_WIDTH.'" colspan="8" height="19"
|
||||
class="fitem"><p class="fstandard" align="center">'.$lng['no_words'].'!</p></td></tr></table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
while($item = @mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'L.word_name'=>$item['word'],
|
||||
|
||||
@@ -47,7 +47,7 @@ function check_size_md5($file)
|
||||
function mysqlversion()
|
||||
{
|
||||
$temp = '';
|
||||
$result = mysql_fetch_array(DataBase::sql_query("SELECT VERSION() AS mysql_version",'GENERAL','Could not read mysql version.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query("SELECT VERSION() AS mysql_version",'GENERAL','Could not read mysql version.'));
|
||||
$result = $result['mysql_version'];
|
||||
for($i=0;$i<5;$i++)
|
||||
{
|
||||
@@ -63,7 +63,7 @@ function db_size()
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
$db_size = 0;
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain database size');
|
||||
while ($result = @mysql_fetch_array($query))
|
||||
while ($result = DataBase::fetch($query))
|
||||
{
|
||||
$db_size += $result['Index_length'];
|
||||
}
|
||||
@@ -146,7 +146,12 @@ $skin=array(
|
||||
//php version
|
||||
'L.php_version'=>$lng['php_version'],
|
||||
'PHP.version'=>phpversion(),
|
||||
'PHP.value' => (phpversion()>='4.3.10') ? '<font color="green">OK</font>' : ' <font color="red">Error - No OK</font>',
|
||||
'PHP.value' => (phpversion()>='5.0.7') ? '<font color="green">OK</font>' : ' <font color="red">Error - No OK</font>',
|
||||
|
||||
//extension MySQLi loaded?
|
||||
'L.mySQLi_loaded'=>$lng['mysqli_loaded'],
|
||||
'mySQLi_loaded'=>(extension_loaded('mysqli')) ? $lng['yes'] : $lng['no'],
|
||||
'mySQLi_loaded.value'=> (extension_loaded('mysqli')) ? '<font color="green">OK</font>' : ' <font color="red">Error - No OK</font>',
|
||||
|
||||
//mysql version
|
||||
'mySQL.version'=>$sql_version,
|
||||
|
||||
@@ -49,7 +49,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE." ORDER BY `s_id` DESC LIMIT 1";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain smilelist item information');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$smile_id = $result['s_id'];
|
||||
$smile_id = $smile_id +1;
|
||||
$smile_word = strip_tags($_POST['word']);
|
||||
@@ -92,7 +92,7 @@ switch($_GET['mode'])
|
||||
$open = @fopen($catalog.$_FILES['file']['name'],'r');
|
||||
$file = @fread($open, filesize($catalog.$_FILES['file']['name']));
|
||||
$item = @explode("\n",$file);
|
||||
$bid = $bid = @mysql_fetch_array(DataBase::sql_query("SELECT
|
||||
$bid = $bid = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`s_id` FROM ".SMILES_TABLE." ORDER BY `s_id` DESC",'GENERAL',
|
||||
'Could not obtain last smile id'));
|
||||
$sid = $sid['s_id'];
|
||||
@@ -157,7 +157,7 @@ switch($_GET['mode'])
|
||||
$sid = intval($_GET['id']);
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE." WHERE `s_id`='$sid'";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain smilelist item information');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
if ($result['s_id']=='')
|
||||
{
|
||||
admin_message_forum($lng['no_smile'],'smilelist.php?mode=view');
|
||||
@@ -198,14 +198,14 @@ switch($_GET['mode'])
|
||||
);
|
||||
Admin_Over::GenerateHeader();
|
||||
include('./template/smilelist_view_body.tpl');
|
||||
if (@mysql_num_rows($query)<1)
|
||||
if (DataBase::num_rows($query)<1)
|
||||
{
|
||||
echo '<table class="maintable"><tr><td width="'.TABLES_WIDTH.'" colspan="8" height="19"
|
||||
class="fitem"><p class="fstandard" align="center">'.$lng['smilelist_no_items'].'!</p></td></tr></table>';
|
||||
}
|
||||
else
|
||||
{
|
||||
while($item = @mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'smile_word'=>$item['smile'],
|
||||
|
||||
@@ -90,7 +90,7 @@ switch($_GET['mode'])
|
||||
include('./template/skins_beam_body.tpl');
|
||||
$sql = "SELECT * FROM ".SKINS_TABLE;
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain skins information');
|
||||
while ($item = @mysql_fetch_array($query))
|
||||
while ($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin=array(
|
||||
'L.delete' => $lng['delete'],
|
||||
|
||||
@@ -23,6 +23,14 @@
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fitem" align="right" width="40%" height="19">
|
||||
<span class="fstandard"><?= $skin['L.mySQLi_loaded']; ?> (<?= $skin['mySQLi_loaded']?>): </span>
|
||||
</td>
|
||||
<td class="fitem" width="60%" height="19">
|
||||
<span class="fstandard"><b><?= $skin['mySQLi_loaded.value'] ?></b></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fitem" align="right" width="40%" height="19">
|
||||
<span class="fstandard"><?= $skin['L.mySQL_version']; ?> (<?= $skin['mySQL.version']?>): </span>
|
||||
</td>
|
||||
|
||||
10
common.php
10
common.php
@@ -13,10 +13,14 @@ if (is_dir('install'))
|
||||
die('<font color="red" face="Verdana" size="6">Please delete or rename catalog "install"</font>');
|
||||
}
|
||||
|
||||
if (phpversion()<'5.0.7')
|
||||
{
|
||||
die('µForum requires PHP 5.0.7 or later');
|
||||
}
|
||||
//set global preferences from DataBase
|
||||
$sql="SELECT * FROM ".CONFIG_TABLE."";
|
||||
$query=DataBase::sql_query($sql,'CRITICAL','Could not obtain config information');
|
||||
while($result=mysql_fetch_array($query))
|
||||
while($result=DataBase::fetch($query))
|
||||
{
|
||||
if (($result['name']=='') or ($result['name']=='0'))
|
||||
{
|
||||
@@ -49,7 +53,7 @@ if ($_SESSION['uid']>0)
|
||||
$ip = $_SERVER['REMOTE_ADDR'];
|
||||
$uid = $_SESSION['uid'];
|
||||
$sql = "SELECT `IP`, `u_id`, `motive` FROM ".BANLIST_TABLE." WHERE `IP`='$ip' OR `u_id`='$uid'";
|
||||
$result = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain ban information'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain ban information'));
|
||||
$motive = $result['motive'];
|
||||
$db_ip = $result['IP'];
|
||||
$db_uid = $result['u_id'];
|
||||
@@ -73,7 +77,7 @@ else
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='-1'";
|
||||
}
|
||||
$query = DataBase::sql_query($sql, 'GENERAL','Could not obtain loged user information');
|
||||
$userdata = mysql_fetch_array($query);
|
||||
$userdata = DataBase::fetch($query);
|
||||
define('RANK', $userdata['rank']);
|
||||
|
||||
define('TABLES_WIDTH',$forum_config['tables_width']);
|
||||
|
||||
@@ -54,10 +54,10 @@ include('./skins/'.$default_skin.'/overall_header.tpl');
|
||||
include('./skins/'.$default_skin.'/forum_body.tpl');
|
||||
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".TOPICS_TABLE.".author = ".USERS_TABLE.".u_id WHERE f_id='$fid' ORDER BY `sticky` DESC, `lastpost_time` DESC $limit;";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topics information');
|
||||
$value = mysql_num_rows($query);
|
||||
$value = DataBase::num_rows($query);
|
||||
if ($value>0)
|
||||
{
|
||||
while($record = mysql_fetch_array($query))
|
||||
while($record = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
't_id'=>$record['t_id'],
|
||||
|
||||
10
groups.php
10
groups.php
@@ -69,7 +69,7 @@ if(isset($_GET['mode']))
|
||||
$_POST['delnick']='';
|
||||
}
|
||||
$sql = "SELECT `g_id`, `name`, `desc`, `m_id` FROM `".GROUPS_TABLE."` WHERE `g_id`='$gid'";
|
||||
$group = mysql_fetch_array(DataBase::sql_query($sql, 'GENERAL', 'Could not obtain groups information.'));
|
||||
$group = DataBase::fetch(DataBase::sql_query($sql, 'GENERAL', 'Could not obtain groups information.'));
|
||||
if ($group['g_id']=='')
|
||||
{
|
||||
message_forum($lng['no_group'], 'index.php');
|
||||
@@ -90,10 +90,10 @@ if(isset($_GET['mode']))
|
||||
include('./skins/'.$default_skin.'/group_view_head_body.tpl');
|
||||
$sql = "SELECT ".USERS_GROUP_TABLE.".*, ".USERS_TABLE.".* FROM `".USERS_GROUP_TABLE."` LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id =".USERS_GROUP_TABLE.".u_id WHERE `g_id`='$gid'";
|
||||
$query = DataBase::sql_query($sql, 'GENERAL', 'Could not obtain users in groups information.');
|
||||
$amout = @mysql_num_rows($query);
|
||||
$amout = DataBase::num_rows($query);
|
||||
if ($amout>0)
|
||||
{
|
||||
while($result = mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'id'=>$result['u_id'],
|
||||
@@ -143,9 +143,9 @@ else
|
||||
include('./skins/'.$default_skin.'/overall_header.tpl');
|
||||
$sql = "SELECT `g_id`, `name`, `desc` FROM `".GROUPS_TABLE."` ORDER BY `sort`";
|
||||
$query = DataBase::sql_query($sql, 'GENERAL', 'Could not obtain groups information.');
|
||||
if (@mysql_num_rows($query)>0)
|
||||
if (DataBase::num_rows($query)>0)
|
||||
{
|
||||
while($item = mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'g_id'=>$item['g_id'],
|
||||
|
||||
@@ -19,7 +19,7 @@ class Admin_Forum
|
||||
$cat = Forum::ForumInformation($fid,'c_id');
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `c_id` FROM `".CATS_TABLE."`",'GENERAL','Could not obtain category information');
|
||||
while($t = @mysql_fetch_array($query))
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
if ($t['c_id']==$cat)
|
||||
|
||||
@@ -38,7 +38,7 @@ class Admin_Over
|
||||
global $default_skin;
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information');
|
||||
while($t = @mysql_fetch_array($query))
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
if ($t['name']==$default_skin)
|
||||
@@ -104,14 +104,14 @@ class Admin_Over
|
||||
{
|
||||
$result = User::UserInformation($_SESSION['uid'],'skin');
|
||||
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
|
||||
$result = mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.'));
|
||||
return $result['name'];
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $forum_config['defaultskin'];
|
||||
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
|
||||
$result = mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.'));
|
||||
return $result['name'];
|
||||
}
|
||||
}
|
||||
@@ -131,14 +131,14 @@ class Admin_Over
|
||||
{
|
||||
$sql = "SELECT `t_id` FROM ".TOPICS_TABLE.";";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information');
|
||||
$result = mysql_num_rows($query);
|
||||
$result = DataBase::num_rows($query);
|
||||
return($result);
|
||||
}
|
||||
function TotalPosts()
|
||||
{
|
||||
$sql = "SELECT `p_id` FROM ".POSTS_TABLE.";";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information');
|
||||
$result = mysql_num_rows($query);
|
||||
$result = DataBase::num_rows($query);
|
||||
return($result);
|
||||
}
|
||||
function GenerateHeader()
|
||||
|
||||
8
includes/cache/cache_forums.php
vendored
8
includes/cache/cache_forums.php
vendored
@@ -14,7 +14,7 @@ if(!defined('IN_uF'))
|
||||
//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 = @mysql_fetch_array(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['name']=='')
|
||||
{
|
||||
message_forum($lng['no_forum'],'index.php');
|
||||
@@ -25,13 +25,13 @@ $forum = array(
|
||||
);
|
||||
$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))
|
||||
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 = @mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
|
||||
$lastpost[$result['t_id']]['u_id']=$result['u_id'];
|
||||
@@ -65,7 +65,7 @@ else
|
||||
$limit = 'LIMIT 0, '.$limiter;
|
||||
$page=1;
|
||||
}
|
||||
$count = @mysql_fetch_array(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id`
|
||||
$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);
|
||||
|
||||
19
includes/cache/cache_index.php
vendored
19
includes/cache/cache_index.php
vendored
@@ -15,34 +15,23 @@ if(!defined('IN_uF'))
|
||||
//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))
|
||||
while($result = DataBase::fetch($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'];
|
||||
$forum[$cache_id]['lastpost'] = $result['lastpost'];
|
||||
$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;
|
||||
$lastuser = DataBase::fetch($query);
|
||||
$count_users = DataBase::num_rows($query) -1;
|
||||
?>
|
||||
|
||||
10
includes/cache/cache_topic.php
vendored
10
includes/cache/cache_topic.php
vendored
@@ -13,7 +13,7 @@ if(!defined('IN_uF'))
|
||||
}
|
||||
//||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'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain forum information'));
|
||||
if ($result['t_id']=='')
|
||||
{
|
||||
message_forum($lng['no_topic'], 'index.php');
|
||||
@@ -30,8 +30,8 @@ $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))
|
||||
$result = DataBase::num_rows($query);
|
||||
while ($result = DataBase::fetch($query))
|
||||
{
|
||||
if(!isset($user_warnlevel[$result['u_id']]))
|
||||
{
|
||||
@@ -50,7 +50,7 @@ while ($result = @mysql_fetch_array($query))
|
||||
//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))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$user[$result['u_id']]['online']='1';
|
||||
}
|
||||
@@ -81,7 +81,7 @@ else
|
||||
$limit = 'LIMIT 0, '.$limiter;
|
||||
$page=1;
|
||||
}
|
||||
$count = @mysql_fetch_array(DataBase::sql_query("SELECT COUNT(`p_id`) as `p_id`
|
||||
$count = DataBase::fetch(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);
|
||||
|
||||
@@ -19,7 +19,7 @@ class Forum
|
||||
$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');
|
||||
while($t = @mysql_fetch_array($query))
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
if ($t['f_id']==$forum)
|
||||
@@ -39,7 +39,7 @@ class Forum
|
||||
{
|
||||
$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.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
return $result['p_id'];
|
||||
}
|
||||
|
||||
@@ -47,17 +47,18 @@ class Forum
|
||||
{
|
||||
global $lng;
|
||||
global $user;
|
||||
global $last_post;
|
||||
global $lastpost;
|
||||
global $userdata;
|
||||
global $forum_config;
|
||||
if ($posts==0) { return '<p align="center" class="fstandard">'.$lng['nopost'].'</p>';}
|
||||
else
|
||||
{
|
||||
$id = $last_post[$forum]['tp_id'];
|
||||
$topic = $last_post[$forum]['t_id'];
|
||||
$userid = $last_post[$forum]['u_id'];
|
||||
$un = $last_post[$forum]['user_nick'];
|
||||
$rank = $last_post[$forum]['user_rank'];
|
||||
$id = $lastpost[0];
|
||||
$userid = $lastpost[1];
|
||||
$topic = $lastpost[2];
|
||||
$rank = $lastpost[4];
|
||||
$un = $lastpost[5];
|
||||
|
||||
switch($rank)
|
||||
{
|
||||
case '0':
|
||||
@@ -93,13 +94,13 @@ class Forum
|
||||
{
|
||||
$page='';
|
||||
}
|
||||
return '<p align="center"><span class="fverysmall"><b>'.GenerateTime($last_post[$forum]['time']).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>'.$lng['topic'].' #'.$topic.'</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($lastpost[3]).'</b><br></span> <a href="topic.php?t='.$topic.$page.'#p'.$id.'" class="fverysmall"><b>'.$lng['topic'].' #'.$topic.'</b></a><a class="fsmall">: </a><a href="user.php?id='.$userid.'" class="fverysmall">'.$user_color_name.'</a></p>';
|
||||
}
|
||||
}
|
||||
|
||||
function LastPostImg($postsinforum)
|
||||
{
|
||||
global $last_post;
|
||||
global $lastpost;
|
||||
global $i;
|
||||
global $forum;
|
||||
global $default_skin;
|
||||
@@ -108,7 +109,7 @@ class Forum
|
||||
{
|
||||
if ($postsinforum>0)
|
||||
{
|
||||
if ($last_post[$forum[$i]['f_id']]['time']>$time)
|
||||
if ($lastpost[3]>$time)
|
||||
{
|
||||
return 'folder_new_posts';
|
||||
}
|
||||
@@ -132,7 +133,7 @@ class Forum
|
||||
{
|
||||
$sql = "SELECT `f_id`, `$inf` FROM ".FORUMS_TABLE." WHERE f_id='$fid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forum information.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result[$inf];
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class Mod
|
||||
{
|
||||
$sql="SELECT * FROM ".POSTS_TABLE." WHERE `t_id`='$topicid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain post information');
|
||||
while($item = @mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$uid = Topic::PostInformation($item['p_id'],'u_id');
|
||||
$posts = User::UserInformation($uid,'posts');
|
||||
@@ -84,7 +84,7 @@ class Mod
|
||||
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.');
|
||||
while($item=mysql_fetch_array($query))
|
||||
while($item=DataBase::fetch($query))
|
||||
{
|
||||
$number = $item['tp_id'];
|
||||
$number = $number-1;
|
||||
|
||||
@@ -20,7 +20,7 @@ class Post
|
||||
#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.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$forum = $result['f_id'];//forum id
|
||||
$moderate = Forum::ForumInformation($forum,'moderate');
|
||||
$tpid = $result['tp_id'];//post in topic id
|
||||
@@ -61,7 +61,7 @@ class 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.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['posts'];
|
||||
$result = $result+1;
|
||||
$sql = "UPDATE ".USERS_TABLE." SET posts='$result' WHERE u_id='$uid' ";
|
||||
@@ -76,7 +76,7 @@ class Post
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Cold not obtain smiles information.');
|
||||
$i = 1;
|
||||
while($smile = mysql_fetch_array($query))
|
||||
while($smile = DataBase::fetch($query))
|
||||
{
|
||||
$action = "insertSmile('".$smile['url']."','".$smile['smile']."')";
|
||||
$mouse = "this.style.cursor='hand';";
|
||||
@@ -100,7 +100,7 @@ class Post
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain emoticons information.');
|
||||
$i = 1;
|
||||
while($result = mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$smile[$i]['smile'] = $result['smile'];
|
||||
$smile[$i]['url'] = $result['url'];
|
||||
|
||||
@@ -116,7 +116,7 @@ class Topic
|
||||
{
|
||||
$sql = "SELECT * FROM ".TOPICS_TABLE." WHERE t_id='$tid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result[$mode];
|
||||
return $result;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ class Topic
|
||||
{
|
||||
$sql = "SELECT * FROM ".POSTS_TABLE." WHERE p_id='$pid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain topic information');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result[$mode];
|
||||
return $result;
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class User
|
||||
{
|
||||
$sql = "SELECT `$inf` FROM ".USERS_TABLE." WHERE u_id='$uid';";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$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 = mysql_fetch_array(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=='')
|
||||
{
|
||||
@@ -120,7 +120,7 @@ class User
|
||||
{
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE u_id='$uid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user`s rank information.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$rank = $result['rank'];
|
||||
if (($rank=='1') or ($rank=='2'))
|
||||
{
|
||||
@@ -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 = mysql_fetch_array(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)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,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.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['f_id'];
|
||||
if ($result=='')
|
||||
{
|
||||
@@ -32,7 +32,7 @@ class Secure
|
||||
{
|
||||
$sql = "SELECT * FROM ".CENSORLIST_TABLE.";";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain censorlist information.');
|
||||
while($word = mysql_fetch_array($query))
|
||||
while($word = DataBase::fetch($query))
|
||||
{
|
||||
$text = str_replace($word['word'],'[censored]', $text);
|
||||
}
|
||||
@@ -69,7 +69,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.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['m_id'];
|
||||
if ($result=='')
|
||||
{
|
||||
@@ -81,7 +81,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.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$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 = mysql_fetch_array(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 = mysql_fetch_array(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=='')
|
||||
{
|
||||
@@ -115,7 +115,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.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['t_id'];
|
||||
if ($result=='')
|
||||
{
|
||||
@@ -127,7 +127,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.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$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 = mysql_fetch_array(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 = mysql_fetch_array(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 = mysql_fetch_array(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 = mysql_fetch_array(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 = mysql_fetch_array(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);
|
||||
|
||||
@@ -11,16 +11,35 @@ if ( !defined('IN_uF') )
|
||||
{
|
||||
die('Hacking attempt');
|
||||
}
|
||||
|
||||
$db;
|
||||
|
||||
class DataBase
|
||||
{
|
||||
function db_connect()
|
||||
{
|
||||
$connect = mysql_pconnect(DB_HOST, DB_USER, DB_PASS) or message_die('CRITICAL',' Could not connect to database server.',mysql_error());
|
||||
mysql_query("SET NAMES 'utf8'",$connect);
|
||||
mysql_select_db(DB_NAME, $connect) or message_die('CRITICAL',' Could not connect to database.',mysql_error());
|
||||
global $db;
|
||||
|
||||
$db = new mysqli(DB_HOST, DB_USER, DB_PASS);
|
||||
if (mysqli_connect_errno() != 0)
|
||||
{
|
||||
message_die('CRITICAL',' Could not connect to database server.',$db->error);
|
||||
}
|
||||
|
||||
if (!$db->set_charset("UTF8"))
|
||||
{
|
||||
message_die('CRITICAL', 'Could not set character set UTF-8', $db->error);
|
||||
}
|
||||
if (!$db->select_db(DB_NAME))
|
||||
{
|
||||
message_die('CRITICAL',' Could not select database.', $db->error);
|
||||
}
|
||||
}
|
||||
|
||||
function sql_query($sql, $type, $msg, $no_count = false)
|
||||
{
|
||||
global $db;
|
||||
|
||||
if (isset($_COOKIE['queries']))
|
||||
{
|
||||
$no_count = false;
|
||||
@@ -30,11 +49,28 @@ class DataBase
|
||||
}
|
||||
}
|
||||
//echo '<span class="fsmall">'.$sql.'<br></span>'; //for optimizing only
|
||||
$query = mysql_query($sql) or message_die($type, $msg, mysql_error());
|
||||
if (!$query = $db->query($sql))
|
||||
{
|
||||
message_die($type, $msg, $db->error);
|
||||
}
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
function fetch($query)
|
||||
{
|
||||
return $query->fetch_array();
|
||||
}
|
||||
|
||||
function num_rows($query)
|
||||
{
|
||||
return $query->num_rows;
|
||||
}
|
||||
|
||||
function new_id($table)
|
||||
{
|
||||
global $db;
|
||||
|
||||
//check table id
|
||||
switch($table)
|
||||
{
|
||||
@@ -55,7 +91,7 @@ class DataBase
|
||||
case WARNINGS_TABLE: { $id = 'w_id'; break; }
|
||||
}
|
||||
$sql = "SELECT `$id` FROM $table ORDER BY `$id` DESC LIMIT 1";
|
||||
$return_id = mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Error with obtain last id.<br> File: db.php, Line: '.__LINE__));
|
||||
$return_id = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Error with obtain last id.<br> File: db.php, Line: '.__LINE__));
|
||||
$return_id = $return_id[$id];
|
||||
$return_id = $return_id+1;
|
||||
return $return_id;
|
||||
|
||||
@@ -79,7 +79,7 @@ function SendMassEmail($title,$content)
|
||||
{
|
||||
$sql = "SELECT `email`,`u_id` FROM ".USERS_TABLE." WHERE `u_id`>0";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not read users table');
|
||||
while($item = @mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
SendEmail($item['email'], $title, $content);
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ function AddSkins()
|
||||
global $default_skin;
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information');
|
||||
while($t = @mysql_fetch_array($query))
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
if ($t['name']==$default_skin)
|
||||
@@ -278,7 +278,7 @@ function TotalPosts()
|
||||
{
|
||||
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['p_id'];
|
||||
|
||||
return($result);
|
||||
@@ -338,15 +338,13 @@ function ViewSkinName()
|
||||
$result = $forum_config['defaultskin'];
|
||||
}
|
||||
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
|
||||
$result = mysql_fetch_array(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql,'CRITICAL','Could not obtain skin information.'));
|
||||
|
||||
return $result['name'];
|
||||
}
|
||||
|
||||
function GenerateLastPost($id, $type)
|
||||
{
|
||||
$last_post = '';
|
||||
|
||||
{
|
||||
switch ($type)
|
||||
{
|
||||
/** field lastpost in forum format
|
||||
@@ -356,8 +354,8 @@ function GenerateLastPost($id, $type)
|
||||
{
|
||||
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".POSTS_TABLE.".u_id = ".USERS_TABLE.".u_id WHERE `f_id`='$id' ORDER BY `ptime` LIMIT 1";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain last post in forum', true);
|
||||
$post_count = @mysql_num_rows($query);
|
||||
$result = mysql_fetch_array($query);
|
||||
$post_count = DataBase::num_rows($query);
|
||||
$result = DataBase::fetch($query);
|
||||
|
||||
$last_post .= $result['tp_id'];
|
||||
$last_post .= ':';
|
||||
@@ -385,7 +383,55 @@ function GenerateLastPost($id, $type)
|
||||
{
|
||||
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `t_id`='$id' ORDER BY `ptime` LIMIT 1";
|
||||
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in topic');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
|
||||
$last_post .= $result['tp_id'];
|
||||
$last_post .= ':';
|
||||
$last_post .= $result['u_id'];
|
||||
$last_post .= ':';
|
||||
$last_post .= $result['ptime'];
|
||||
$last_post .= ':';
|
||||
$last_post .= $result['rank'];
|
||||
$last_post .= ':';
|
||||
$last_post .= $result['nick'];
|
||||
|
||||
$sql = "UPDATE ".TOPICS_TABLE." SET
|
||||
`lastpost`='$last_post'
|
||||
WHERE `t_id`='$id'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update lastpost in topic');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function GeneratePosts($id, $type)
|
||||
{
|
||||
switch ($type)
|
||||
{
|
||||
case 1: //for forum
|
||||
{
|
||||
$sql = "SELECT COUNT (`p_id`) AS 'count', `f_id` FROM ".POSTS_TABLE." WHERE `f_id`='$id'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain posts in forum', true);
|
||||
$post_count = DataBase::num_rows($query);
|
||||
$result = DataBase::fetch($query);
|
||||
|
||||
$posts = $result['count'];
|
||||
|
||||
$sql = "UPDATE ".FORUMS_TABLE." SET
|
||||
`posts`='$last_post'
|
||||
WHERE `f_id`='$id'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update lastpost in forum');
|
||||
break;
|
||||
}
|
||||
|
||||
/** field lastpost in topic format
|
||||
tp_id:u_id:ptime:rank:nick
|
||||
*/
|
||||
case 2: //for topic
|
||||
{
|
||||
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `t_id`='$id' ORDER BY `ptime` LIMIT 1";
|
||||
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in topic');
|
||||
$result = DataBase::fetch($query);
|
||||
|
||||
$last_post .= $result['tp_id'];
|
||||
$last_post .= ':';
|
||||
|
||||
@@ -5,9 +5,9 @@
|
||||
//
|
||||
$sql = "SELECT `u_id`,`nick`,`rank` FROM `".USERS_TABLE."`";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forums information');
|
||||
$user['count']= mysql_num_rows($query);
|
||||
$user['count']= DataBase::num_rows($query);
|
||||
|
||||
while($result = mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$user[$result['u_id']]['u_id']=$result['u_id'];
|
||||
$user[$result['u_id']]['nick']=$result['nick'];
|
||||
@@ -53,7 +53,7 @@ switch($_GET['submode'])
|
||||
}
|
||||
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain messages information');
|
||||
$count = mysql_num_rows($query);
|
||||
$count = DataBase::num_rows($query);
|
||||
|
||||
if ($count==0)
|
||||
{
|
||||
@@ -61,7 +61,7 @@ if ($count==0)
|
||||
}
|
||||
else
|
||||
{
|
||||
while($item=mysql_fetch_array($query))
|
||||
while($item=DataBase::fetch($query))
|
||||
{
|
||||
$skin=array(
|
||||
'mid'=>$item['m_id'],
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain emoticons information.');
|
||||
$i = 1;
|
||||
while($result = mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$smile[$i]['smile'] = $result['smile'];
|
||||
$smile[$i]['url'] = $result['url'];
|
||||
@@ -34,7 +34,7 @@ switch($_GET['submode'])
|
||||
}
|
||||
}
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain messages information');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
//if message exist....
|
||||
if ($result['m_id']=='')
|
||||
{
|
||||
@@ -69,7 +69,7 @@ if ($_GET['submode']=='user')
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='".$result['u_n_id']."'";
|
||||
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information');
|
||||
$user = @mysql_fetch_array($query);
|
||||
$user = DataBase::fetch($query);
|
||||
|
||||
$folder = ($_GET['submode']=='author') ? '<a href="pms.php?mode=folder&submode=sentbox" class="navigator">'.$lng['sentbox'].'</a>' : '<a href="pms.php?mode=folder&submode=inbox" class="navigator">'.$lng['inbox'].'</a>';
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ if ((isset($_POST['textedit'])) and (isset($_POST['nmsg'])) and (isset($_POST['u
|
||||
{
|
||||
$nick = strip_tags($_POST['username']);
|
||||
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick'";
|
||||
$result = mysql_fetch_array(DataBase::sql_query($sql, 'CRITICAL','Could not obtain user information.'));
|
||||
$result = DataBase::fetch(DataBase::sql_query($sql, 'CRITICAL','Could not obtain user information.'));
|
||||
if ($result['u_id']!='')
|
||||
{
|
||||
$_POST['textedit'] = Secure::TagsReplace($_POST['textedit']);
|
||||
|
||||
@@ -58,8 +58,16 @@ function SessRegister()
|
||||
SessDelete($uid);
|
||||
$time = time();
|
||||
$sql = "INSERT INTO ".SESSIONS_TABLE." VALUES ('', '".$_COOKIE[SESS_NAME]."','$uid','$time')";
|
||||
$result = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not add new session.',true));
|
||||
return $result;
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not add new session.',true);
|
||||
if (DataBase::num_rows($query)>0)
|
||||
{
|
||||
$result = DataBase::fetch();
|
||||
return $result;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +84,7 @@ function SessDelInvalid()
|
||||
{
|
||||
$sql = "SELECT `session_id`, `u_id` FROM ".SESSIONS_TABLE." WHERE `u_id`='".$_SESSION['uid']."'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain session information',true);
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['session_id'];
|
||||
if ($_COOKIE[SESS_NAME]!=$result)
|
||||
{
|
||||
@@ -90,9 +98,13 @@ function SessDelete($uid)
|
||||
{
|
||||
$time = time();
|
||||
$sql = "DELETE FROM ".SESSIONS_TABLE." WHERE u_id='$uid'";
|
||||
$result = @mysql_fetch_array(DataBase::sql_query($sql, 'GENERAL','Could not delete session',true));
|
||||
$_SESSION['sessionid']='0';
|
||||
return $result['count'];
|
||||
$query = DataBase::sql_query($sql, 'GENERAL','Could not delete session',true);
|
||||
if (DataBase::num_rows($query)>0)
|
||||
{
|
||||
$result = DataBase::fetch($query);
|
||||
$_SESSION['sessionid']='0';
|
||||
return $result['count'];
|
||||
}
|
||||
}
|
||||
|
||||
function SessView()
|
||||
@@ -104,9 +116,9 @@ function SessView()
|
||||
$time = time();
|
||||
$sql = "SELECT ".SESSIONS_TABLE.".*, ".USERS_TABLE.".*, ".SESSIONS_TABLE.".u_id AS u_id FROM ".SESSIONS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".SESSIONS_TABLE.".u_id = ".USERS_TABLE.".u_id WHERE time+1250>$time;";
|
||||
$query = DataBase::sql_query($sql, 'GENERAL','Could not obtain sessions information.');
|
||||
if (@mysql_num_rows($query)>0)
|
||||
if (DataBase::num_rows($query)>0)
|
||||
{
|
||||
while($result = @mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$uid = $result['u_id'];
|
||||
switch($result['rank'])
|
||||
@@ -134,6 +146,6 @@ function SessView()
|
||||
{
|
||||
$name = '<span class="userlink">'.$lng['empty'].'</span>';
|
||||
}
|
||||
return array($name, @mysql_num_rows($query));
|
||||
return array($name, DataBase::num_rows($query));
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -55,7 +55,7 @@ include('./skins/'.$default_skin.'/index_body.tpl');
|
||||
$isset_forum = array();
|
||||
$sql = "SELECT * FROM `".CATS_TABLE."` ORDER BY `sort`";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain categories information.');
|
||||
while($result = @mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'category' => $result['name'],
|
||||
@@ -70,7 +70,8 @@ while($result = @mysql_fetch_array($query))
|
||||
if(!@in_array($forum[$i]['f_id'],$isset_forum))
|
||||
{
|
||||
array_push($isset_forum, $forum[$i]['f_id']);
|
||||
$postsinforum = (isset($count_forum[$forum[$i]['f_id']])) ? $count_forum[$forum[$i]['f_id']] : '0';
|
||||
$lastpost = explode(':',$forum[$i]['lastpost']);
|
||||
$postsinforum = (isset($count_forum[$forum[$i]['f_id']])) ? $count_forum[$forum[$i]['f_id']] : '0';
|
||||
$skin = array(
|
||||
'new_post' => Forum::LastPostImg($postsinforum),
|
||||
'forum_name' => $forum[$i]['name'],
|
||||
|
||||
@@ -136,7 +136,7 @@ switch($_GET['page'])
|
||||
'L.value'=>$lng['value'],
|
||||
'L.php_version'=>$lng['php_version'],
|
||||
'PHP.version'=>phpversion(),
|
||||
'PHP.value' => (phpversion()>='4.3.10') ? '<font color="green">OK</font>' : ' <font color="red">Error - No OK</font>',
|
||||
'PHP.value' => (phpversion()>='5.0.7') ? '<font color="green">OK</font>' : ' <font color="red">Error - No OK</font>',
|
||||
'mySQL.version'=>mysql_get_client_info(),
|
||||
'L.mySQL_version'=>$lng['mysql_version'],
|
||||
'mySQL.value'=>(mysql_get_client_info()>='4.1') ? '<font color="green">OK</font>' : ' <font color="red">Error - No OK</font>',
|
||||
|
||||
@@ -119,12 +119,13 @@ $lng['actual_sum']='Aktualna wartość';
|
||||
$lng['files_is_good']='Wszystkie pliki są poprawne!';
|
||||
$lng['files_not_good']='Nie wszystkie pliki są poprawne. Jest ich: ';
|
||||
$lng['php_version']='Wersja PHP';
|
||||
$lng['mysql_version']='Wersja mySQL';
|
||||
$lng['mysql_version']='Wersja serwera MySQL';
|
||||
$lng['not_writable']='Katalog nie do zapisu!';
|
||||
$lng['is_writable']='Katalog do zapisu';
|
||||
$lng['catalog']='Katalog';
|
||||
$lng['db_size']='Wielkość bazy';
|
||||
$lng['forum_size']='Wielkość plików forum';
|
||||
$lng['mysqli_loaded']='Rozszerzenie MySQLi załadowane';
|
||||
//
|
||||
//on forum config....--------------------------------------------------
|
||||
//
|
||||
|
||||
@@ -66,7 +66,7 @@ if (isset($_GET['mode']))
|
||||
$pass = md5(strip_tags($_POST['pass']));
|
||||
$sql = "SELECT `u_id`, `nick`, `pass` FROM `".USERS_TABLE."` WHERE nick='$user'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user inforamtion');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$nick = $result['nick'];
|
||||
if ($result['nick']==$user)
|
||||
{
|
||||
|
||||
@@ -298,7 +298,7 @@ switch(trim($_GET['mode']))
|
||||
$_POST['textedit']='';
|
||||
}
|
||||
$sql = "SELECT `lock`, `name`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='".intval($_GET['f'])."'";
|
||||
$forum = mysql_fetch_array(DataBase::sql_query($sql, 'GENERAL', 'Could not obtain forum information'));
|
||||
$forum = DataBase::fetch(DataBase::sql_query($sql, 'GENERAL', 'Could not obtain forum information'));
|
||||
if($forum['name']=='')
|
||||
{
|
||||
message_forum($lng['no_forum'], 'index.php');
|
||||
|
||||
@@ -53,7 +53,7 @@ if ( ereg ("^.+@.+\..+$", $_POST['email']))
|
||||
{
|
||||
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information.');
|
||||
$result = mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['nick'];
|
||||
if ($result!=$nick)
|
||||
{
|
||||
|
||||
12
search.php
12
search.php
@@ -31,7 +31,7 @@ SessRegister();
|
||||
SessDeleteOld();
|
||||
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id ORDER BY `ptime`";
|
||||
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum');
|
||||
while($result = @mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
|
||||
$lastpost[$result['t_id']]['u_id']=$result['u_id'];
|
||||
@@ -41,7 +41,7 @@ while($result = @mysql_fetch_array($query))
|
||||
}
|
||||
$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))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$count_topic[$result['t_id']]=$result['p_id'];
|
||||
}
|
||||
@@ -104,7 +104,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
{
|
||||
if (isset($_GET['u']))
|
||||
{
|
||||
$count = @mysql_fetch_array(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id`
|
||||
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id`
|
||||
FROM ".TOPICS_TABLE." WHERE `author`='".intval($_GET['u'])."'",'GENERAL','Could not obtain count amout of topics'));
|
||||
$count = $count['t_id'];
|
||||
$count = ceil($count / $limiter);
|
||||
@@ -139,7 +139,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
$like_where .=' OR `text` LIKE \'%'.$keyword[$i].'%\'';
|
||||
}
|
||||
$sql = "SELECT COUNT(".TOPICS_TABLE.".t_id) as `count`, ".POSTS_TABLE.".* FROM ".TOPICS_TABLE." LEFT JOIN ".POSTS_TABLE." ON ".POSTS_TABLE.".t_id = ".TOPICS_TABLE.".t_id WHERE $like_where GROUP BY `t_id`";
|
||||
$count = @mysql_fetch_array(DataBase::sql_query($sql,'GENERAL','Could not obtain count amout of topics'));
|
||||
$count = DataBase::fetch(DataBase::sql_query($sql,'GENERAL','Could not obtain count amout of topics'));
|
||||
$count = $count['count'];
|
||||
$count = ceil($count / $limiter);
|
||||
if ($count==0)
|
||||
@@ -179,11 +179,11 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
include('./skins/'.$default_skin.'/overall_header.tpl');
|
||||
include('./skins/'.$default_skin.'/forum_body.tpl');
|
||||
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain topics information');
|
||||
$value = mysql_num_rows($query);
|
||||
$value = DataBase::num_rows($query);
|
||||
if ($value>0)
|
||||
{
|
||||
$isset_topics = array();
|
||||
while($record = mysql_fetch_array($query))
|
||||
while($record = DataBase::fetch($query))
|
||||
{
|
||||
if (!in_array($record['t_id'], $isset_topics))
|
||||
{
|
||||
|
||||
@@ -59,7 +59,7 @@ else
|
||||
$shoutbox_content = '';
|
||||
$sql = "SELECT ".SHOUTBOX_TABLE.".*, ".USERS_TABLE.".* FROM ".SHOUTBOX_TABLE." LEFT JOIN ".USERS_TABLE." ON ".SHOUTBOX_TABLE.".u_id = ".USERS_TABLE.".u_id ORDER BY `mtime` $desc LIMIT ".$forum_config['shoutbox_max'];
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain shoutbox information');
|
||||
while($sb_msg = @mysql_fetch_array($query))
|
||||
while($sb_msg = DataBase::fetch($query))
|
||||
{
|
||||
$allow_del = (RANK>0) ? '<a href="index.php?mode=shoutbox_delete&id='.$sb_msg['m_id'].'" class="fsmall">X</a><span class="small"> </span>' : '';
|
||||
$shoutbox_content .= '
|
||||
|
||||
@@ -55,7 +55,7 @@ include('./skins/'.$default_skin.'/topic_body.tpl');
|
||||
|
||||
$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".*, ".USERS_TABLE.".u_id AS user_id,".SESSIONS_TABLE.".* FROM `".POSTS_TABLE."` LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id LEFT JOIN ".SESSIONS_TABLE." ON ".SESSIONS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE t_id='$tid' ORDER BY tp_id $limit;";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain post information.');
|
||||
while($item=mysql_fetch_array($query))
|
||||
while($item=DataBase::fetch($query))
|
||||
{
|
||||
$ua = UserAgent($item['user_agent']);
|
||||
$warn_pool = ($forum_config['allow_warns'] && $forum_config['warns_in_topic'] ) ? (isset($user_warnlevel[$item['u_id']])) ?
|
||||
|
||||
8
user.php
8
user.php
@@ -32,7 +32,7 @@ $uid = intval($_GET['id']);
|
||||
//check online for user
|
||||
$sql = "SELECT `s_id`, `u_id`, `time` FROM ".SESSIONS_TABLE." WHERE `u_id`='$uid' AND time+1250>".time()." LIMIT 1";
|
||||
$query = DataBase::sql_query($sql, 'GENERAL', 'Could not read user active.');
|
||||
$result = @mysql_fetch_array($query);
|
||||
$result = DataBase::fetch($query);
|
||||
if ($result['u_id']==$uid)
|
||||
{
|
||||
$active = 1;
|
||||
@@ -45,8 +45,8 @@ unset($sql, $query, $result);
|
||||
$userwarn = 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 = mysql_num_rows($query);
|
||||
while ($result = @mysql_fetch_array($query))
|
||||
$result = DataBase::num_rows($query);
|
||||
while ($result = DataBase::fetch($query))
|
||||
{
|
||||
if ($result['value']=='-')
|
||||
{
|
||||
@@ -61,7 +61,7 @@ $userwarn = ($userwarn>0) ? $userwarn*10 : $userwarn;
|
||||
//add skin variables
|
||||
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE u_id='$uid'";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain user information');
|
||||
$user_info = @mysql_fetch_array($query);
|
||||
$user_info = DataBase::fetch($query);
|
||||
if ($user_info['u_id']=='')
|
||||
{
|
||||
message_forum($lng['no_user'],'index.php');
|
||||
|
||||
@@ -53,7 +53,7 @@ else
|
||||
$limit = 'LIMIT 0, '.$limiter;
|
||||
$page=1;
|
||||
}
|
||||
$count = @mysql_fetch_array(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id`
|
||||
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id`
|
||||
FROM ".USERS_TABLE,'GENERAL','Could not obtain count amout of users'));
|
||||
$count = $count['u_id'] -1;
|
||||
$count = ceil($count / $limiter);
|
||||
@@ -190,7 +190,7 @@ switch($_COOKIE['users_sort'])
|
||||
}
|
||||
}
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain user information.');
|
||||
while($result = mysql_fetch_array($query))
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'id'=>$result['u_id'],
|
||||
|
||||
@@ -121,7 +121,7 @@ switch(trim($_GET['mode']))
|
||||
$uid = $_GET['id'];
|
||||
$sql = "SELECT `u_id`, `nick` FROM `".USERS_TABLE."` WHERE `u_id`='$uid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information');
|
||||
$user = @mysql_fetch_array($query);
|
||||
$user = DataBase::fetch($query);
|
||||
if ($user['u_id']=='')
|
||||
{
|
||||
message_forum($lng['no_user'],'index.php');
|
||||
@@ -136,9 +136,9 @@ switch(trim($_GET['mode']))
|
||||
include('./skins/'.$default_skin.'/warns_view_body.tpl');
|
||||
$sql = "SELECT * FROM `".WARNINGS_TABLE."` WHERE `u_id`='$uid'";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information');
|
||||
$result = mysql_num_rows($query);
|
||||
$result = DataBase::num_rows($query);
|
||||
$warns_count = 0;
|
||||
while($item = mysql_fetch_array($query))
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
'value'=>$item['value'],
|
||||
|
||||
Reference in New Issue
Block a user