Topics

User Functions

Events

There are no upcoming events

What's New

Stories

No new stories

Comments last 2 weeks

No new comments

Trackbacks last 2 weeks

No new trackback comments

Links last 2 weeks

No recent new links

NEW FILES last 14 days

No new files

Welcome to Geeklog Monday, May 20 2013 @ 01:04 PM EDT


 Forum Index > Extensions > Cool Hacks New Topic Post Reply
 forum moderator hack
First | Previous | 1 2 | Next | Last
   
hidden
 08/14/04 02:53AM (Read 5966 times)  
+++--
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
 
Profile Email Website
 Quote
Anonymous: G
 08/15/04 11:55PM  



Would love to see this. Thanks for doing it.

 
 Quote
hidden
 08/16/04 01:33AM  
+++--
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
 
Profile Email Website
 Quote
trenchteam
 08/17/04 07:10AM  
++++-
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.

 
Profile Email Website
 Quote
hidden
 08/17/04 08:10PM  
+++--
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);

 
this is the replacement for that line.

we are just shadows of our hidden identities
 
Profile Email Website
 Quote
trenchteam
 08/18/04 07:12AM  
++++-
Regular Poster

Status: offline


Registered: 06/08/04
Posts: 89
I keep getting sql errors

 
Profile Email Website
 Quote
hidden
 08/18/04 08:34PM  
+++--
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
 
Profile Email Website
 Quote
trenchteam
 08/19/04 12:53AM  
++++-
Regular Poster

Status: offline


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

 
Profile Email Website
 Quote
hidden
 08/19/04 01:20AM  
+++--
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
 
Profile Email Website
 Quote
trenchteam
 08/19/04 02:02AM  
++++-
Regular Poster

Status: offline


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

 
Profile Email Website
 Quote
hidden
 08/19/04 02:54AM  
+++--
Chatty

Status: offline


Registered: 11/13/03
Posts: 51
yes it is.

we are just shadows of our hidden identities
 
Profile Email Website
 Quote
Robin
 08/19/04 04:20AM  
+++++
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
 
Profile Email Website
 Quote
hidden
 08/19/04 04:56AM  
+++--
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
 
Profile Email Website
 Quote
trenchteam
 08/19/04 05:07AM  
++++-
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.

 
Profile Email Website
 Quote
hidden
 08/19/04 05:10AM  
+++--
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
 
Profile Email Website
 Quote
trenchteam
 08/19/04 05:33AM  
++++-
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?

 
Profile Email Website
 Quote
hidden
 08/19/04 09:48PM  
+++--
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
 
Profile Email Website
 Quote
trenchteam
 08/20/04 02:56AM  
++++-
Regular Poster

Status: offline


Registered: 06/08/04
Posts: 89
yes, without the right and left blocks

 
Profile Email Website
 Quote
hidden
 08/20/04 04:26AM  
+++--
Chatty

Status: offline


Registered: 11/13/03
Posts: 51
this topic.

we are just shadows of our hidden identities
 
Profile Email Website
 Quote
Anonymous: Lost Puppy
 09/26/04 08:14PM  



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

 
 Quote
First | Previous | 1 2 | Next | Last
Content generated in: 1.90 seconds
New Topic Post Reply

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