Helpful Information
 
 
Category: vBulletin 2.x Beta Releases
Custom User Status by Usergroup

I could not find a way to add an additional user status field based on usergroup other than setting a override, which got rid of the normal usertitle based on post count and I didn't want that. This is my solution.

This hack adds an additional field to the usergroup table and allows you to display that custom group status field in addition to the normal usertitle that is defined either custom for the user or normally by number of posts without overriding the usertitle variable.

The end result gives you something like this (depending on how you edit your postbit template) for the output:

Jen
Tyro Hacker
[Custom Group Status Here]
[Users Avatar]
[Users other details]

The custom group status is set within the cp from the user group modify function for each group you want to add this additional status field to.

Questions, Problems, etc.. ask here as I am unable to provide support via email.

# NOTE: This code has been added to the download file. If you have a copy of the file without the User Profile mods, these instructions are for you. Otherwise, use what's in the file.

If you want to add the new custom user status to the users profile here's the edits to do so (These should be all one line and are broken up here to keep the screen from scrolling):

Edit admin/functions.php
find:
if (!isset($usercache[$userid])) {
$usercache["$userid"]=$DB_site->query_first("
SELECT user.*,userfield.*
FROM user
LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='$userid'");

replace with:
if (!isset($usercache[$userid])) {
$usercache["$userid"]=$DB_site->query_first("
SELECT user.*,userfield.*, usergroup.groupcustomstats
FROM user
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid
LEFT JOIN userfield ON userfield.userid=user.userid WHERE user.userid='$userid'");


Then just add the following variable to your getinfo template as you want it to display.
$userinfo[groupcustomstatus]

I was thinking about something like this just last week. Good job :)

didn't work for me... :(

im going to try when i wake up later.

im preatty tired and watching mr. deeds

Mist: I think I figured out the problem.. a # character was right before the second replacement db query. I have fixed that in the file and it should install no problem now.

The hack code above is based on an un-hacked vB 2.2.6 install, but works wonderful with the Sig and Avatars by Usergroup (http://www.vbulletin.org/forum/showthread.php?s=&threadid=38952) hack.

I just tested the updated code on a fresh install of vB 2.2.6 and it worked perfectly.

The download file has been updated to include the steps to add the new Group Custom Status to the user's profile page.

If anyone has had any problems with this, please let me know. otherwise I'd like to move this up to a Final release.

Just wanted to say, it's a great hack! :D Installed it yesterday and it works perfectly! :D Thanks :).

Have you ran the query?

Satan










privacy (GDPR)