Author Topic: [MOD]Usertitles  (Read 14138 times)

0 Members and 1 Guest are viewing this topic.

Offline Ice

  • Pre-Newbie
  • Posts: 3
    • View Profile
[MOD]Usertitles
« on: May 10, 2005, 10:01:14 PM »
Hey Guys,
i thought about getting different usertitles e.g. "spamking" (instead of member) or something like that and searched the whole board, but couldn't find any answers, so i looked through the code of the pages and found something dunno if it really works all right oder if it opens security leaks. Perhaps u can help me.

lang/{your_language}/main.php

Code: [Select]
//-----------------------------------------------------
//--- Userlevel ---------------------------------------
//-----------------------------------------------------
$lang['userlevel_admin'] = "Admin";
$lang['userlevel_user'] = "Member";
$lang['userlevel_guest'] = "Guest";

you can add

Code: [Select]
//-----------------------------------------------------
//--- Userlevel ---------------------------------------
//-----------------------------------------------------
$lang['userlevel_admin'] = "Admin";
$lang['userlevel_user'] = "Member";
$lang['userlevel_spamking'] = "Spamking";
$lang['userlevel_guest'] = "Guest";

//----//

includes/constants.php

Code: [Select]
// User levels
define('GUEST', -1);
define('USER_AWAITING', 1);
define('USER', 2);
define('ADMIN', 9);


// Permission levels
define('AUTH_ALL', 0);
define('AUTH_USER', 2);
define('AUTH_ACL', 3);
define('AUTH_ADMIN', 9);


You could add:
Code: [Select]
// User levels
define('GUEST', -1);
define('USER_AWAITING', 1);
define('USER', 2);
define('SPAMKING', 3);
define('ADMIN', 9);


// Permission levels
define('AUTH_ALL', 0);
define('AUTH_USER', 2);
define('AUTH_SPAMKING', 2);
define('AUTH_ACL', 3);
define('AUTH_ADMIN', 9);

//----//

details.php


Find:
Code: [Select]
        if (!isset($comment_row[$i][$user_table_fields['user_level']]) || (isset($comment_row[$i][$user_table_fields['user_level']]) && $comment_row[$i][$user_table_fields['user_level']] == USER)) {
          $comment_user_info = $lang['userlevel_user'];
        }
        elseif ($comment_row[$i][$user_table_fields['user_level']] == ADMIN) {
          $comment_user_info = $lang['userlevel_admin'];
        }

Add after:

Code: [Select]
        elseif ($comment_row[$i][$user_table_fields['user_level']] == SPAMKING) {
          $comment_user_info = $lang['userlevel_spamking'];
        }

//--//

Then youll have to go to phpmyadmin into the prefix_users table und change the user_level id in this case to 3 (remember: define('SPAMKING', 3); )

Hope it works with your imagegallery too. For me it works, and I hope it does no harm to my gallery.

Waiting for your answers.
Ice

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD]Usertitles
« Reply #1 on: May 11, 2005, 12:03:50 AM »
be carefull with that. In some cases your "spamking" users will not be able access some sertain features if the script using this kind of check of user level:
if ($user_info['user_level'] == USER)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: [MOD]Usertitles
« Reply #2 on: May 11, 2005, 01:02:36 AM »
I don't understand the purpose of this code.   Why not just create a new user group called "spamking" and add members to the group???

Offline Ice

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD]Usertitles
« Reply #3 on: May 16, 2005, 09:29:42 PM »
mmh i tried so, but there was still the name members remaining und the username. So i had to change it in the code. If it was wrong, please correct me.

Offline Chris

  • 4images Moderator
  • 4images Guru
  • *****
  • Posts: 4.487
  • Did u ever stop to think and then forget to start?
    • View Profile
Re: [MOD]Usertitles
« Reply #4 on: May 17, 2005, 12:56:07 AM »
there was still the name members remaining und the username.

 :? I did not understand that either.  :?: :?: :?:

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: [MOD]Usertitles
« Reply #5 on: May 17, 2005, 01:31:58 AM »
they are talking about comments, where it sais "guest", "member" or "administrator" under the name of the comment poster.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Ice

  • Pre-Newbie
  • Posts: 3
    • View Profile
Re: [MOD]Usertitles
« Reply #6 on: May 23, 2005, 02:48:56 PM »
Yep i was talking about that.
So i suppose there is no other way of changing the usertitles.
Till now nothing was different to before for my users.

Offline beseech

  • Full Member
  • ***
  • Posts: 150
    • View Profile
Re: [MOD]Usertitles
« Reply #7 on: September 07, 2005, 10:17:49 PM »
And its possible show this on user profile (Admin,Member....etc ) ?????

TheOracle

  • Guest
Re: [MOD]Usertitles
« Reply #8 on: September 09, 2005, 12:30:47 AM »
And its possible show this on user profile (Admin,Member....etc ) ?????

Try the following. In member.php file,

find :

Quote

"lang_comments" => $lang['comments'],


add below :

Code: [Select]

"user_position" => ($user_row[$user_table_fields['user_level']] == SPAMKING) ? $lang['userlevel_spamking'] : "",


Then, in your templates/<your_template>/member_profile.html file,

add this tag :

Code: [Select]

{user_position}


where you want it to appear on your member's profile page. ;)

Offline beseech

  • Full Member
  • ***
  • Posts: 150
    • View Profile
Re: [MOD]Usertitles
« Reply #9 on: September 16, 2005, 10:00:04 PM »
this doesn't work....


on member profile  ??? :(

TheOracle

  • Guest
Re: [MOD]Usertitles
« Reply #10 on: September 16, 2005, 10:07:56 PM »
Quote

this doesn't work....


Could you please be more specific ?

Offline beseech

  • Full Member
  • ***
  • Posts: 150
    • View Profile
Re: [MOD]Usertitles
« Reply #11 on: September 17, 2005, 02:17:14 AM »
i've follow all steps ... but this not work, this isn't showing nothing in member profile ;)

TheOracle

  • Guest
Re: [MOD]Usertitles
« Reply #12 on: September 17, 2005, 02:19:32 AM »
Quote

this isn't showing nothing in member profile


Not even the phrase that points on the usertitle ?