Posted on: 08/14/04 02:53am
By: hidden
i hack index.php to make it display the moderators for each forum . ill post it here when i got the chance.
anyone interested you can view it working
here[*1] .
forum moderator hack
Posted on: 08/15/04 11:55pm
By: Anonymous (G)
Would love to see this. Thanks for doing it.
forum moderator hack
Posted on: 08/16/04 01:33am
By: hidden
so here it is. this is a very dirty hack...
edit forum/index.php
look for this block of code
if ($posts > 0) {
$modsql = DB_query("SELECT * FROM {$_TABLES['gf_moderators']} WHERE mod_forum='{$B['forum_id']}'");
$moderatorcnt = 1;
while($showmods = DB_fetchArray($modsql)) {
$modquery = DB_numRows($modsql);
if($modquery < 1) {
$moderators = $LANG_GF01['no_one'];
} else {
if($moderatorcnt == 1) {
$moderators .= $showmods['mod_username'];
} else {
$moderators .= ", {$showmods['mod_username']}";
}
$moderatorcnt++;
}
}
edit or replace that code with this one
if ($posts > 0) {
$modsql = DB_query("SELECT * FROM {$_TABLES['gf_moderators']} WHERE mod_forum='{$B['forum_id']}'");
$moderatorcnt = 1;
$moderators="";
while($showmods = DB_fetchArray($modsql)) {
$modquery = DB_numRows($modsql);
if($modquery < 1) {
$moderators = $LANG_GF01['no_one'];
} else {
$modusers = DB_query("SELECT * FROM {$_TABLES['users']} WHERE username='{$showmods['mod_username']}'");
$moderatorid=DB_fetchArray($modusers);
if($moderatorcnt == 1) {
$moderators .= $showmods['mod_username'];
$moderators = '<A HREF="' .$_CONF['site_url'] .'/users.php?mode=profile&uid=' .$moderatorid['uid']. '">' .$moderators . '</a>';
} else {
$moderators .= '<A HREF="' .$_CONF['site_url'] .'/users.php?mode=profile&uid=' .$moderatorid['uid']. '">' . ", {$showmods['mod_username']}" . '</a>';
}
$moderatorcnt++;
}
$forumlisting->set_var ('moderator', $moderators);
}
look for this line and comment it
$forumlisting->set_var ('moderator', sprintf($LANG_GF01['MODERATED'],$moderators));
please inform me of any feedbacks.
edited(2004-08-18 )
forum moderator hack
Posted on: 08/17/04 07:10am
By: trenchteam
What do you mean by uncomment? Delete it? I get an sql error when i attempted this, and had to replace the file with my backup.
forum moderator hack
Posted on: 08/17/04 08:10pm
By: hidden
[QUOTE BY= trenchteam] What do you mean by uncomment? Delete it? I get an sql error when i attempted this, and had to replace the file with my backup. [/QUOTE]
sorry! i mean comment it out.
you have to comment it out because we've already set that variable above, inside the loop.
this line..
$forumlisting->set_var ('moderator', $moderators);
this is the replacement for that line.
forum moderator hack
Posted on: 08/18/04 07:12am
By: trenchteam
I keep getting sql errors
forum moderator hack
Posted on: 08/18/04 08:34pm
By: hidden
dont forget changing the table prefix to something you set in your config.php
forum moderator hack
Posted on: 08/19/04 12:53am
By: trenchteam
table prefix? Changes? Im not sure what you mean by this?
forum moderator hack
Posted on: 08/19/04 01:20am
By: hidden
gf_moderators -> that GF there... that's what i mean. have you tried recomparing the code that i posted here and the one that is in your index.php?
try looking at your error.log and check whats the exact error.
forum moderator hack
Posted on: 08/19/04 02:02am
By: trenchteam
This is the index php in the forum folder in the public file right?
forum moderator hack
Posted on: 08/19/04 02:54am
By: hidden
yes it is.
forum moderator hack
Posted on: 08/19/04 04:20am
By: Robin
Hi.
Which forum version is this hack designed for? I'm asking because the code you posted is slightly different from the code in 2.3. Anyhow I applied it to index.php from version 2.3 no errors so far. However I don't see the moderators listed. Are there any other not mentioned changes to some templates maybe?
forum moderator hack
Posted on: 08/19/04 04:56am
By: hidden
in forumlisting.thtml of current theme, on line 3 i edited it.
<td class="forumRollOut" style="padding-top:5px;"align="left" onMouseOver="className='forumRollOver'; this.style.cursor='hand';" onMouseOut="className='forumRollOut';" onclick="window.location.href='index.php?forum={forum_id}'; this.style.cursor='hand';"><A HREF="index.php?forum={forum_id}">{forum_name}</A><br>{forum_desc}<br>Moderator(s): {moderator}</td>
but i believe its already there...
im using forum 2.3.1
forum moderator hack
Posted on: 08/19/04 05:07am
By: trenchteam
Is that the only thing im missing now? I really like what you did, but I hope you have all the directions now.
forum moderator hack
Posted on: 08/19/04 05:10am
By: hidden
[QUOTE BY= trenchteam] Is that the only thing im missing now? I really like what you did, but I hope you have all the directions now.[/QUOTE]
yeah thats all that i did... i did not include the last step because i thought it was already there.
btw, have tried my other hack? the one that shows who and when the last topic is edited. its really cool.
forum moderator hack
Posted on: 08/19/04 05:33am
By: trenchteam
No I haven't. Im still tryin to get this one to work. I dont know what the problem is. Its a really nice hack. How did you get your forums to show without any columns?
forum moderator hack
Posted on: 08/19/04 09:48pm
By: hidden
[QUOTE BY= trenchteam] No I haven't. Im still tryin to get this one to work. I dont know what the problem is. Its a really nice hack. How did you get your forums to show without any columns?[/QUOTE]
what do you mean without any colums? you mean without the right and left block?
forum moderator hack
Posted on: 08/20/04 02:56am
By: trenchteam
yes, without the right and left blocks
forum moderator hack
Posted on: 08/20/04 04:26am
By: hidden
forum moderator hack
Posted on: 09/26/04 08:14pm
By: Anonymous (Lost Puppy)
i would be intrested in ur last modified hack....
forum moderator hack
Posted on: 09/26/04 08:25pm
By: hidden
so far its the latest.