mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-11 05:48:51 +00:00
Forums can have moderators now..
git-svn-id: file:///svn/phpbb/trunk@39 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
ddc2cd6ead
commit
852eaf0da9
2 changed files with 79 additions and 34 deletions
|
@ -127,4 +127,35 @@ function make_jumpbox($db, $phpEx)
|
||||||
return($boxstring);
|
return($boxstring);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function get_moderators($db, $forum_id)
|
||||||
|
{
|
||||||
|
$sql = "SELECT u.username, u.user_id FROM " . FORUM_MODS_TABLE ." f, " . USERS_TABLE . " u
|
||||||
|
WHERE f.forum_id = '$forum_id' AND u.user_id = f.user_id";
|
||||||
|
if($result = $db->sql_query($sql))
|
||||||
|
{
|
||||||
|
if($total_mods = $db->sql_numrows($result))
|
||||||
|
{
|
||||||
|
$rowset = $db->sql_fetchrowset($result);
|
||||||
|
for($x = 0; $x < $total_mods; $x++)
|
||||||
|
{
|
||||||
|
$modArray[] = array("id" => $rowset[$x]["user_id"],
|
||||||
|
"name" => $rowset[$x]["username"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$modArray[] = array("id" => "-1",
|
||||||
|
"name" => "ERROR");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$modArray[] = array("id" => "-1",
|
||||||
|
"name" => "ERROR");
|
||||||
|
}
|
||||||
|
|
||||||
|
return($modArray);
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -82,7 +82,21 @@ if($total_categories)
|
||||||
$last_post = "No Posts";
|
$last_post = "No Posts";
|
||||||
}
|
}
|
||||||
|
|
||||||
$moderators = "<a href=\"profile.$phpEx?mode=viewprofile&user_id=1\">theFinn</a>";
|
$moderators = get_moderators($db, $forum_rows[$j]["forum_id"]);
|
||||||
|
unset($moderators_links);
|
||||||
|
for($mods = 0; $mods < count($moderators); $mods++)
|
||||||
|
{
|
||||||
|
if(isset($moderators_links))
|
||||||
|
{
|
||||||
|
$moderators_links .= ", ";
|
||||||
|
}
|
||||||
|
if(!($mods % 2) && $mods != 0)
|
||||||
|
{
|
||||||
|
$moderators_links .= "<br>";
|
||||||
|
}
|
||||||
|
$moderators_links .= "<a href=\"profile.$phpEx?mode=viewprofile&user_id=".$moderators[$mods]["id"]."\">".$moderators[$mods]["name"]."</a>";
|
||||||
|
}
|
||||||
|
|
||||||
if($row_color == "#DDDDDD")
|
if($row_color == "#DDDDDD")
|
||||||
{
|
{
|
||||||
$row_color = "#CCCCCC";
|
$row_color = "#CCCCCC";
|
||||||
|
@ -100,7 +114,7 @@ if($total_categories)
|
||||||
"POSTS" => $posts,
|
"POSTS" => $posts,
|
||||||
"TOPICS" => $topics,
|
"TOPICS" => $topics,
|
||||||
"LAST_POST" => $last_post,
|
"LAST_POST" => $last_post,
|
||||||
"MODERATORS" => $moderators));
|
"MODERATORS" => $moderators_links));
|
||||||
|
|
||||||
$template->parse("forums", "forumrow", true);
|
$template->parse("forums", "forumrow", true);
|
||||||
} // if ... then
|
} // if ... then
|
||||||
|
|
Loading…
Add table
Reference in a new issue