+ Changed generating last post and post count in forum and topic.php
+ Deleted not used template file: post_add_body.tpl + Replaced MCP images git-svn-id: https://svn.pioder.pl/uf-svn/uF@21 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user