PDA

View Full Version : Custom Moderator Titles


TECK
10-18-2002, 10:00 PM
This goes for my friend Danny (LeeCHeSSS) who asked me to make it for him.
Basically is a very simple hack to change the user title for each mod in function of the numer of posts, the same way like a regular user.

I wanted first to make it admin CP based, but that would involve new fields added to database, several files hacked, etc.
Why do all this when we can do it in less then 20seconds with a simple file edit? ;)

functions.php
FIND:
$post[joindate]=vbdate($registereddateformat,$post[joindate]);
REPLACE WITH:
if ( $post[usertitle] == 'Moderator' )
{
$post[usertitle] = 'Expert Moderator';

if ( $post[posts] < 30 )
{
$post[usertitle] = 'Junior Moderator';
}
elseif ( $post[posts] < 100 )
{
$post[usertitle] = 'Regular Moderator';
}
elseif ( $post[posts] < 300 )
{
$post[usertitle] = 'Senior Moderator';
}
}

$post[joindate]=vbdate($registereddateformat,$post[joindate]);
It's as simple as this. :)
Customize your titles the way you want. You can it do the same way with Super Mods and Admins. Is up to you how to have fun with it.

You could also use:
if ( $post[usertitle] == 'Moderator' )
{
$post[usertitle] = 'Sleeps With The Monitor Moderator';

if ( $postsperday < 5 )
{
$post[usertitle] = 'Sleepy Moderator';
}
elseif ( $postsperday < 15 )
{
$post[usertitle] = 'Alert Moderator';
}
elseif ( $postsperday < 30 )
{
$post[usertitle] = 'Super Alert Moderator';
}
}

$post[joindate]=vbdate($registereddateformat,$post[joindate]);
Just another way to write it, the code, not using the ELSE condition and saving another few lines of code.
That will change the name of your moderators in function of how many posts per day they make.
The more posts per days they make, the better it will be their title and the members will count more on their support.

TECK
10-19-2002, 03:19 AM
btw, that's the new way the vBulletin 3 code is written. :)

Vile
10-19-2002, 05:08 AM
Cool idea, thanks :)
Installed.

N9ne
10-19-2002, 08:01 AM
It says postsperday...? Doesn't that mean posts per day?

TECK
10-19-2002, 09:15 AM
ya. :)

John
10-19-2002, 10:04 AM
Nice :D

You're a good lad, teck ;)

Neo
10-19-2002, 10:50 AM
Originally posted by TECK
btw, that's the new way the vBulletin 3 code is written. :)

Since when :bunny:

N9ne
10-19-2002, 11:13 AM
So TECK, if it means postsperday, it will go by how many posts the moderator posts for that day? I'm confused...

Bison
10-19-2002, 01:33 PM
Nice hack ... but here's how I set it up on my forum:

// Custom Moderator Titles
if ( $post[usertitle] == 'Moderator' )
{
if ( $post[posts] > 30 and $post[posts] < 100 )
{
$post[usertitle] = 'Junior Moderator';
}
elseif ( $post[posts] == 100 and $post[posts] < 301 )
{
$post[usertitle] = 'Special Moderator';
}
elseif ( $post[posts] > 300 )
{
$post[usertitle] = 'Expert Moderator';
}
}
// End Custom Moderator Titles

Velocd
10-19-2002, 04:24 PM
This is pretty basic, but useful. ;) I do this with mine as well, using one of my very earlier hacks.

btw, that's the new way the vBulletin 3 code is written.

Since when


I also agree, it looks like regular basic code, Teck... ~_~
:p

Chris M
10-19-2002, 05:42 PM
Interesting Concept:)

Satan

NTLDR
10-19-2002, 06:07 PM
Looks like a Java format of code *shudders* I certainly won't be writing any code like that ;) I'll stick to hope the code is layed out in vB2.

Chris M
10-19-2002, 06:35 PM
I wouldnt care as long as it did the job;)

Satan

TECK
10-19-2002, 09:15 PM
Originally posted by Rolodex
Nice hack ... but here's how I set it up on my forum...
is the same thing, you are simply using more code with the same results.
just by using a "smaller then" condition, you save time and you also perform less operations on your board.
always think code wise, not that is a big deal... but if you learn to write elegant code, your board will always be healthy coded.
Originally posted by Neo
Since when :bunny:
since they started developing it. :)
i write my code from now on like that... just to get used.
Originally posted by NTLDR
Looks like a Java format of code *shudders* I certainly won't be writing any code like that ;) I'll stick to hope the code is layed out in vB2. it will not. better get used to it.

Kmaster
10-20-2002, 11:26 AM
Can that be done usergroupid instead of $post[usertitle]? thx~~~

Bison
10-20-2002, 02:12 PM
Originally posted by TECK

is the same thing, you are simply using more code with the same results.
just by using a "smaller then" condition, you save time and you also perform less operations on your board.
always think code wise, not that is a big deal... but if you learn to write elegant code, your board will always be healthy coded.


Please advise ...

All this is doing is a if condition check based on the amount of post a user has within a post range ... displaying the results if the condition fits.

I like it to grab a particular post count number and mark that member with the title I want him to have.

Show me a better solution then ... I don't see your point in this matter bro!

"show me the money!"

N9ne
10-26-2002, 10:28 PM
TECK: A question, if I want to replace the text with an image, how can I do it? I tried using $bburl and it wouldn't work...I want $bburl to work, so I could have say $bburl/images/imagehere.gif

TECK
10-26-2002, 11:07 PM
you could add below:
$post[usertitle] = 'Expert Moderator';

this:
$post[userimage] = 'expmod'; for example.

your code in template should be something like:
<img border="0" src="{imagesfolder}/$post[userimage].gif">

N9ne
10-27-2002, 04:04 PM
So expmod is the template being called? Isn't there additional code to call a template?

TECK
11-21-2002, 10:20 AM
No. expmod.gif will be your image that you upload onto your /images folder.
Is as simple as this. :)

N9ne
11-21-2002, 03:42 PM
I figured it out earlier :) I made some modification to it all, and changed it to use replacements instead...