PDA

View Full Version : Custom Moderator Titles


TECK
19 Oct 2002, 04:13
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
19 Oct 2002, 04:19
btw, that's the new way the vBulletin 3 code is written. :)

Vile
19 Oct 2002, 06:08
Cool idea, thanks :)
Installed.

N9ne
19 Oct 2002, 09:01
It says postsperday...? Doesn't that mean posts per day?

TECK
19 Oct 2002, 10:15
ya. :)

John
19 Oct 2002, 11:04
Nice :D

You're a good lad, teck ;)

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

Since when :bunny:

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

Bison
19 Oct 2002, 14:33
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
19 Oct 2002, 17:24
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
19 Oct 2002, 18:42
Interesting Concept:)

Satan

NTLDR
19 Oct 2002, 19:07
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
19 Oct 2002, 19:35
I wouldnt care as long as it did the job;)

Satan

TECK
19 Oct 2002, 22:15
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
20 Oct 2002, 12:26
Can that be done usergroupid instead of $post[usertitle]? thx~~~

Bison
20 Oct 2002, 15:12
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
26 Oct 2002, 23:28
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
27 Oct 2002, 01:07
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
27 Oct 2002, 17:04
So expmod is the template being called? Isn't there additional code to call a template?

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

N9ne
21 Nov 2002, 16:42
I figured it out earlier :) I made some modification to it all, and changed it to use replacements instead...