Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 09:31 am EDT

Geeklog Forums

forum moderator hack

Page navigation


Status: offline

hidden

Forum User
Chatty
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
 Quote

G

Anonymous
Would love to see this. Thanks for doing it.
 Quote

Status: offline

hidden

Forum User
Chatty
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
Text 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

Text 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
Text 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
 Quote

Status: offline

trenchteam

Forum User
Regular Poster
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.
 Quote

Status: offline

hidden

Forum User
Chatty
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..
Text Formatted Code
 $forumlisting->set_var ('moderator', $moderators);

 
this is the replacement for that line.
we are just shadows of our hidden identities
 Quote

Status: offline

trenchteam

Forum User
Regular Poster
Registered: 06/08/04
Posts: 89
I keep getting sql errors
 Quote

Status: offline

hidden

Forum User
Chatty
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
 Quote

Status: offline

trenchteam

Forum User
Regular Poster
Registered: 06/08/04
Posts: 89
table prefix? Changes? Im not sure what you mean by this?
 Quote

Status: offline

hidden

Forum User
Chatty
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
 Quote

Status: offline

trenchteam

Forum User
Regular Poster
Registered: 06/08/04
Posts: 89
This is the index php in the forum folder in the public file right?
 Quote

Status: offline

hidden

Forum User
Chatty
Registered: 11/13/03
Posts: 51
yes it is.
we are just shadows of our hidden identities
 Quote

Status: offline

Robin

Forum User
Full Member
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
 Quote

Status: offline

hidden

Forum User
Chatty
Registered: 11/13/03
Posts: 51
in forumlisting.thtml of current theme, on line 3 i edited it.
Text 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
 Quote

Status: offline

trenchteam

Forum User
Regular Poster
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.
 Quote

Status: offline

hidden

Forum User
Chatty
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
 Quote

Status: offline

trenchteam

Forum User
Regular Poster
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?
 Quote

Status: offline

hidden

Forum User
Chatty
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
 Quote

Status: offline

trenchteam

Forum User
Regular Poster
Registered: 06/08/04
Posts: 89
yes, without the right and left blocks
 Quote

Status: offline

hidden

Forum User
Chatty
Registered: 11/13/03
Posts: 51
this topic.
we are just shadows of our hidden identities
 Quote

Lost Puppy

Anonymous
i would be intrested in ur last modified hack....
 Quote

Page navigation

All times are EDT. The time is now 09:31 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content