/**************************************
electrifiedForum
Version 0.99rc3 - November 2, 2001
Copyright 2001- electrifiedpenguin.com
This is free software, please leave all
copyright notices intact, thanks!
This is the admin functions file
MAKE NO CHANGES TO THIS FILE
Customizing options are in the realm files!!!
***************************************/
function manageusers()
{
global $forumsess,$config,$realm,$sortby;
if (admincheck($forumsess[$realm][username]))
{
if (db_numrows_all($config[utable])>0)
{
if ($sortby)
$result = db_select("SELECT * FROM $config[utable] ORDER BY $sortby ASC");
else
$result = db_select("SELECT * FROM $config[utable] ORDER BY username ASC");
print "
";
print "
Username |
Level |
Msgs |
Actions |
";
$i = 0;
while($row = db_getarray($result))
{
$i = $i + 1;
if ($i % 2)
$bgcolor = $config['color_b'];
else
$bgcolor = $config['color_a'];
if ($row[username] == $forumsess[$realm][username])
{
$promotetext = "";
$demotetext = "";
}
else
{
$promotetext = " Promote";
$demotetext = " Demote";
}
if ($row[disabled])
$disabletext = "Enable";
else
$disabletext = "Disable";
if ($row[level] == 10)
{
$level = "Administrator $demotetext";
$actions = "";
}
else
{
$level = "Member $promotetext";
$actions = "$disabletext";
}
print "
".$row[username]." |
$level |
".usermessagecount($row[username])." |
$actions
|
";
}
print " |
";
}
else
{
print "No users available
";
}
}
else
{
print "You do not have sufficient access to manage users.
";
}
}
function manageforums()
{
global $forumsess,$config,$realm;
if (admincheck($forumsess[$realm][username]))
{
print "Add Forum
";
if (db_numrows_all('forums')>0)
{
print "
";
$result = db_select("SELECT cat FROM $config[ftable] GROUP BY cat");
while($cat = db_getarray($result))
{
$result2 = db_select("SELECT * FROM $config[ftable] WHERE cat='$cat[cat]' ORDER BY ftitle ASC");
if (!$cat[cat])
$cat[cat] = $lang[gf];
print "
$cat[cat] |
";
print "
Status |
Forum |
Topics |
Messages |
Actions |
";
$i = 0;
while($row = db_getarray($result2)){
$i = $i + 1;
$options = $row[options];
if (!$options & 1)
$closed = TRUE;
else
$closed = FALSE;
if ($options & 2)
$private = TRUE;
else
$private = FALSE;
if ($i % 2)
$bgcolor = $config['color_b'];
else
$bgcolor = $config['color_a'];
/*
if ($row[icon])
$icon = "";
else
$icon = "";
*/
$status = NULL;
if ($closed)
$status = "Closed ";
else
$status = "Open ";
if ($private)
$status .= "Private";
print "
$status |
".$row[ftitle]." |
".topiccount($row[fname])." |
".messagecount($row[fname])." |
Edit
Delete
Delete Clean
|
";
}
}
print " |
";
}
else
{
print "No forums available
";
}
}
else
{
print "You do not have sufficient access to manage forums.
";
}
}
function catlist()
{
global $config;
$result = db_select("SELECT cat FROM $config[ftable] GROUP BY cat");
while($cat = db_getarray($result))
{
$c[] = $cat[cat];
}
return $c;
}
function addforum()
{
global $forumsess,$config,$realm;
if (admincheck($forumsess[$realm][username]))
{
?>