Welcome to Geeklog Monday, May 20 2013 @ 01:04 PM EDT
|
||||||||
![]() |
Forum Index > Extensions > Cool Hacks |
New Topic
|
Post Reply
|
forum moderator hack |
|||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
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. we are just shadows of our hidden identities |
||||||
|
|||||||
| Anonymous: G |
|
||||||
|
|
Would love to see this. Thanks for doing it.
|
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
so here it is. this is a very dirty hack...
edit forum/index.php look for this block of code PHP Formatted 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 PHP Formatted Code 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 PHP Formatted Code $forumlisting->set_var ('moderator', sprintf($LANG_GF01['MODERATED'],$moderators));please inform me of any feedbacks. edited(2004-08-18 ) we are just shadows of our hidden identities |
||||||
|
|||||||
| trenchteam |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 06/08/04 Posts: 89 |
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.
|
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
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. 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.. PHP Formatted Code $forumlisting->set_var ('moderator', $moderators);we are just shadows of our hidden identities |
||||||
|
|||||||
| trenchteam |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 06/08/04 Posts: 89 |
I keep getting sql errors
|
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
dont forget changing the table prefix to something you set in your config.php
we are just shadows of our hidden identities |
||||||
|
|||||||
| trenchteam |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 06/08/04 Posts: 89 |
table prefix? Changes? Im not sure what you mean by this?
|
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
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. we are just shadows of our hidden identities |
||||||
|
|||||||
| trenchteam |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 06/08/04 Posts: 89 |
This is the index php in the forum folder in the public file right?
|
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
yes it is.
we are just shadows of our hidden identities |
||||||
|
|||||||
| Robin |
|
||||||
![]() ![]() ![]() ![]() ![]() Full Member Status: offline ![]() Registered: 02/15/02 Posts: 725 |
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? Geeklog Polish Support Team |
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
in forumlisting.thtml of current theme, on line 3 i edited it.
PHP Formatted Code <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 we are just shadows of our hidden identities |
||||||
|
|||||||
| trenchteam |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 06/08/04 Posts: 89 |
Is that the only thing im missing now? I really like what you did, but I hope you have all the directions now.
|
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
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. 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. we are just shadows of our hidden identities |
||||||
|
|||||||
| trenchteam |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 06/08/04 Posts: 89 |
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?
|
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
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? what do you mean without any colums? you mean without the right and left block? we are just shadows of our hidden identities |
||||||
|
|||||||
| trenchteam |
|
||||||
![]() ![]() ![]() ![]() ![]() Regular Poster ![]() Status: offline ![]() Registered: 06/08/04 Posts: 89 |
yes, without the right and left blocks
|
||||||
|
|||||||
| hidden |
|
||||||
![]() ![]() ![]() ![]() ![]() Chatty ![]() Status: offline ![]() Registered: 11/13/03 Posts: 51 |
this topic.
we are just shadows of our hidden identities |
||||||
|
|||||||
| Anonymous: Lost Puppy |
|
||||||
|
|
i would be intrested in ur last modified hack....
|
||||||
|
|||||||
| Content generated in: 1.90 seconds |
|
|
|