+ Added virtual groups for Admins and Mods
git-svn-id: https://svn.pioder.pl/uf-svn/uF@26 72ec579a-5ced-4fa4-82f3-afba5d98df2f
This commit is contained in:
44
groups.php
44
groups.php
@@ -41,7 +41,7 @@ if(isset($_GET['mode']))
|
|||||||
{
|
{
|
||||||
$start = TimeGeneration();
|
$start = TimeGeneration();
|
||||||
$default_skin = ViewSkinName();
|
$default_skin = ViewSkinName();
|
||||||
$gid = intval($_GET['id']);
|
$gid = addslashes(strip_tags($_GET['id']));
|
||||||
if ((isset($_POST['nick']))and ($_POST['nick']!=''))
|
if ((isset($_POST['nick']))and ($_POST['nick']!=''))
|
||||||
{
|
{
|
||||||
if($_POST['nick']!='')
|
if($_POST['nick']!='')
|
||||||
@@ -68,17 +68,31 @@ if(isset($_GET['mode']))
|
|||||||
$_POST['nick']='';
|
$_POST['nick']='';
|
||||||
$_POST['delnick']='';
|
$_POST['delnick']='';
|
||||||
}
|
}
|
||||||
|
$bool = ($gid == 'mods') ? true : ($gid == 'admins') ? true : false;
|
||||||
|
if (!$bool)
|
||||||
|
{
|
||||||
$sql = "SELECT `g_id`, `name`, `desc`, `m_id` FROM `".GROUPS_TABLE."` WHERE `g_id`='$gid'";
|
$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']=='')
|
if ($group['g_id']=='')
|
||||||
{
|
{
|
||||||
message_forum($lng['no_group'], 'index.php');
|
message_forum($lng['no_group'], 'groups.php');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($gid == 'admins')
|
||||||
|
{
|
||||||
|
$group['name'] = $lng['admins'];
|
||||||
|
$group['desc'] = $lng['admins_desc'];
|
||||||
|
}
|
||||||
|
if ($gid == 'mods')
|
||||||
|
{
|
||||||
|
$group['name'] = $lng['mods'];
|
||||||
|
$group['desc'] = $lng['mods_desc'];
|
||||||
}
|
}
|
||||||
unset($tmp);
|
unset($tmp);
|
||||||
$skin = GenerateHeader($lng['showgroup'].': '.$group['name'], '</a>> <a href="groups.php?mode=view&id='.$group['g_id'].'" class="navigator">'.$lng['showgroup'].': '.$group['name']);
|
$skin = GenerateHeader($lng['showgroup'].': '.$group['name'], '</a>> <a href="groups.php?mode=view&id='.$group['g_id'].'" class="navigator">'.$lng['showgroup'].': '.$group['name']);
|
||||||
include('./skins/'.$default_skin.'/overall_header.tpl');
|
include('./skins/'.$default_skin.'/overall_header.tpl');
|
||||||
$skin = array(
|
$skin = array(
|
||||||
'moderate'=>IfModGroup($group['m_id']),
|
'moderate'=>(is_numeric($gid)) ? IfModGroup($group['m_id']) : '',
|
||||||
'name'=>$group['name'],
|
'name'=>$group['name'],
|
||||||
'desc'=>$group['desc'],
|
'desc'=>$group['desc'],
|
||||||
'lregdate'=>$lng['luregister'],
|
'lregdate'=>$lng['luregister'],
|
||||||
@@ -88,7 +102,15 @@ if(isset($_GET['mode']))
|
|||||||
'g_id'=>$group['g_id']
|
'g_id'=>$group['g_id']
|
||||||
);
|
);
|
||||||
include('./skins/'.$default_skin.'/group_view_head_body.tpl');
|
include('./skins/'.$default_skin.'/group_view_head_body.tpl');
|
||||||
|
if ($gid == 'admins') { $rnk = 2; } else {$rnk = 1;}
|
||||||
|
if (is_numeric($gid))
|
||||||
|
{
|
||||||
$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'";
|
$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'";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$sql = "SELECT * FROM ".USERS_TABLE." WHERE `rank` = '$rnk'";
|
||||||
|
}
|
||||||
$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);
|
$amout = DataBase::num_rows($query);
|
||||||
if ($amout>0)
|
if ($amout>0)
|
||||||
@@ -139,8 +161,24 @@ if(isset($_GET['mode']))
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$default_skin = ViewSkinName();
|
$default_skin = ViewSkinName();
|
||||||
|
|
||||||
$skin = GenerateHeader($lng['lgroups'], '</a>> <a href="groups.php" class="navigator">'.$lng['lgroups']);
|
$skin = GenerateHeader($lng['lgroups'], '</a>> <a href="groups.php" class="navigator">'.$lng['lgroups']);
|
||||||
include('./skins/'.$default_skin.'/overall_header.tpl');
|
include('./skins/'.$default_skin.'/overall_header.tpl');
|
||||||
|
$special_groups[] = array('admins', $lng['admins'], $lng['admins_desc']);
|
||||||
|
$special_groups[] = array('mods', $lng['mods'], $lng['mods_desc']);
|
||||||
|
$i = 0;
|
||||||
|
while($i<2)
|
||||||
|
{
|
||||||
|
$skin = array (
|
||||||
|
'g_id'=>$special_groups[$i][0],
|
||||||
|
'name' => $special_groups[$i][1],
|
||||||
|
'desc' =>$special_groups[$i][2]
|
||||||
|
);
|
||||||
|
include('./skins/'.$default_skin.'/group_add_body.tpl');
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
echo '<br />';
|
||||||
|
|
||||||
$sql = "SELECT `g_id`, `name`, `desc` FROM `".GROUPS_TABLE."` ORDER BY `sort`";
|
$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)
|
if (DataBase::num_rows($query)>0)
|
||||||
|
|||||||
@@ -148,6 +148,8 @@ class Secure
|
|||||||
function group_exists($gid)
|
function group_exists($gid)
|
||||||
{
|
{
|
||||||
global $lng;
|
global $lng;
|
||||||
|
if ($gid != 'mods' || $gid!='admins')
|
||||||
|
{
|
||||||
$sql = "SELECT `g_id` FROM `".GROUPS_TABLE."` WHERE g_id='$gid'";
|
$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'];
|
$result = $result['g_id'];
|
||||||
@@ -156,6 +158,7 @@ class Secure
|
|||||||
message_forum($lng['no_group'],'groups.php');
|
message_forum($lng['no_group'],'groups.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
function TagsReplace($text)
|
function TagsReplace($text)
|
||||||
{
|
{
|
||||||
$text = strip_tags($text,ALLOWED_TAGS);
|
$text = strip_tags($text,ALLOWED_TAGS);
|
||||||
|
|||||||
@@ -113,6 +113,10 @@ $lng['admin_mod_administration']='Pole Admina/Mod\'a';
|
|||||||
//
|
//
|
||||||
//other...------------------------------------------------------------
|
//other...------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
$lng['admins']='Administratorzy';
|
||||||
|
$lng['admins_desc']='Globalni administratorzy tego forum';
|
||||||
|
$lng['mods']='Moderatorzy';
|
||||||
|
$lng['mods_desc']='Osoby odpowiedzialne za ład i porządek na forum';
|
||||||
$lng['yesterday']='Wczoraj';
|
$lng['yesterday']='Wczoraj';
|
||||||
$lng['today']='Dzisiaj';
|
$lng['today']='Dzisiaj';
|
||||||
$lng['message_forum']='Komunikat Forum';
|
$lng['message_forum']='Komunikat Forum';
|
||||||
|
|||||||
Reference in New Issue
Block a user