+ 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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user