+ 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
@@ -35,7 +35,7 @@ function GenerateDefaultDisplay()
|
||||
//cache forums --don't modify!!!
|
||||
$cache_id=1;
|
||||
$sql = "SELECT * FROM ".FORUMS_TABLE." ORDER BY `c_id`, `sort`";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain forum information.');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$forum[$cache_id]['f_id'] = $result['f_id'];
|
||||
@@ -58,7 +58,7 @@ function GenerateDefaultDisplay()
|
||||
include('./template/forums_beam_body.tpl');
|
||||
//add forums and categories
|
||||
$sql = "SELECT * FROM `".CATS_TABLE."` ORDER BY `sort`";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain categories information.');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain categories information.');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
@@ -115,15 +115,15 @@ switch($_GET['mode'])
|
||||
{
|
||||
$cat_name = strip_tags($_POST['cat_name']);
|
||||
$sql = "SELECT `sort` FROM `".CATS_TABLE."` ORDER BY `sort` DESC LIMIT 1";
|
||||
$last = DataBase::fetch(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 = DataBase::fetch(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')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add category');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add category');
|
||||
$msg='./template/blank.tpl';
|
||||
admin_message_forum($lng['cat_saved'],'admin_forums.php');
|
||||
}
|
||||
@@ -169,15 +169,15 @@ 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 = DataBase::fetch(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 = DataBase::fetch(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')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add forum');
|
||||
$sql = "INSERT INTO `".FORUMS_TABLE."` VALUES ('$last','$forum_lock','$allow_moderate', '$forum_name', '$forum_desc', '0', '','$forum_cat','$sort')";
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add forum');
|
||||
$msg='./../skins/'.$default_skin.'/blank.tpl';
|
||||
admin_message_forum($lng['forum_saved'],'admin_forums.php');
|
||||
}
|
||||
@@ -243,19 +243,19 @@ switch($_GET['mode'])
|
||||
{
|
||||
$i1 = $_GET['c'];
|
||||
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `c_id`='$i1'";
|
||||
$s1 = DataBase::fetch(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 = DataBase::fetch(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'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update category position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update category position');
|
||||
$sql = "UPDATE ".CATS_TABLE." SET `sort`='$s1' WHERE `c_id`='$i2'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update category position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update category position');
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -266,20 +266,20 @@ switch($_GET['mode'])
|
||||
{
|
||||
$i1 = $_GET['f'];
|
||||
$sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='$i1'";
|
||||
$s1 = DataBase::fetch(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 = DataBase::fetch(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'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update forum position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update forum position');
|
||||
$sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s1' WHERE `f_id`='$i2'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update forum position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update forum position');
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -306,21 +306,21 @@ switch($_GET['mode'])
|
||||
$i1 = $_GET['c'];
|
||||
$i2 = $i1 +1;
|
||||
$sql = "SELECT `sort`, `c_id` FROM ".CATS_TABLE." WHERE `c_id`='$i1'";
|
||||
$s1 = DataBase::fetch(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 = DataBase::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 = DataBase::fetch(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'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update category position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update category position');
|
||||
$sql = "UPDATE ".CATS_TABLE." SET `sort`='$s1' WHERE `c_id`='$i2'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update category position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update category position');
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -332,22 +332,22 @@ switch($_GET['mode'])
|
||||
$i1 = $_GET['f'];
|
||||
$i2 = $i1 +1;
|
||||
$sql = "SELECT `sort`, `c_id`, `f_id` FROM ".FORUMS_TABLE." WHERE `f_id`='$i1'";
|
||||
$s1 = DataBase::fetch(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 = DataBase::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 = DataBase::fetch(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'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update forum position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update forum position');
|
||||
$sql = "UPDATE ".FORUMS_TABLE." SET `sort`='$s1' WHERE `f_id`='$i2'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update forum position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update forum position');
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -368,32 +368,32 @@ 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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain category information');
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain categories information');
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$new_sort = $item['sort']-1;
|
||||
$cid2 = $item['c_id'];
|
||||
$sql2 = "UPDATE `".CATS_TABLE."` SET `sort`='$new_sort' WHERE `c_id`='$cid2'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update category');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update category');
|
||||
}
|
||||
$sql = "SELECT `f_id` FROM `".FORUMS_TABLE."` WHERE `c_id`='$cid'";
|
||||
$query = DataBase::sql_query($sql, 'GENERAL','Could not obtain forum information.');
|
||||
$query = DataBase::sql_query($sql, GENERAL,'Could not obtain forum information.');
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$fid = $item['f_id'];
|
||||
$sql="DELETE FROM `".POSTS_TABLE."` WHERE `f_id`='$fid'";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not delete post.');
|
||||
DataBase::sql_query($sql, GENERAL,'Could not delete post.');
|
||||
$sql = "DELETE FROM `".TOPICS_TABLE."` WHERE `f_id`='$fid'";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not delete topic');
|
||||
DataBase::sql_query($sql, GENERAL,'Could not delete topic');
|
||||
}
|
||||
$sql = "DELETE FROM `".FORUMS_TABLE."` WHERE `c_id`='$cid'";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not delete topic');
|
||||
DataBase::sql_query($sql, GENERAL,'Could not delete topic');
|
||||
$sql = "DELETE FROM `".CATS_TABLE."` WHERE `c_id`='$cid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete category.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete category.');
|
||||
}
|
||||
}
|
||||
case 'forum':
|
||||
@@ -402,24 +402,24 @@ 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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forum information');
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forums information');
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$new_sort = $item['sort']-1;
|
||||
$fid1 = $item['f_id'];
|
||||
$sql2 = "UPDATE `".FORUMS_TABLE."` SET `sort`='$new_sort' WHERE `f_id`='$fid1'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update forum');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update forum');
|
||||
}
|
||||
$sql="DELETE FROM `".POSTS_TABLE."` WHERE `f_id`='$fid'";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not delete post.');
|
||||
DataBase::sql_query($sql, GENERAL,'Could not delete post.');
|
||||
$sql = "DELETE FROM `".TOPICS_TABLE."` WHERE `f_id`='$fid'";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not delete topic');
|
||||
DataBase::sql_query($sql, GENERAL,'Could not delete topic');
|
||||
$sql = "DELETE FROM `".FORUMS_TABLE."` WHERE `f_id`='$fid'";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not delete forum');
|
||||
DataBase::sql_query($sql, GENERAL,'Could not delete forum');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -439,11 +439,11 @@ 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 = DataBase::fetch(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'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update category');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update category');
|
||||
$msg='./../skins/'.$default_skin.'/blank.tpl';
|
||||
admin_message_forum($lng['cat_saved'],'admin_forums.php');
|
||||
}
|
||||
@@ -455,7 +455,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp = DataBase::fetch(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']=='')
|
||||
@@ -495,14 +495,14 @@ switch($_GET['mode'])
|
||||
$forum_desc = strip_tags($_POST['forum_desc']);
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forum information');
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forums information');
|
||||
$result = DataBase::fetch($query);
|
||||
$sort = $result['sort']+1;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ switch($_GET['mode'])
|
||||
`c_id`='$forum_cat',
|
||||
`sort`='$sort'
|
||||
WHERE `f_id`='$fid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update forum');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update forum');
|
||||
$msg='./../skins/'.$default_skin.'/blank.tpl';
|
||||
admin_message_forum($lng['forum_saved'],'admin_forums.php');
|
||||
}
|
||||
@@ -535,7 +535,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
else
|
||||
{
|
||||
$tmp = DataBase::fetch(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'];
|
||||
|
||||
@@ -41,7 +41,7 @@ function GenerateDefaultDisplay()
|
||||
Admin_Over::GenerateHeader();
|
||||
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.');
|
||||
$query = DataBase::sql_query($sql, GENERAL, 'Could not obtain groups information.');
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
@@ -69,9 +69,9 @@ switch($_GET['mode'])
|
||||
$gid = $_GET['id'];
|
||||
Secure::group_exists($gid);
|
||||
$sql = "DELETE FROM ".GROUPS_TABLE." WHERE `g_id`='$gid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete group.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete group.');
|
||||
$sql = "DELETE FROM ".USERS_GROUP_TABLE." WHERE `g_id`='$gid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could users in group.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could users in group.');
|
||||
GenerateDefaultDisplay();
|
||||
break;
|
||||
}
|
||||
@@ -88,15 +88,15 @@ switch($_GET['mode'])
|
||||
$group_desc = htmlspecialchars($_POST['group_desc']);
|
||||
$group_mod = User::UserIdByNick(htmlspecialchars($_POST['group_mod']));
|
||||
$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'));
|
||||
ORDER BY `sort` DESC LIMIT 1",GENERAL,'Could not obtain last category sort id'));
|
||||
$group_sort = $result['sort'];
|
||||
$group_sort = $group_sort+1;
|
||||
$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.'));
|
||||
`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;
|
||||
$sql = "INSERT INTO ".GROUPS_TABLE." VALUES ('$group_id', '$group_name', '$group_desc', '$group_mod', '$group_sort')";
|
||||
DataBase::sql_query($sql, 'GENERAL', 'Could not add group');
|
||||
DataBase::sql_query($sql, GENERAL, 'Could not add group');
|
||||
unset($group_name, $group_desc, $group_mod, $group_id);
|
||||
admin_message_forum($lng['group_saved'],'admin_groups.php');
|
||||
}
|
||||
@@ -148,7 +148,7 @@ switch($_GET['mode'])
|
||||
`desc` = '$group_desc',
|
||||
`m_id` = '$group_mod'
|
||||
WHERE `g_id` = '$group_id'";
|
||||
DataBase::sql_query($sql, 'GENERAL', 'Could not update group');
|
||||
DataBase::sql_query($sql, GENERAL, 'Could not update group');
|
||||
unset($group_name, $group_desc, $group_mod, $group_id);
|
||||
admin_message_forum($lng['group_saved'],'admin_groups.php');
|
||||
}
|
||||
@@ -161,7 +161,7 @@ switch($_GET['mode'])
|
||||
else
|
||||
{
|
||||
$sql = "SELECT * FROM `".GROUPS_TABLE."` WHERE `g_id`='$gid'";
|
||||
$g = DataBase::fetch(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,19 +188,19 @@ switch($_GET['mode'])
|
||||
{
|
||||
$i1 = intval($_GET['id']);
|
||||
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `g_id`='$i1'";
|
||||
$s1 = DataBase::fetch(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 = DataBase::fetch(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'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update group position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update group position');
|
||||
$sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s1' WHERE `g_id`='$i2'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update group position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update group position');
|
||||
}
|
||||
}
|
||||
GenerateDefaultDisplay();
|
||||
@@ -213,21 +213,21 @@ switch($_GET['mode'])
|
||||
$i1 = intval($_GET['id']);
|
||||
$i2 = $i1 +1;
|
||||
$sql = "SELECT `sort`, `g_id` FROM ".GROUPS_TABLE." WHERE `g_id`='$i1'";
|
||||
$s1 = DataBase::fetch(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 = DataBase::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 = DataBase::fetch(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'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update group position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update group position');
|
||||
$sql = "UPDATE ".GROUPS_TABLE." SET `sort`='$s1' WHERE `g_id`='$i2'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update group position');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update group position');
|
||||
}
|
||||
}
|
||||
GenerateDefaultDisplay();
|
||||
|
||||
@@ -33,7 +33,7 @@ function AddSkins()
|
||||
{
|
||||
global $forum_config;
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information');
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",GENERAL,'Could not obtain skins information');
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
@@ -294,7 +294,7 @@ if (isset($_POST['forum_path']))
|
||||
for($i=0;$i<$count_o;$i++)
|
||||
{
|
||||
$sql = "UPDATE `".CONFIG_TABLE."` SET `value`='".$value[$i]."' WHERE `name`='".$name[$i]."'";
|
||||
DataBase::sql_query($sql, 'GENERAL', 'Could not update script config');
|
||||
DataBase::sql_query($sql, GENERAL, 'Could not update script config');
|
||||
}
|
||||
//end...
|
||||
unset($name, $value, $count_o, $sql);
|
||||
|
||||
@@ -44,27 +44,27 @@ switch($_GET['mode'])
|
||||
|
||||
//delete from users table
|
||||
$sql = "DELETE FROM ".USERS_TABLE." WHERE `u_id`='$uid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete user.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete user.');
|
||||
|
||||
//delete from PM SentBox table
|
||||
$sql = "DELETE FROM ".PM_SENTBOX_TABLE." WHERE `u_n_id`='$uid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete user sentbox messages.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete user sentbox messages.');
|
||||
|
||||
//update PM InBox table -> change u_n_id to Anonymous
|
||||
$sql = "UPDATE ".PM_INBOX_TABLE." SET `u_n_id`='-1' WHERE `u_n_id`='$uid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update user inbox messages.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update user inbox messages.');
|
||||
|
||||
//update user posts -> change u_id to Anonymous
|
||||
$sql = "UPDATE ".POSTS_TABLE." SET `u_id`='-1' WHERE `u_id`='$uid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could edit post.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could edit post.');
|
||||
|
||||
//update shoutbox messages -> change u_id to Anonymous
|
||||
$sql = "UPDATE ".SHOUTBOX_TABLE." SET `u_id`='-1' WHERE `u_id`='$uid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could edit shoutbox messages.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could edit shoutbox messages.');
|
||||
|
||||
//update user topics -> change u_id to Anonymous
|
||||
$sql = "UPDATE ".TOPICS_TABLE." SET `author`='-1' WHERE `author`='$uid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could edit post.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could edit post.');
|
||||
|
||||
//back to admin users
|
||||
admin_message_forum($lng['user_deleted'],'admin_users.php');
|
||||
@@ -196,7 +196,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
}
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='$uid'";
|
||||
$userinfo = DataBase::fetch(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');
|
||||
@@ -297,7 +297,7 @@ switch($_GET['mode'])
|
||||
$page=1;
|
||||
}
|
||||
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id`
|
||||
FROM ".USERS_TABLE,'GENERAL','Could not obtain count amout of users'));
|
||||
FROM ".USERS_TABLE,GENERAL,'Could not obtain count amout of users'));
|
||||
$count = $count['u_id'];
|
||||
$count = ceil($count /30);
|
||||
if(isset($_GET['page']) && ($_GET['page']>$count))
|
||||
@@ -428,7 +428,7 @@ switch($_GET['mode'])
|
||||
break;
|
||||
}
|
||||
}
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain user information.');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain user information.');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
|
||||
@@ -67,7 +67,7 @@ switch($_GET['mode'])
|
||||
}
|
||||
$ban_motive = strip_tags($_POST['motive']);
|
||||
$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.');
|
||||
admin_message_forum($lng['ban_added'],'banlist.php?mode=view');
|
||||
}
|
||||
else
|
||||
@@ -114,12 +114,12 @@ switch($_GET['mode'])
|
||||
message_forum($lng['no_ban_me'],'banlist.php?mode=view');
|
||||
}
|
||||
$bid =$bid = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL',
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",GENERAL,
|
||||
'Could not obtain last ban id'));
|
||||
$bid = $bid['b_id'];
|
||||
$bid = $bid +1;
|
||||
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$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.');
|
||||
admin_message_forum($lng['ban_added'],'banlist.php?mode=view');
|
||||
}
|
||||
else
|
||||
@@ -168,12 +168,12 @@ switch($_GET['mode'])
|
||||
message_forum($lng['no_ban_me'],'banlist.php?mode=view');
|
||||
}
|
||||
$bid =$bid = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL',
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",GENERAL,
|
||||
'Could not obtain last ban id'));
|
||||
$bid = $bid['b_id'];
|
||||
$bid = $bid +1;
|
||||
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$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.');
|
||||
admin_message_forum($lng['ban_added'],'banlist.php?mode=view');
|
||||
}
|
||||
else
|
||||
@@ -209,13 +209,13 @@ switch($_GET['mode'])
|
||||
$catalog = '../tmp/';
|
||||
if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name']))
|
||||
{
|
||||
message_die('GENERAL','Could not upload file.','');
|
||||
message_die(GENERAL,'Could not upload file.','');
|
||||
}
|
||||
$open = fopen($catalog.$_FILES['file']['name'],'r');
|
||||
$file = fread($open, filesize($catalog.$_FILES['file']['name']));
|
||||
$item = @explode("\n",$file);
|
||||
$bid = $bid = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",'GENERAL',
|
||||
`b_id` FROM ".BANLIST_TABLE." ORDER BY `b_id` DESC",GENERAL,
|
||||
'Could not obtain last ban id'));
|
||||
$bid = $bid['b_id'];
|
||||
$bid = $bid +1;
|
||||
@@ -223,7 +223,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
$ban_ip = $item[$i];
|
||||
$sql = "INSERT INTO ".BANLIST_TABLE." VALUES ('$bid', '$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.');
|
||||
$bid = $bid +1;
|
||||
}
|
||||
admin_message_forum($lng['ban_added'],'banlist.php?mode=view');
|
||||
@@ -255,7 +255,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
$bid = $_GET['id'];
|
||||
$sql = "DELETE FROM ".BANLIST_TABLE." WHERE `b_id`='$bid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete banlist item.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete banlist item.');
|
||||
admin_message_forum($lng['ban_deleted'],'banlist.php?mode=view');
|
||||
break;
|
||||
}
|
||||
@@ -288,14 +288,14 @@ switch($_GET['mode'])
|
||||
`u_id`='$ban_uid',
|
||||
`motive`='$ban_motive'
|
||||
WHERE `b_id`='$bid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update ban.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update ban.');
|
||||
admin_message_forum($lng['ban_edited'],'banlist.php?mode=view');
|
||||
}
|
||||
else
|
||||
{
|
||||
$bid = $_GET['id'];
|
||||
$sql = "SELECT * FROM ".BANLIST_TABLE." WHERE `b_id`='$bid'";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain banlist item information');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain banlist item information');
|
||||
$result = DataBase::fetch($query);
|
||||
$_POST['ip']=$result['IP'];
|
||||
$_POST['motive'] = $result['motive'];
|
||||
@@ -321,18 +321,18 @@ switch($_GET['mode'])
|
||||
case 'clear':
|
||||
{
|
||||
$sql = "TRUNCATE `".BANLIST_TABLE."`";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not empty banlist');
|
||||
DataBase::sql_query($sql, GENERAL,'Could not empty banlist');
|
||||
admin_message_forum($lng['banlist_cleanout'],'banlist.php?mode=view');
|
||||
}
|
||||
case 'view':
|
||||
{
|
||||
$query = DataBase::sql_query("SELECT `u_id`, `nick` FROM ".USERS_TABLE,'GENERAL','Could not obtain user information');
|
||||
$query = DataBase::sql_query("SELECT `u_id`, `nick` FROM ".USERS_TABLE,GENERAL,'Could not obtain user information');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$user[$result['u_id']]['nick'] = $result['nick'];
|
||||
}
|
||||
$sql = "SELECT * FROM ".BANLIST_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain banlist items');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain banlist items');
|
||||
$skin=array(
|
||||
'L.banlist'=>$lng['admin_banlist'],
|
||||
'L.select_mode'=>$lng['what_do_you_want'],
|
||||
|
||||
@@ -45,19 +45,19 @@ switch($_GET['mode'])
|
||||
$catalog = '../tmp/';
|
||||
if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name']))
|
||||
{
|
||||
message_die('GENERAL','Could not upload file.','');
|
||||
message_die(GENERAL,'Could not upload file.','');
|
||||
}
|
||||
$open = fopen($catalog.$_FILES['file']['name'],'r');
|
||||
$file = fread($open, filesize($catalog.$_FILES['file']['name']));
|
||||
$item = @explode(',',$file);
|
||||
$sql = "SELECT `w_id` FROM ".CENSORLIST_TABLE." ORDER BY `w_id` DESC";
|
||||
$last = DataBase::fetch(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++)
|
||||
{
|
||||
$word = $item[$i];
|
||||
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",'GENERAL','Could not add censored word.');
|
||||
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",GENERAL,'Could not add censored word.');
|
||||
$last = $last +1;
|
||||
}
|
||||
admin_message_forum($lng['words_added'],'censorlist.php');
|
||||
@@ -81,7 +81,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
$wid = intval($_GET['w']);
|
||||
$sql = "DELETE FROM ".CENSORLIST_TABLE." WHERE `w_id`='$wid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete word.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete word.');
|
||||
admin_message_forum($lng['word_deleted'],'censorlist.php?mode=view');
|
||||
break;
|
||||
}
|
||||
@@ -91,10 +91,10 @@ switch($_GET['mode'])
|
||||
{
|
||||
$word = strip_tags($_POST['word']);
|
||||
$sql = "SELECT `w_id` FROM ".CENSORLIST_TABLE." ORDER BY `w_id` DESC";
|
||||
$last = DataBase::fetch(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.');
|
||||
DataBase::sql_query("INSERT INTO ".CENSORLIST_TABLE." VALUES ('$last','$word')",GENERAL,'Could not add censored word.');
|
||||
admin_message_forum($lng['word_added'],'censorlist.php');
|
||||
}
|
||||
else
|
||||
@@ -120,14 +120,14 @@ switch($_GET['mode'])
|
||||
{
|
||||
$word = strip_tags(trim($_POST['word']));
|
||||
$wid = intval($_GET['w']);
|
||||
DataBase::sql_query("UPDATE ".CENSORLIST_TABLE." SET `word`='$word' WHERE `w_id`='$wid'",'GENERAL','Could not update censored word.');
|
||||
DataBase::sql_query("UPDATE ".CENSORLIST_TABLE." SET `word`='$word' WHERE `w_id`='$wid'",GENERAL,'Could not update censored word.');
|
||||
admin_message_forum($lng['word_edited'],'censorlist.php?mode=view');
|
||||
}
|
||||
else
|
||||
{
|
||||
$wid = intval($_GET['w']);
|
||||
$sql = "SELECT * FROM ".CENSORLIST_TABLE." WHERE `w_id`='$wid'";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain censorlist words');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain censorlist words');
|
||||
$result = DataBase::fetch($query);
|
||||
$_POST['word']=$result['word'];
|
||||
$skin = array(
|
||||
@@ -146,14 +146,14 @@ switch($_GET['mode'])
|
||||
}
|
||||
case 'deleteall':
|
||||
{
|
||||
DataBase::sql_query("TRUNCATE TABLE ".CENSORLIST_TABLE,'GENERAL','Could not empty censorlist table.');
|
||||
DataBase::sql_query("TRUNCATE TABLE ".CENSORLIST_TABLE,GENERAL,'Could not empty censorlist table.');
|
||||
admin_message_forum($lng['table_cleanout'],'censorlist.php');
|
||||
break;
|
||||
}
|
||||
case 'view':
|
||||
{
|
||||
$sql = "SELECT * FROM ".CENSORLIST_TABLE." ORDER BY `word`";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain censorlist words');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain censorlist words');
|
||||
$skin = array(
|
||||
'L.censorlist'=>$lng['admin_censorlist'],
|
||||
'L.view_all_words'=>$lng['view_all_words']
|
||||
|
||||
@@ -47,7 +47,7 @@ function check_size_md5($file)
|
||||
function mysqlversion()
|
||||
{
|
||||
$temp = '';
|
||||
$result = DataBase::fetch(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++)
|
||||
{
|
||||
@@ -62,7 +62,7 @@ function db_size()
|
||||
{
|
||||
$sql = "SHOW TABLE STATUS";
|
||||
$db_size = 0;
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain database size');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain database size');
|
||||
while ($result = DataBase::fetch($query))
|
||||
{
|
||||
$db_size += $result['Index_length'];
|
||||
|
||||
@@ -48,14 +48,14 @@ switch($_GET['mode'])
|
||||
if (isset($_POST['word'],$_POST['url']))
|
||||
{
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE." ORDER BY `s_id` DESC LIMIT 1";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain smilelist item information');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain smilelist item information');
|
||||
$result = DataBase::fetch($query);
|
||||
$smile_id = $result['s_id'];
|
||||
$smile_id = $smile_id +1;
|
||||
$smile_word = strip_tags($_POST['word']);
|
||||
$smile_url = strip_tags($_POST['url']);
|
||||
$sql = "INSERT INTO ".SMILES_TABLE." VALUES('$smile_id','$smile_word','$smile_url')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add smile.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add smile.');
|
||||
admin_message_forum($lng['smile_added'],'smilelist.php?mode=view');
|
||||
}
|
||||
else
|
||||
@@ -87,13 +87,13 @@ switch($_GET['mode'])
|
||||
$catalog = '../tmp/';
|
||||
if(!move_uploaded_file($_FILES['file']['tmp_name'], $catalog.$_FILES['file']['name']))
|
||||
{
|
||||
message_die('GENERAL','Could not upload file.','');
|
||||
message_die(GENERAL,'Could not upload file.','');
|
||||
}
|
||||
$open = @fopen($catalog.$_FILES['file']['name'],'r');
|
||||
$file = @fread($open, filesize($catalog.$_FILES['file']['name']));
|
||||
$item = @explode("\n",$file);
|
||||
$bid = $bid = DataBase::fetch(DataBase::sql_query("SELECT
|
||||
`s_id` FROM ".SMILES_TABLE." ORDER BY `s_id` DESC",'GENERAL',
|
||||
`s_id` FROM ".SMILES_TABLE." ORDER BY `s_id` DESC",GENERAL,
|
||||
'Could not obtain last smile id'));
|
||||
$sid = $sid['s_id'];
|
||||
$sid = $sid +1;
|
||||
@@ -103,7 +103,7 @@ switch($_GET['mode'])
|
||||
$smile_word = $subitem[0];
|
||||
$smile_url = $subitem[1];
|
||||
$sql = "INSERT INTO ".SMILES_TABLE." VALUES ('$sid', '$smile_word', '$smile_url')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add smile.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add smile.');
|
||||
$sid = $bid +1;
|
||||
}
|
||||
admin_message_forum($lng['smiles_added'],'smilelist.php?mode=view');
|
||||
@@ -133,7 +133,7 @@ switch($_GET['mode'])
|
||||
{
|
||||
$sid = $_GET['id'];
|
||||
$sql = "DELETE FROM ".SMILES_TABLE." WHERE `s_id`='$sid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete smilelist item.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete smilelist item.');
|
||||
admin_message_forum($lng['smile_deleted'],'smilelist.php?mode=view');
|
||||
break;
|
||||
}
|
||||
@@ -149,14 +149,14 @@ switch($_GET['mode'])
|
||||
`smile`='$smile_word',
|
||||
`url`='$smile_url'
|
||||
WHERE `s_id`='$smile_id'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update smile.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update smile.');
|
||||
admin_message_forum($lng['smile_edited'],'smilelist.php?mode=view');
|
||||
}
|
||||
else
|
||||
{
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain smilelist item information');
|
||||
$result = DataBase::fetch($query);
|
||||
if ($result['s_id']=='')
|
||||
{
|
||||
@@ -182,13 +182,13 @@ switch($_GET['mode'])
|
||||
case 'clear':
|
||||
{
|
||||
$sql = "TRUNCATE `".SMILES_TABLE."`";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not empty smilelist');
|
||||
DataBase::sql_query($sql, GENERAL,'Could not empty smilelist');
|
||||
admin_message_forum($lng['smilelist_cleanout'],'smilelist.php?mode=view');
|
||||
}
|
||||
case 'view':
|
||||
{
|
||||
$sql = "SELECT * FROM ".SMILES_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain smilelist items');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain smilelist items');
|
||||
$skin=array(
|
||||
'L.smilelist'=>$lng['admin_smilelist'],
|
||||
'L.select_mode'=>$lng['what_do_you_want'],
|
||||
|
||||
@@ -44,9 +44,9 @@ switch($_GET['mode'])
|
||||
if ($sid!=$forum_config['defaultskin'])
|
||||
{
|
||||
$sql = "DELETE FROM ".SKINS_TABLE." WHERE `s_id`='$sid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete skin');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete skin');
|
||||
$sql = "UPDATE ".USERS_TABLE." SET `skin`='".$forum_config['defaultskin']."' WHERE `skin`='$sid'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update user');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update user');
|
||||
admin_message_forum($lng['skins_deleted'],'styles.php?mode=view');
|
||||
}
|
||||
else
|
||||
@@ -64,7 +64,7 @@ switch($_GET['mode'])
|
||||
if (is_dir('./../skins/'.$_POST['skin']))
|
||||
{
|
||||
$last = DataBase::new_id(SKINS_TABLE);
|
||||
DataBase::sql_query("INSERT INTO ".SKINS_TABLE." VALUES ('$last','".strip_tags($_POST['skin'])."')",'GENERAL','Could not add skin');
|
||||
DataBase::sql_query("INSERT INTO ".SKINS_TABLE." VALUES ('$last','".strip_tags($_POST['skin'])."')",GENERAL,'Could not add skin');
|
||||
$_POST['skin']='';
|
||||
admin_message_forum($lng['skins_added'],'styles.php?mode=view');
|
||||
}
|
||||
@@ -89,7 +89,7 @@ switch($_GET['mode'])
|
||||
Admin_Over::GenerateHeader();
|
||||
include('./template/skins_beam_body.tpl');
|
||||
$sql = "SELECT * FROM ".SKINS_TABLE;
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain skins information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain skins information');
|
||||
while ($item = DataBase::fetch($query))
|
||||
{
|
||||
$skin=array(
|
||||
|
||||
@@ -19,7 +19,7 @@ if (phpversion()<'5.0.7')
|
||||
}
|
||||
//set global preferences from DataBase
|
||||
$sql="SELECT * FROM ".CONFIG_TABLE."";
|
||||
$query=DataBase::sql_query($sql,'CRITICAL','Could not obtain config information');
|
||||
$query=DataBase::sql_query($sql,CRITICAL,'Could not obtain config information');
|
||||
while($result=DataBase::fetch($query))
|
||||
{
|
||||
if (($result['name']=='') or ($result['name']=='0'))
|
||||
@@ -53,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 = DataBase::fetch(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'];
|
||||
@@ -76,7 +76,7 @@ else
|
||||
{
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='-1'";
|
||||
}
|
||||
$query = DataBase::sql_query($sql, 'GENERAL','Could not obtain loged user information');
|
||||
$query = DataBase::sql_query($sql, GENERAL,'Could not obtain loged user information');
|
||||
$userdata = DataBase::fetch($query);
|
||||
define('RANK', $userdata['rank']);
|
||||
|
||||
|
||||
@@ -7,12 +7,12 @@ if ( !defined('IN_uF') )
|
||||
{
|
||||
die('Hacking attempt');
|
||||
}
|
||||
@ini_set('display_errors', '1');
|
||||
ini_set('display_errors', '1');
|
||||
define('DB_HOST','localhost');
|
||||
define('DB_USER','root');
|
||||
define('DB_PASS','');
|
||||
define('DB_NAME','uf');
|
||||
define('DB_PREFIX','uf_');
|
||||
define('VERSION','9.5.1');
|
||||
define('VERSION','9.5.3');
|
||||
define('UF_INSTALLED',true);
|
||||
?>
|
||||
|
||||
@@ -52,18 +52,19 @@ $skin = array_push_associative($skin,GenerateHeader($lng['showforum'].': '.$foru
|
||||
//do it!
|
||||
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');
|
||||
$sql = "SELECT ".TOPICS_TABLE.".*, ".USERS_TABLE.".*, ".TOPICS_TABLE.".posts AS `postcount`, ".TOPICS_TABLE.".lastpost AS `topic_lastpost` 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 = DataBase::num_rows($query);
|
||||
if ($value>0)
|
||||
{
|
||||
while($record = DataBase::fetch($query))
|
||||
{
|
||||
$last_post = explode(':', $record['topic_lastpost']);
|
||||
$skin = array(
|
||||
't_id'=>$record['t_id'],
|
||||
'fname'=>($record['sticky']=='1') ? '<b>'.$lng['sticky'].'</b>'.$record['name'] : $record['name'],
|
||||
'author'=>Topic::TopicAuthor($record['author']),
|
||||
'tposts'=>$count_topic[$record['t_id']],
|
||||
'tposts'=>$record['postcount'],
|
||||
'new_post'=>Topic::LastPostImg(),
|
||||
'lastpost'=>Topic::LastPostInTopic($record['t_id'])
|
||||
);
|
||||
|
||||
@@ -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 = DataBase::fetch(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');
|
||||
@@ -89,7 +89,7 @@ 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.');
|
||||
$query = DataBase::sql_query($sql, GENERAL, 'Could not obtain users in groups information.');
|
||||
$amout = DataBase::num_rows($query);
|
||||
if ($amout>0)
|
||||
{
|
||||
@@ -142,7 +142,7 @@ else
|
||||
$skin = GenerateHeader($lng['lgroups'], '</a>> <a href="groups.php" class="navigator">'.$lng['lgroups']);
|
||||
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.');
|
||||
$query = DataBase::sql_query($sql, GENERAL, 'Could not obtain groups information.');
|
||||
if (DataBase::num_rows($query)>0)
|
||||
{
|
||||
while($item = DataBase::fetch($query))
|
||||
|
||||
@@ -18,7 +18,7 @@ class Admin_Forum
|
||||
global $forum_config;
|
||||
$cat = Forum::ForumInformation($fid,'c_id');
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `c_id` FROM `".CATS_TABLE."`",'GENERAL','Could not obtain category information');
|
||||
$query = DataBase::sql_query("SELECT `name`, `c_id` FROM `".CATS_TABLE."`",GENERAL,'Could not obtain category information');
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ class Admin_Over
|
||||
global $forum_config;
|
||||
global $default_skin;
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information');
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",GENERAL,'Could not obtain skins information');
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
@@ -104,14 +104,14 @@ class Admin_Over
|
||||
{
|
||||
$result = User::UserInformation($_SESSION['uid'],'skin');
|
||||
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
|
||||
$result = DataBase::fetch(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 = DataBase::fetch(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'];
|
||||
}
|
||||
}
|
||||
@@ -130,14 +130,14 @@ class Admin_Over
|
||||
function TotalTopics()
|
||||
{
|
||||
$sql = "SELECT `t_id` FROM ".TOPICS_TABLE.";";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information');
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information');
|
||||
$result = DataBase::num_rows($query);
|
||||
return($result);
|
||||
}
|
||||
|
||||
12
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 = 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['name']=='')
|
||||
{
|
||||
message_forum($lng['no_forum'],'index.php');
|
||||
@@ -23,14 +23,14 @@ $forum = array(
|
||||
'name'=>$result['name'],
|
||||
'lock'=>$result['lock']
|
||||
);
|
||||
$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`";
|
||||
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum');
|
||||
/*$sql = "SELECT COUNT(*) as `p_id`, `t_id` FROM ".POSTS_TABLE." GROUP BY `t_id`";
|
||||
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$count_topic[$result['t_id']]=$result['p_id'];
|
||||
}
|
||||
}*/
|
||||
/*$sql = "SELECT ".POSTS_TABLE.".*, ".USERS_TABLE.".* FROM ".POSTS_TABLE." LEFT JOIN ".USERS_TABLE." ON ".USERS_TABLE.".u_id = ".POSTS_TABLE.".u_id WHERE `f_id`='$fid' ORDER BY `ptime`";
|
||||
$query = DataBase::sql_query($sql,'GENERAL', 'Could not obtain amout of posts in forum');
|
||||
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
|
||||
@@ -66,7 +66,7 @@ else
|
||||
$page=1;
|
||||
}
|
||||
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`t_id`) as `t_id`
|
||||
FROM ".TOPICS_TABLE." WHERE `f_id`='$fid'",'GENERAL','Could not obtain count amout of topics'));
|
||||
FROM ".TOPICS_TABLE." WHERE `f_id`='$fid'",GENERAL,'Could not obtain count amout of topics'));
|
||||
$count = $count['t_id'];
|
||||
$count = ceil($count / $limiter);
|
||||
if ($count==0)
|
||||
|
||||
4
includes/cache/cache_index.php
vendored
@@ -18,7 +18,7 @@ if(!defined('IN_uF'))
|
||||
//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.');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain forum information.');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$forum[$cache_id]['f_id'] = $result['f_id'];
|
||||
@@ -31,7 +31,7 @@ while($result = DataBase::fetch($query))
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain amout of count users information');
|
||||
$lastuser = DataBase::fetch($query);
|
||||
$count_users = DataBase::num_rows($query) -1;
|
||||
?>
|
||||
|
||||
8
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 = 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['t_id']=='')
|
||||
{
|
||||
message_forum($lng['no_topic'], 'index.php');
|
||||
@@ -29,7 +29,7 @@ $forum['moderate']=$result['moderate'];
|
||||
|
||||
|
||||
$sql = "SELECT `u_id`,`value` FROM `".WARNINGS_TABLE."`";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user warns information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information');
|
||||
$result = DataBase::num_rows($query);
|
||||
while ($result = DataBase::fetch($query))
|
||||
{
|
||||
@@ -49,7 +49,7 @@ while ($result = DataBase::fetch($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.');
|
||||
$query = DataBase::sql_query($sql, GENERAL, 'Could not read user active.');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$user[$result['u_id']]['online']='1';
|
||||
@@ -82,7 +82,7 @@ else
|
||||
$page=1;
|
||||
}
|
||||
$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'));
|
||||
FROM ".POSTS_TABLE." WHERE `t_id`='$tid'",GENERAL,'Could not obtain count amout of posts'));
|
||||
$count = $count['p_id'];
|
||||
$count = ceil($count / $limiter);
|
||||
if(isset($_GET['page']) && ($_GET['page']>$count))
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -44,25 +44,6 @@ define('FOOTER_TEXT','<span class="copyright" >Powered by <b>µForum</b></s
|
||||
//hash for password
|
||||
define('PASSWD_HASH','bJVhVFCthvhVhKBU6GUbhUBU6VI7BiU6fV7G76Kbug6FU67VsaVYat5FJUHssaYVY5fV5GUHI76uKYTjYKKTatastYKYTYKg6ds7IRdsagI565JTrJ4NFGagGKLULygaTJHgfYDRZagGHJ65KL7iryikuuyriMYIYYUyugFTDeRnLKJNuyTDTRsERy78IJOhHCTDYjomLKBJDF5THNNBjyFCDYekjnKBUYgIHnUIbyuG6UyHNKJjnKHVut6FBYlH987g6GIUBbg76V5NNLUBH76BKLBi76FVtjN76Gi77ggYVCx3 R4SGhfGLHIH64XFGBUNLJOgfvc4Y3ScvmljmOBVc4klJKNIuBGVY6 MbvhGCRGgJLjKFHrYYJnKJGFHTfJJjnLK');
|
||||
|
||||
function array_push_associative(&$arr)
|
||||
{
|
||||
$ret = '';
|
||||
$args = func_get_args();
|
||||
foreach ($args as $arg)
|
||||
{
|
||||
if (is_array($arg))
|
||||
{
|
||||
foreach ($arg as $key => $value)
|
||||
{
|
||||
$arr[$key] = $value;
|
||||
$ret++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$arr[$arg] = "";
|
||||
}
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
define('CRITICAL', 'Critical Error');
|
||||
define('GENERAL', 'General Error');
|
||||
?>
|
||||
|
||||
@@ -23,16 +23,16 @@ class DataBase
|
||||
$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);
|
||||
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);
|
||||
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);
|
||||
message_die(CRITICAL,' Could not select database.', $db->error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,12 +59,20 @@ class DataBase
|
||||
|
||||
function fetch($query)
|
||||
{
|
||||
return $query->fetch_array();
|
||||
return $query->fetch_assoc();
|
||||
}
|
||||
|
||||
function num_rows($query)
|
||||
{
|
||||
return $query->num_rows;
|
||||
// return $query->num_rows;
|
||||
if ($query===true || $query===false)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
return mysqli_num_rows($query);
|
||||
}
|
||||
}
|
||||
|
||||
function new_id($table)
|
||||
@@ -91,7 +99,7 @@ class DataBase
|
||||
case WARNINGS_TABLE: { $id = 'w_id'; break; }
|
||||
}
|
||||
$sql = "SELECT `$id` FROM $table ORDER BY `$id` DESC LIMIT 1";
|
||||
$return_id = DataBase::fetch(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;
|
||||
|
||||
@@ -38,7 +38,7 @@ function SendEmail($email, $title, $content)
|
||||
#send email - do it!
|
||||
if ( !mail($email, $title, $email_content, $email_headers ))
|
||||
{
|
||||
message_die('GENERAL','Could not send email from: '.$email.'. sorry :(','');
|
||||
message_die(GENERAL,'Could not send email from: '.$email.'. sorry :(','');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,7 +78,7 @@ function SendForgotPassEmail($newpass)
|
||||
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');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not read users table');
|
||||
while($item = DataBase::fetch($query))
|
||||
{
|
||||
SendEmail($item['email'], $title, $content);
|
||||
|
||||
@@ -19,8 +19,8 @@ function message_die($type, $msm, $sql)
|
||||
<table align="left" border="1" style="border-collapse: collapse; border-color: grey" width="500">
|
||||
<tr>
|
||||
<td bgcolor="" align="left">
|
||||
<font face="Verdana" style="font-size: 18pt; font-weight: bold" color="red">DSF v'.VERSION.' - ';
|
||||
$msg .= ($type='CRITICAL') ? 'CRITICAL ERROR' : 'GENERAL ERROR' ;
|
||||
<font face="Verdana" style="font-size: 18pt; font-weight: bold" color="red">µForum v'.VERSION.' - ';
|
||||
$msg .= $type;
|
||||
$msg .= '</font>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -19,7 +19,7 @@ function SetCounter()
|
||||
{
|
||||
setcookie('forum_visited','1');
|
||||
$visit_count = $forum_config['forum_counter'] +1;
|
||||
DataBase::sql_query("UPDATE `".CONFIG_TABLE."` SET `value`='$visit_count' WHERE `name`='forum_counter'",'GENERAL','Could not update forum counter');
|
||||
DataBase::sql_query("UPDATE `".CONFIG_TABLE."` SET `value`='$visit_count' WHERE `name`='forum_counter'",GENERAL,'Could not update forum counter');
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -201,7 +201,7 @@ function AddSkins()
|
||||
global $forum_config;
|
||||
global $default_skin;
|
||||
$all='';
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",'GENERAL','Could not obtain skins information');
|
||||
$query = DataBase::sql_query("SELECT `name`, `s_id` FROM `".SKINS_TABLE."`",GENERAL,'Could not obtain skins information');
|
||||
while($t = DataBase::fetch($query))
|
||||
{
|
||||
|
||||
@@ -277,7 +277,7 @@ function IfModGroup($guid)
|
||||
function TotalPosts()
|
||||
{
|
||||
$sql = "SELECT count(*) as `p_id` FROM ".POSTS_TABLE."";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain total posts information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain total posts information');
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['p_id'];
|
||||
|
||||
@@ -338,13 +338,15 @@ function ViewSkinName()
|
||||
$result = $forum_config['defaultskin'];
|
||||
}
|
||||
$sql = "SELECT * FROM `".SKINS_TABLE."` WHERE `s_id`='$result'";
|
||||
$result = DataBase::fetch(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
|
||||
@@ -352,8 +354,8 @@ function GenerateLastPost($id, $type)
|
||||
*/
|
||||
case 1: //for forum
|
||||
{
|
||||
$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);
|
||||
$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` DESC LIMIT 1";
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain last post in forum', true);
|
||||
$post_count = DataBase::num_rows($query);
|
||||
$result = DataBase::fetch($query);
|
||||
|
||||
@@ -372,7 +374,7 @@ function GenerateLastPost($id, $type)
|
||||
$sql = "UPDATE ".FORUMS_TABLE." SET
|
||||
`lastpost`='$last_post'
|
||||
WHERE `f_id`='$id'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update lastpost in forum');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update lastpost in forum');
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -381,8 +383,8 @@ function GenerateLastPost($id, $type)
|
||||
*/
|
||||
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');
|
||||
$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` DESC 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'];
|
||||
@@ -396,9 +398,10 @@ function GenerateLastPost($id, $type)
|
||||
$last_post .= $result['nick'];
|
||||
|
||||
$sql = "UPDATE ".TOPICS_TABLE." SET
|
||||
`lastpost_time`='".$result['ptime']."',
|
||||
`lastpost`='$last_post'
|
||||
WHERE `t_id`='$id'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update lastpost in topic');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update lastpost in topic');
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -410,46 +413,78 @@ function GeneratePosts($id, $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);
|
||||
$sql = "SELECT COUNT(p_id) AS cnt, `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'];
|
||||
$posts = $result['cnt'];
|
||||
|
||||
$sql = "UPDATE ".FORUMS_TABLE." SET
|
||||
`posts`='$last_post'
|
||||
`posts`='$posts'
|
||||
WHERE `f_id`='$id'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update lastpost in forum');
|
||||
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');
|
||||
$sql = "SELECT COUNT(p_id) AS cnt, t_id FROM ".POSTS_TABLE." WHERE `t_id`='$id'";
|
||||
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain posts count in topic');
|
||||
$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'];
|
||||
$posts = $result['cnt'];
|
||||
|
||||
$sql = "UPDATE ".TOPICS_TABLE." SET
|
||||
`lastpost`='$last_post'
|
||||
`posts`='$posts'
|
||||
WHERE `t_id`='$id'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update lastpost in topic');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update post count in topic');
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function UpdateConfigPosts()
|
||||
{
|
||||
$sql = "SELECT count(`p_id`) AS `count` FROM ".POSTS_TABLE;
|
||||
$query = DataBase::sql_query($sql, GENERAL, 'Could not obtain posts count.');
|
||||
$result = DataBase::fetch($query);
|
||||
$cnt = $result['count'];
|
||||
|
||||
unset ($sql, $query, $result);
|
||||
|
||||
$sql = "UPDATE ".CONFIG_TABLE." SET
|
||||
`value`='$cnt'
|
||||
WHERE `name`='posts'";
|
||||
DataBase::sql_query($sql, GENERAL, 'Could not update posts count in config table');
|
||||
}
|
||||
function TriggerStats($id, $type)
|
||||
{
|
||||
GeneratePosts($id, $type);
|
||||
GenerateLastPost($id, $type);
|
||||
UpdateConfigPosts();
|
||||
}
|
||||
|
||||
function array_push_associative(&$arr)
|
||||
{
|
||||
$ret = '';
|
||||
$args = func_get_args();
|
||||
foreach ($args as $arg)
|
||||
{
|
||||
if (is_array($arg))
|
||||
{
|
||||
foreach ($arg as $key => $value)
|
||||
{
|
||||
$arr[$key] = $value;
|
||||
$ret++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$arr[$arg] = "";
|
||||
}
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
//private messsages cache - v1.0 Alpha 2
|
||||
//
|
||||
$sql = "SELECT `u_id`,`nick`,`rank` FROM `".USERS_TABLE."`";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain forums information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain forums information');
|
||||
$user['count']= DataBase::num_rows($query);
|
||||
|
||||
while($result = DataBase::fetch($query))
|
||||
@@ -52,7 +52,7 @@ switch($_GET['submode'])
|
||||
}
|
||||
}
|
||||
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain messages information');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain messages information');
|
||||
$count = DataBase::num_rows($query);
|
||||
|
||||
if ($count==0)
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
//smiles cache
|
||||
$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))
|
||||
{
|
||||
@@ -33,7 +33,7 @@ switch($_GET['submode'])
|
||||
break;
|
||||
}
|
||||
}
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain messages information');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain messages information');
|
||||
$result = DataBase::fetch($query);
|
||||
//if message exist....
|
||||
if ($result['m_id']=='')
|
||||
@@ -63,12 +63,12 @@ switch($_GET['submode'])
|
||||
}
|
||||
if ($_GET['submode']=='user')
|
||||
{
|
||||
DataBase::sql_query("UPDATE ".PM_INBOX_TABLE." SET `read`='1' WHERE `m_id`='$mid'", 'GENERAL', 'Could not update message.');
|
||||
DataBase::sql_query("UPDATE ".PM_INBOX_TABLE." SET `read`='1' WHERE `m_id`='$mid'", GENERAL, 'Could not update message.');
|
||||
}
|
||||
|
||||
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `u_id`='".$result['u_n_id']."'";
|
||||
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not obtain user information');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information');
|
||||
$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 = DataBase::fetch(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,7 +58,7 @@ function SessRegister()
|
||||
SessDelete($uid);
|
||||
$time = time();
|
||||
$sql = "INSERT INTO ".SESSIONS_TABLE." VALUES ('', '".$_COOKIE[SESS_NAME]."','$uid','$time')";
|
||||
$query = DataBase::sql_query($sql,'GENERAL','Could not add new session.',true);
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not add new session.',true);
|
||||
if (DataBase::num_rows($query)>0)
|
||||
{
|
||||
$result = DataBase::fetch();
|
||||
@@ -75,7 +75,7 @@ function SessDeleteOld()
|
||||
{
|
||||
$time = time();
|
||||
$sql = "DELETE FROM ".SESSIONS_TABLE." WHERE time+129600<$time;";
|
||||
DataBase::sql_query($sql, 'GENERAL','Could not delete session',true);
|
||||
DataBase::sql_query($sql, GENERAL,'Could not delete session',true);
|
||||
}
|
||||
|
||||
function SessDelInvalid()
|
||||
@@ -83,7 +83,7 @@ function SessDelInvalid()
|
||||
if ($_SESSION['uid']>0)
|
||||
{
|
||||
$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);
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain session information',true);
|
||||
$result = DataBase::fetch($query);
|
||||
$result = $result['session_id'];
|
||||
if ($_COOKIE[SESS_NAME]!=$result)
|
||||
@@ -98,7 +98,7 @@ function SessDelete($uid)
|
||||
{
|
||||
$time = time();
|
||||
$sql = "DELETE FROM ".SESSIONS_TABLE." WHERE u_id='$uid'";
|
||||
$query = DataBase::sql_query($sql, 'GENERAL','Could not delete session',true);
|
||||
$query = DataBase::sql_query($sql, GENERAL,'Could not delete session',true);
|
||||
if (DataBase::num_rows($query)>0)
|
||||
{
|
||||
$result = DataBase::fetch($query);
|
||||
@@ -115,7 +115,7 @@ function SessView()
|
||||
$name = '';
|
||||
$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.');
|
||||
$query = DataBase::sql_query($sql, GENERAL,'Could not obtain sessions information.');
|
||||
if (DataBase::num_rows($query)>0)
|
||||
{
|
||||
while($result = DataBase::fetch($query))
|
||||
|
||||
@@ -54,7 +54,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.');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain categories information.');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
@@ -93,7 +93,7 @@ $skin =array(
|
||||
'last_user' => $lng['last_user'] . ': <b>' . User::LastUser() . '</b>',
|
||||
'stat' => $lng['statistics'],
|
||||
'showlastposts'=>$lng['showlastposts'],
|
||||
'total_posts'=> str_replace('%x%', $post_count ,$lng['total_posts']),
|
||||
'total_posts'=> str_replace('%x%', $forum_config['posts'] ,$lng['total_posts']),
|
||||
'lforum_counter'=> str_replace('%x%',$visit_count, $lng['forum_counter']),
|
||||
'logged_users' => str_replace('%x%', $sess[1] , $lng['logged_users']),
|
||||
'group_users' => $lng['users_groups'],
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/**
|
||||
* @package uForum
|
||||
* @file install/functions_add.php
|
||||
* @version $Id$3:26
|
||||
* @version $Id$
|
||||
* @copyright 2009(c) PioDer <pioder@wp.pl>
|
||||
* @link http://pioder.gim2przemysl.int.pl//
|
||||
* @license GNU GPL v3
|
||||
@@ -190,10 +190,10 @@ switch($_GET['page'])
|
||||
$config_file = str_replace('%pass%',strip_tags($_POST['mysql_pass']),$config_file);
|
||||
$config_file = str_replace('%dbname%',strip_tags($_POST['database']),$config_file);
|
||||
$config_file = str_replace('%dbprefix%',strip_tags($_POST['mysql_prefix']),$config_file);
|
||||
$connect = @mysql_connect($_POST['mysql_host'],$_POST['mysql_user'],$_POST['mysql_pass']) or message_die('GENERAL','Could not connect to database server. Error with installation!',@mysql_error());
|
||||
@fwrite(@fopen('../config.php','w'),$config_file) or message_die('GENERAL','Could not write config file. Error with installation!','');
|
||||
$connect = @mysql_connect($_POST['mysql_host'],$_POST['mysql_user'],$_POST['mysql_pass']) or message_die(GENERAL,'Could not connect to database server. Error with installation!',@mysql_error());
|
||||
@fwrite(@fopen('../config.php','w'),$config_file) or message_die(GENERAL,'Could not write config file. Error with installation!','');
|
||||
@mysql_query("SET NAMES 'utf8'",$connect);
|
||||
@mysql_select_db($_POST['database'],$connect) or message_die('GENERAL','Could not connect to database. Error with installation!',@mysql_error());
|
||||
@mysql_select_db($_POST['database'],$connect) or message_die(GENERAL,'Could not connect to database. Error with installation!',@mysql_error());
|
||||
include('./../includes/sql_parse.php');
|
||||
$sql = @fread(@fopen('uf_tables.sql','r'),@filesize('uf_tables.sql'));
|
||||
$sql = preg_replace('/uf_/', $_POST['mysql_prefix'], $sql);
|
||||
@@ -203,9 +203,9 @@ switch($_GET['page'])
|
||||
{
|
||||
DataBase::sql_query($sql[$i],'ERROR','Error of SQL Query: '.$sql[$i].' Error with install script!');
|
||||
}
|
||||
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".time()."' WHERE `name`='date_install'",'GENERAL','Could not update date install information');
|
||||
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".time()."' WHERE `name`='date_install'",GENERAL,'Could not update date install information');
|
||||
$patch = substr('http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'],0 ,-strlen('install/index.php?page=step4'));
|
||||
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".$patch."' WHERE `name`='forumpatch'",'GENERAL','Could not update date install information');
|
||||
DataBase::sql_query("UPDATE `".$_POST['mysql_prefix']."config` SET `value`='".$patch."' WHERE `name`='forumpatch'",GENERAL,'Could not update date install information');
|
||||
header('Location: index.php?page=step5');
|
||||
|
||||
|
||||
@@ -250,11 +250,11 @@ switch($_GET['page'])
|
||||
`regdate`='".time()."',
|
||||
`lastvisit`='".time()."'
|
||||
WHERE `u_id`='1';";
|
||||
DataBase::sql_query($sql,'CRITICAL','Could not update user. Error with install script!');
|
||||
DataBase::sql_query($sql,CRITICAL,'Could not update user. Error with install script!');
|
||||
$sql = "UPDATE `".POSTS_TABLE."` SET `ptime`='".time()."' WHERE `p_id`='1'";
|
||||
DataBase::sql_query($sql,'CRITICAL','Could not update post. Error with install script!');
|
||||
DataBase::sql_query($sql,CRITICAL,'Could not update post. Error with install script!');
|
||||
$sql = "UPDATE `".TOPICS_TABLE."` SET `lastpost_time`='".time()."' WHERE `t_id`='1'";
|
||||
DataBase::sql_query($sql,'CRITICAL','Could not update topic. Error with install script!');
|
||||
DataBase::sql_query($sql,CRITICAL,'Could not update topic. Error with install script!');
|
||||
header('Location: index.php?page=step7');
|
||||
}
|
||||
else
|
||||
@@ -290,7 +290,7 @@ switch($_GET['page'])
|
||||
$open = @fopen('../config.php','a+');
|
||||
$config_file = @fread($open,@filesize('../config.php'));
|
||||
$config_file = str_replace('false','true',$config_file);
|
||||
@fwrite(@fopen('../config.php','w'),$config_file) or message_die('GENERAL','Could not write config file. Error with installation!','');
|
||||
@fwrite(@fopen('../config.php','w'),$config_file) or message_die(GENERAL,'Could not write config file. Error with installation!','');
|
||||
echo $header.'<tr><td class="fitem" align="center"><span class="fstandard">'.$lng['info_2'].'</span></td></tr></table><meta http-equiv="refresh" content="4; url=../index.php"></body></html>';
|
||||
break;
|
||||
}
|
||||
@@ -142,6 +142,7 @@ $lng['sticky']='Przyklejony: ';
|
||||
$lng['visible_of_post']='Kliknij tutaj, aby zatwierdzić post';
|
||||
$lng['post_moderated']='Ten post nie został jeszcze zatwierdzony u moderatora';
|
||||
$lng['moderated_post_text']='Treść nie zatwierdzonego postu';
|
||||
$lng['post'] = 'Post';
|
||||
//
|
||||
//on private messages.....--------------------------------------------
|
||||
//
|
||||
|
||||
@@ -65,7 +65,7 @@ if (isset($_GET['mode']))
|
||||
$user = strip_tags(addslashes($_POST['user']));
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user inforamtion');
|
||||
$result = DataBase::fetch($query);
|
||||
$nick = $result['nick'];
|
||||
if ($result['nick']==$user)
|
||||
@@ -76,7 +76,7 @@ if (isset($_GET['mode']))
|
||||
{
|
||||
$user_id = $result['u_id'];
|
||||
$sql = "DELETE FROM `".SESSIONS_TABLE."` WHERE `u_id`='$user_id'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete session.');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete session.');
|
||||
if (User::UserInformation($user_id,'active')==0)
|
||||
{
|
||||
SessDelete($_SESSION['uid']);
|
||||
@@ -88,10 +88,10 @@ if (isset($_GET['mode']))
|
||||
$_SESSION['sessionid']=$ssid;
|
||||
//session register
|
||||
$sql = "INSERT INTO `".SESSIONS_TABLE."` VALUES ('', '".$_COOKIE[SESS_NAME]."','$user_id','".time()."')";//query
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add new session.');//run query
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add new session.');//run query
|
||||
//next...
|
||||
$sql = "UPDATE `".USERS_TABLE."` SET lastvisit='".time()."' WHERE u_id='$user_id'";//update lastvisit for user
|
||||
DataBase::sql_query($sql,'GENERAL','Could not update user lastvisit');//run query
|
||||
DataBase::sql_query($sql,GENERAL,'Could not update user lastvisit');//run query
|
||||
$msg = $lng['youareloggedas'].': <b>'.$nick.'</b>';// messaage "login as.."
|
||||
$skin['pa_link']='';
|
||||
$stop = TimeGeneration();//generate generation's time
|
||||
|
||||
@@ -48,6 +48,7 @@ switch(trim($_GET['action']))
|
||||
Secure::topic_exists($tid);
|
||||
$fid = Topic::TopicInformation($tid,'f_id');
|
||||
Mod::DeleteTopic($tid);
|
||||
TriggerStats($fid, 1);
|
||||
$stop = TimeGeneration();
|
||||
message_forum($lng['tdeleted'], 'forum.php?f='.$fid);
|
||||
break;
|
||||
@@ -79,6 +80,7 @@ switch(trim($_GET['action']))
|
||||
if ($tpid >1)
|
||||
{
|
||||
Mod::DeletePost($pid);
|
||||
TriggerStats($tid, 2);
|
||||
}
|
||||
$stop = TimeGeneration();
|
||||
message_forum($lng['pdeleted'],'topic.php?t='.$tid);
|
||||
@@ -109,7 +111,10 @@ switch(trim($_GET['action']))
|
||||
if (isset($_POST['forum_id']))
|
||||
{
|
||||
$fid = $_POST['forum_id'];
|
||||
$f_id = Topic::TopicInformation($tid, 'f_id');
|
||||
Mod::MoveTopic($tid,$fid);
|
||||
TriggerStats($fid, 1);
|
||||
TriggerStats($f_id, 1);
|
||||
message_forum($lng['topic_moved'],'topic.php?t='.$tid);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -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 = DataBase::fetch(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');
|
||||
|
||||
@@ -52,7 +52,7 @@ if ( ereg ("^.+@.+\..+$", $_POST['email']))
|
||||
if ($nick!='')
|
||||
{
|
||||
$sql = "SELECT * FROM `".USERS_TABLE."` WHERE `nick`='$nick'";
|
||||
$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['nick'];
|
||||
if ($result!=$nick)
|
||||
|
||||
10
search.php
@@ -30,7 +30,7 @@ SessDelInvalid();
|
||||
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');
|
||||
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$lastpost[$result['t_id']]['tp_id']=$result['tp_id'];
|
||||
@@ -40,7 +40,7 @@ while($result = DataBase::fetch($query))
|
||||
$lastpost[$result['t_id']]['user_rank']=$result['rank'];
|
||||
}
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain amout of posts in forum');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$count_topic[$result['t_id']]=$result['p_id'];
|
||||
@@ -105,7 +105,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
if (isset($_GET['u']))
|
||||
{
|
||||
$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'));
|
||||
FROM ".TOPICS_TABLE." WHERE `author`='".intval($_GET['u'])."'",GENERAL,'Could not obtain count amout of topics'));
|
||||
$count = $count['t_id'];
|
||||
$count = ceil($count / $limiter);
|
||||
if ($count==0)
|
||||
@@ -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 = DataBase::fetch(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)
|
||||
@@ -178,7 +178,7 @@ if ((isset($_POST['keywords'])) || ($_GET['content']=='lastposts') || ($_GET['co
|
||||
$skin = array_push_associative($skin,GenerateHeader($window_title,$navigator_title));
|
||||
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');
|
||||
$query = DataBase::sql_query($sql,GENERAL, 'Could not obtain topics information');
|
||||
$value = DataBase::num_rows($query);
|
||||
if ($value>0)
|
||||
{
|
||||
|
||||
@@ -25,9 +25,9 @@ if (isset($_GET['mode']))
|
||||
if ((strlen($content)>3) and (strlen($content)<300))
|
||||
{
|
||||
$sql = "DELETE FROM ".SHOUTBOX_TABLE." WHERE `mtime`<'".(time()-$forum_config['shoutbox_max_time'])."'";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not delete old messages');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not delete old messages');
|
||||
$sql = "INSERT INTO ".SHOUTBOX_TABLE." VALUES('','".$_SESSION['uid']."','".$content."','".time()."')";
|
||||
DataBase::sql_query($sql,'GENERAL','Could not add shoutbox message');
|
||||
DataBase::sql_query($sql,GENERAL,'Could not add shoutbox message');
|
||||
}
|
||||
}
|
||||
echo '<meta http-equiv="refresh" content="0; url=index.php">';
|
||||
@@ -37,7 +37,7 @@ if (isset($_GET['mode']))
|
||||
{
|
||||
if (isset($_GET['id']) && (RANK>0))
|
||||
{
|
||||
DataBase::sql_query("DELETE FROM ".SHOUTBOX_TABLE." WHERE `m_id`='".intval($_GET['id'])."'",'GENERAL','Could not delete shoutbox message');
|
||||
DataBase::sql_query("DELETE FROM ".SHOUTBOX_TABLE." WHERE `m_id`='".intval($_GET['id'])."'",GENERAL,'Could not delete shoutbox message');
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -58,7 +58,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');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain shoutbox information');
|
||||
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>' : '';
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px">
|
||||
<tr>
|
||||
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td>
|
||||
<td height="14" width="418" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['ltopicname']; ?> </td>
|
||||
<td height="14" width="110" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lauthor']; ?> </td>
|
||||
<td height="14" width="58" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lposts']; ?> </td>
|
||||
<td height="14" width="520" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['ltopicname']; ?> </td>
|
||||
<td height="14" width="130" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lauthor']; ?> </td>
|
||||
<td height="14" width="62" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lposts']; ?> </td>
|
||||
<td height="14" class="beam" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['llastpost']; ?> </td>
|
||||
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td>
|
||||
</tr>
|
||||
|
||||
|
Before Width: | Height: | Size: 911 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 900 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 881 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 910 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 890 B After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 899 B After Width: | Height: | Size: 1.1 KiB |
@@ -1,61 +0,0 @@
|
||||
|
||||
<!-- post id #<?= $skin['tp_id'];?> -->
|
||||
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px">
|
||||
<tr>
|
||||
<td width="17" class="beam" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td>
|
||||
<td width="100" id="p<? echo $skin['tp_id']; ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"></td>
|
||||
<td width="<?= (TABLES_WIDTH -244); ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')">Post</td>
|
||||
<td width="110" height="15" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lpinfo']; ?></td>
|
||||
<td width="17" class="beam" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td>
|
||||
</tr>
|
||||
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-top: 0px">
|
||||
<tr>
|
||||
<td width="116" height="1" class="fitem" align="center" rowspan="<?= $skin['rowspan']; ?>" valign="top">
|
||||
<a href="user.php?id=<? echo $skin['u_id']; ?>" class="fsmall"><? echo $skin['username']; ?></a><br>
|
||||
<? echo $skin['avatar']; ?><br><br><br>
|
||||
</td>
|
||||
<td width="<?= (TABLES_WIDTH -264); ?>" height="76" class="fitem" align="left" colspan="3" rowspan="<?= $skin['rowspan']; ?>" valign="top">
|
||||
<p align="left"><span class="fstandard"><? echo $skin['posttext']; ?></span><p class="fsmall" align="left"><? echo $skin['sig']; ?></p></p>
|
||||
</td>
|
||||
<td width="148" height="22" class="fitem" align="center" valign="top">
|
||||
<span class="fsmall">Post <? echo $skin['lno']; ?> </span>
|
||||
<a href="#p<? echo $skin['tp_id']; ?>" class="fsmall"><b>#<? echo $skin['tp_id']; ?></b></a><br>
|
||||
<span class="fsmall"><? echo $skin['ldate']; ?>: <b><? echo $skin['pdate']; ?></b></span><br>
|
||||
<span class="fsmall"><b><?= $skin['lstat']; ?>: </b></span><img src="images/<?= $skin['online']?>" alt="online">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="148" class="fitem" align="center" valign="top">
|
||||
<a href="posting.php?mode=qpost&id=<? echo $skin['p_id']; ?>&t=<? echo $tid; ?>"><img border="0" src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/quote_small.gif" width="48" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small_active.gif'"
|
||||
onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small.gif'" alt="quote"></a><br>
|
||||
<? echo $skin['edit']; ?>
|
||||
<? echo $skin['user_gg']; ?>
|
||||
<a href="pms.php?mode=write&id=<? echo $skin['u_id']; ?>"><img src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/pm_small.gif" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small_active.gif'"
|
||||
onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small.gif'" border="0" alt="pw"></a><br>
|
||||
<img src="images/user_agent/<?= $skin['ua_system']; ?>" alt="<?= $skin['ua_system_desc']; ?>" title="<?= $skin['ua_system_desc']; ?>"> <img src="images/user_agent/<?= $skin['ua_browser']; ?>" alt="<?= $skin['ua_browser_desc']; ?>" title="<?= $skin['ua_browser_desc']; ?>">
|
||||
</td>
|
||||
</tr>
|
||||
<? if ($_SESSION['uid']>0) { if(RANK>0) {?>
|
||||
<tr>
|
||||
<td colspan="3" height="40" class="fitem" style="background-color: #FFFF99" align="center" valign="top">
|
||||
<span class="fsmall"><b><?= $skin['admin'];?></b><br></span>
|
||||
<span class="fsmall"><?= $skin['L.IP']; ?></span>
|
||||
<? echo $skin['mode_p_del']; ?>
|
||||
<a href="http://localhost/DSF/warns.php?mode=add&id=<?= $skin['u_id']; ?>" class="fsmall" style="color: green"><?= $skin['add_warn']; ?></a><br>
|
||||
<? if (RANK==2) { ?>
|
||||
<a href="admin/admin_users.php?mode=edit&id=<?= $skin['u_id']; ?>" class="fsmall" style="color: red"><?= $skin['edit_profile']; ?></a><br>
|
||||
<a href="admin/banlist.php?mode=add&submode=all&ip=<?= $skin['IP']; ?>&uid=<?= $skin['u_id']; ?>" class="fsmall" style="color: red"><?= $skin['ban']; ?></a><br>
|
||||
<? }?>
|
||||
</td>
|
||||
</tr>
|
||||
<? } }?>
|
||||
<tr>
|
||||
<td width="116" height="1" class="fitem" align="center"><span class="fsmall"><?= $skin['warns_pool']; ?></td>
|
||||
<td width="105" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['lposts']; ?>: <b><? echo $skin['posts']; ?></b></span></td>
|
||||
<td width="153" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['lregdate']; ?>: <b><? echo $skin['regdate']; ?></b></span></td>
|
||||
<td width="228" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['llastvisit']; ?>: <b><? echo $skin['lastvisit']; ?></b></span></td>
|
||||
<td width="142" height="1" class="fitem" align="center"><span class="fsmall"><? echo $skin['lrank']; ?>: <? echo $skin['userrank']; ?></span></td>
|
||||
</tr>
|
||||
</table>
|
||||
<span class="fverysmall"> <br></span>
|
||||
<!-- end of post id #<?= $skin['tp_id'];?> -->
|
||||
@@ -3,9 +3,9 @@
|
||||
<tr>
|
||||
<td width="100" height="29" class="moderate">
|
||||
<?= $skin['stick']; ?>
|
||||
<a href="javascript:confirm_action('<?= $skin['c_delete_topic']; ?>','moderate.php?action=delete&id=<?= $tid; ?>')"><img border="0" src="skins/subPurple/images/delete.gif" width="20" height="20" alt="delete"></a>
|
||||
<a href="javascript:confirm_action('<?= $skin['c_delete_topic']; ?>','moderate.php?action=delete&id=<?= $tid; ?>')"><img border="0" src="skins/subPurple/images/delete.gif" alt="delete"></a>
|
||||
<?= $skin['lock']; ?>
|
||||
<a href="moderate.php?action=move&id=<?= $tid; ?>">
|
||||
<img border="0" src="skins/subPurple/images/move.gif" width="20" height="20" alt="move">
|
||||
<img border="0" src="skins/subPurple/images/move.gif" alt="move">
|
||||
</a>
|
||||
</td>
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
|
||||
<!-- post id #<?= $skin['tp_id'];?> -->
|
||||
<table class="maintable" width="<?= TABLES_WIDTH; ?>" style="border-width: 0px">
|
||||
<tr>
|
||||
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_left.gif')"></td>
|
||||
<td width="100" id="p<? echo $skin['tp_id']; ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"></td>
|
||||
<td width="<?= (TABLES_WIDTH -244); ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')">Post</td>
|
||||
<td width="<?= (TABLES_WIDTH -244); ?>" height="14" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><?= $skin['lpost']?></td>
|
||||
<td width="110" height="15" class="beam" align="center" style="background-image: url('skins/subPurple/images/td_beam_top.gif')"><? echo $skin['lpinfo']; ?></td>
|
||||
<td width="17" style="background-image: url('skins/subPurple/images/td_beam_right.gif')"></td>
|
||||
</tr>
|
||||
@@ -26,11 +25,11 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="148" class="fitem" align="center" valign="top">
|
||||
<a href="posting.php?mode=qpost&id=<? echo $skin['p_id']; ?>&t=<? echo $tid; ?>"><img border="0" src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/quote_small.gif" width="48" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small_active.gif'"
|
||||
<a href="posting.php?mode=qpost&id=<? echo $skin['p_id']; ?>&t=<? echo $tid; ?>"><img border="0" src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/quote_small.gif" width="48" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small_active.gif'"
|
||||
onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/quote_small.gif'" alt="quote"></a><br>
|
||||
<? echo $skin['edit']; ?>
|
||||
<? echo $skin['user_gg']; ?>
|
||||
<a href="pms.php?mode=write&id=<? echo $skin['u_id']; ?>"><img src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/pm_small.gif" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small_active.gif'"
|
||||
<a href="pms.php?mode=write&id=<? echo $skin['u_id']; ?>"><img src="skins/subPurple/images/lng_<? echo $skin['lang']; ?>/pm_small.gif" onMouseOver="this.style.cursor='hand'; this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small_active.gif'"
|
||||
onMouseOut="this.src='skins/<?= $default_skin; ?>/images/lng_<?= $default_lang; ?>/pm_small.gif'" border="0" alt="pw"></a><br>
|
||||
<img src="images/user_agent/<?= $skin['ua_system']; ?>" alt="<?= $skin['ua_system_desc']; ?>" title="<?= $skin['ua_system_desc']; ?>"> <img src="images/user_agent/<?= $skin['ua_browser']; ?>" alt="<?= $skin['ua_browser_desc']; ?>" title="<?= $skin['ua_browser_desc']; ?>">
|
||||
</td>
|
||||
|
||||
@@ -54,7 +54,7 @@ include('./skins/'.$default_skin.'/overall_header.tpl');
|
||||
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.');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain post information.');
|
||||
while($item=DataBase::fetch($query))
|
||||
{
|
||||
$ua = UserAgent($item['user_agent']);
|
||||
@@ -113,6 +113,7 @@ while($item=DataBase::fetch($query))
|
||||
'ua_browser_desc'=>$lng['browser'].' '.$ua[3],
|
||||
'lno'=>$lng['no.'],
|
||||
'lpinfo'=>$lng['postinfo'],
|
||||
'lpost'=>$lng['post'],
|
||||
'C.delete_post'=>$lng['c_delete_post']
|
||||
);
|
||||
//do it!
|
||||
|
||||
6
user.php
@@ -31,7 +31,7 @@ SessDeleteOld();
|
||||
$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.');
|
||||
$query = DataBase::sql_query($sql, GENERAL, 'Could not read user active.');
|
||||
$result = DataBase::fetch($query);
|
||||
if ($result['u_id']==$uid)
|
||||
{
|
||||
@@ -44,7 +44,7 @@ else
|
||||
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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information');
|
||||
$result = DataBase::num_rows($query);
|
||||
while ($result = DataBase::fetch($query))
|
||||
{
|
||||
@@ -60,7 +60,7 @@ while ($result = DataBase::fetch($query))
|
||||
$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');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain user information');
|
||||
$user_info = DataBase::fetch($query);
|
||||
if ($user_info['u_id']=='')
|
||||
{
|
||||
|
||||
@@ -54,7 +54,7 @@ else
|
||||
$page=1;
|
||||
}
|
||||
$count = DataBase::fetch(DataBase::sql_query("SELECT COUNT(`u_id`) as `u_id`
|
||||
FROM ".USERS_TABLE,'GENERAL','Could not obtain count amout of users'));
|
||||
FROM ".USERS_TABLE,GENERAL,'Could not obtain count amout of users'));
|
||||
$count = $count['u_id'] -1;
|
||||
$count = ceil($count / $limiter);
|
||||
if(isset($_GET['page']) && ($_GET['page']>$count))
|
||||
@@ -189,7 +189,7 @@ switch($_COOKIE['users_sort'])
|
||||
break;
|
||||
}
|
||||
}
|
||||
$query = DataBase::sql_query($sql,'CRITICAL','Could not obtain user information.');
|
||||
$query = DataBase::sql_query($sql,CRITICAL,'Could not obtain user information.');
|
||||
while($result = DataBase::fetch($query))
|
||||
{
|
||||
$skin = array(
|
||||
|
||||
@@ -120,7 +120,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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user information');
|
||||
$user = DataBase::fetch($query);
|
||||
if ($user['u_id']=='')
|
||||
{
|
||||
@@ -135,7 +135,7 @@ switch(trim($_GET['mode']))
|
||||
include('./skins/'.$default_skin.'/overall_header.tpl');
|
||||
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');
|
||||
$query = DataBase::sql_query($sql,GENERAL,'Could not obtain user warns information');
|
||||
$result = DataBase::num_rows($query);
|
||||
$warns_count = 0;
|
||||
while($item = DataBase::fetch($query))
|
||||
|
||||