PDA

View Full Version : moderated by...


robflack
04-26-2003, 09:40 AM
can someone tell me how to remove the moderated column from my list of forums?

Koutaru
04-26-2003, 10:09 AM
you have to edit the Forum home and Forum display templates :)

Brad
04-26-2003, 11:21 AM
http://www.vbulletintemplates.com/mods/showthread.php?threadid=7&highlight=remove+mod

Install that template modification.

code hacking (dont have to do this)

If you want to take all the mod code out to save some processing time or something (hey, if we arent using them why should we have code for them? ;) ). You can do this code hack (not tested).

Open index.php

Find:

,forumhome_moderator

Remove it.

Find:

$imodcache = array();
$mod = array();
$forummoderators=$DB_site->query('SELECT user.userid,user.username,moderator.forumid
FROM moderator
LEFT JOIN user
ON (moderator.userid=user.userid)
ORDER BY user.username');
while ($moderator=$DB_site->fetch_array($forummoderators)) {
$imodcache["$moderator[forumid]"][] = $moderator;
$mod["$moderator[userid]"] = 1;
}
$DB_site->free_result($forummoderators);
unset($moderator);

Remove it.

Find:

,$imodcache

Remove it.

Find:

$listexploded=",", $forum['parentlist']);
while ( list($mkey1,$mval1)=$listexploded) ) {
if ( !isset($imodcache["$mval1"]) ) {
continue;
}
$imodcache["$mval1"]);
while ( list($mkey2,$moderator)=$imodcache["$mval1"]) ) {
if ( !isset($forum['moderators']) ) {
eval("\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
} else {
eval("\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
}
}
}


Remove it.

Find:

if ( !isset($forum['moderators']) ) {
$forum['moderators'] = ' ';
}

Remove it.

I *think* thats everything, again the code hack isent tested.

Koutaru
04-26-2003, 11:49 AM
It works :) Thanks. Even the index.php code removal seems to be fine.

One thing, in 2.3's index.php I could only find this when I was looking for the 2nd to last removal

$listexploded=explode(",", $forum['parentlist']);
while ( list($mkey1,$mval1)=each($listexploded) ) {
if ( !isset($imodcache["$mval1"]) ) {
continue;
}
reset($imodcache["$mval1"]);
while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) {
if ( !isset($forum['moderators']) ) {
eval("\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
} else {
eval("\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
}
}
}

It should be the same thing

Brad
04-26-2003, 12:11 PM
Yea thats correct, I messed up the formatting a bit while pasting it over. Ive edited my post to refelect the correct formatting now. :)

Brad
04-26-2003, 12:20 PM
argh! I forgot about sub-forums. To compleatly remove mod list for sub-forums do this:

Open forumdisplay.php

Find:

,forumhome_moderator

Remove it.

Find:

,$imodcache

Remove it.

Find:

unset($forum['moderators']);
$listexploded=explode(",", $forum['parentlist']);
while ( list($mkey1,$mval1)=each($listexploded) ) {
if ( !isset($imodcache["$mval1"]) ) {
continue;
}
reset($imodcache["$mval1"]);
while ( list($mkey2,$moderator)=each($imodcache["$mval1"]) ) {
if ( !isset($forum['moderators']) ) {
eval("\$forum['moderators'] = \"".gettemplate('forumhome_moderator')."\";");
} else {
eval("\$forum['moderators'] .= \", ".gettemplate('forumhome_moderator')."\";");
}
}
}

if ( !isset($forum['moderators']) ) {
$forum['moderators'] = ' ';
}


Remove it.

Should be it!.

// Note: Only removed template and code in makeforumbit so I wouldent break the parent forums mod list.