Jump to content
MakeWebGames

Recommended Posts

Posted (edited)

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Put that function in global_func.php and then replace the following throughout all the files;

{$ir['username']}

with

".username()."

Hope that helps

-sniko

Edited by sniko
Posted

Try this

in the globals.php file, find this :

$ir=$db->fetch_row($is);

and under it add this:

if ($ir['user_level'] == 2) {

$ir['username']="<font color='blue'>{$ir['username']}</font>";

}

that should change the username info in the array with the string that makes the text blue without you having to alter every file.

Depending on what php version you have, the string should execute replacing the username info part before changing the string. if not, use this:

if ($ir['user_level'] == 2) {

$utemp="<font color='blue'>{$ir['username']}</font>";

$ir['username']=$utemp;

}

The code above sets a temp variable to the string, which inturn replaces the username first and adds the color code to the string. then sets the name array to that bit of code, which should work.

  • 2 weeks later...
Posted (edited)

For the players Username:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

For every other Username the player will see:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

I haven't tested this, as I already have a function to do all of the different "User Levels" and Donators.

Edited by Maniak
  • 2 weeks later...
Posted (edited)

This is what I use:

 

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Bit lengthy I know, but I'm new to coding and this is how I knew to do it, but it covers everything, donators, different color for each staff user level, NPC's, male/female. And just put $user_name where you want it to show. Of course you might need to change a couple things.

Edited by Smokey
Posted

You're all over-complicating things here.

Simply define an array with heximal colour values once, and use it.

Eg.

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

As for donators, it would be wise to assign them a different userlevel, which the script does.

Posted

Assigning donators a different user level if you ask me would complicate things more, wouldnt you have to track down every single if statement for user_level 1 and add one for user_level "whatever the new one for donators is"?

Posted
Assigning donators a different user level if you ask me would complicate things more, wouldnt you have to track down every single if statement for user_level 1 and add one for user_level "whatever the new one for donators is"?

That's a good observation, I've thought of that too when I wrote that code.

It comes down to whether you want to show a donated admin as admin colour or as donator colour.

I would think that they would prefer the admin colour.

To modify:

You're unable to view this code.

Viewing code within this forum requires registration, you can register here for free.

 

Example above would only recolour users who hold no additional permissions.

Posted

Personally I want all staff members to be colored, a different color for each user_level (including NPC's), with no bearing on donatorship, then for regular users a different color for male/female (donators only) then a single default color for all non-donators (with the exception of staff) which my code does all that, its just a lot of code but it does work well :P

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...