View Full Version : Custom User Status by Usergroup [Final]
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. This hack has been tested on vB 2.2.6.
Here's a preview of how this hack is used and displays on my board.
For those wondering why you would want such a hack.. I use it for the paid memberships system that I wrote to work with vBulletin. I don't require membership to view/use the board, but do accept contributions towards site operating costs. This hack was part of the solution to adding that membership system and giving users 'status' based on their contributions to the site.
Velocd
07-16-2002, 07:54 PM
There is another hack similar to this made by JJR512, although his uses a custom field other than creating a new table. I'm not sure if his is all that similar in code, but they seem to do the same thing.
Reference:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=34968
Dean C
07-16-2002, 08:17 PM
great hack...
Actually, they are quite different:
"Basically, all it does is show both a custom title, selected by the user, and the user's standard title"
This hack keys the custom title off of the users usergroup and it is only configurable thru the admin and can't be set by the user.
The other hack allows the user to set their custom title and has nothing at all to do with the user groups that the user is assigned to.
CeleronXL
07-16-2002, 11:43 PM
Nice hack, but are you sure it hasn't been done before? Because at a forum I go to they've had a userselectable field, and then another field just like this and it's been there for a while. Only the admins get the second field, however, and they put stuff like "Coolness Admin, Cheese Eating Admin" and stupid stuff like that ;). But was this made before? I don't think the site creator is good enough with PHP to make his own. ;)
I do not believe that this hack has been done before (keyed off usergroup like this).
I searched the forums extensively before I wrote it, I found some similar, but none that did exactly what I was trying to do: Assign a custom title to each user within a specific user group and still keep the posters standard post count based user title. I suppose it could have been done (as has been done previously) with a 'hidden' user profile field that the admin sets, but I didn't want the hastle of setting this user field and like the ability to see who my contributing members are (and at what level) based on their usergroup.
My reason for needing this was to implement my paid membership system which has 5 different levels above standard member (Contributor, Bronze, Silver, Gold, Platinum) each based on the amount of $ sent in by the user and each getting a custom 'group' title in addition to their normal user title. The entire system is automated so all I have to do is enter the funds as they are received and the rest is handled within my membership system / vBulletin. The custom status is assigned as soon as the member is switched to a contributor user group.
And for those wondering, yes, I have a fully working and operational membership system tied into vB that tracks money sent in, expiration dates, totals, membership status, limits avatar dimensions and display based on usergroup (another reason for this hack), the whole nine yards, and it's completely automated once I enter the funds into the system. It took three existing hacks, this hack and two other hacks I wrote but have not yet published to create.
ZiRu$
07-17-2002, 02:37 AM
i shall install....SOON
Originally posted by Velocd
There is another hack similar to this made by JJR512, although his uses a custom field other than creating a new table. I'm not sure if his is all that similar in code, but they seem to do the same thing.
Reference:
https://vborg.vbsupport.ru/showthread.php?s=&threadid=34968
I would have to say this would be better to use since it doesnt require another table for such a small thing.
There's no extra table created, only a modification to the usergroup table to add an extra field which contains the custom usergroup title if you want to use one.
The two hacks are different. This one is set by the admin and sets a custom usergroup title based on what usergroup the user is in. This is usefull if you want every member of that usergroup to have the same custom title and yet still keep the original user title based on post count.
The other hack referenced adds an additional profile field that allows the USER to set their own custom title in addition to their title based on post count.
If you want to allow the users to set their own custom titles or if you want to use the admin to set a custom title for individual users, then the other hack is probably what you want. If you want to set a custom title for all users within a specific usergroup and not override their user title, then this is the hack to use.
Basically, two differing ways of doing the same thing, just depends on what you're trying to do and how you want to control it.
JJR512
07-18-2002, 01:38 AM
I've read the explanation of what this hack does, and although both our hacks involve custom titles, I believe that how the custom titles are assigned, and the purposes behind the custom titles, are different enough that there is no reason for any concern. Thanks for thinking of me, Velocd, and thanks for the PM, Jen. :)
Chris M
07-18-2002, 10:13 AM
JJR512's hacks can actually be used in the same way as this - All you have to do is set it editable by user to no, and bingo!
I know its not Usergroup based, but still similar...
Satan
Allstar DC
08-21-2002, 03:48 AM
is it possible to let it show an image instead of text???
While I haven't tested this, you should be able to just add standard html IMG tags to the custom status field to show an image for every user of a particular usergroup.
Allstar DC
08-21-2002, 10:22 PM
and how would i do that?
<IMG SRC="http://www.yourhost.com/yourimage.gif">
Using the standard HTML syntax for adding images. Just use an IMG tag inside the field and you'll be adding that image as the custom group title to each user within that usergroup.
Allstar DC
08-28-2002, 06:10 AM
hmmm, i tried that, but it only showed the code, not the image
FASherman
08-28-2002, 01:56 PM
Regarding custom user titles by user group...
Why not add a second field to the usertitle table for usergroupid? Then, in member.php, newreply.php, and newthread.php change the select statement for user title from "...WHERE minposts <= $bbuserinfo[posts]..." to ""...WHERE minposts <= $bbuserinfo[posts] AND usergroupid=$bbuserinfo[usergroupid]..."
There will also have to be some updates select statements in admin programs, leaving the bulk of the work in usertitle.php
Just an idea if someone is filling to run with it...
This isnt working for me .. I have stars installed could that be causing a problem?
Elly: I'll install Stars on this end and see if there's something that isn't working between the two. Right now I'm not sure if there are any conflicts.
Allstar: I found the problem and will post code tomorrow for you.
Allstar DC
09-14-2002, 08:25 AM
any updates yet?
My apologies, I've been very busy the past week or so and haven't had time to look into these two issues.
I will work on them over the weekend and have a fix on the image issue and verify if there are conflicts with the other hack.
I tested the hack for using an image as the group custom status and had no problems using the standard HTML IMG tag to reference the image to be used.
<IMG SRC="http://www.yourhost.com/yourimage.gif">
The standard HTML tag did work without problem. If it is not working for you please post some more information on exactly what behavior you are getting as well as what code you are using to display your image etc.
Allstar DC
09-15-2002, 04:38 AM
i got the image working now, but for some reason i now get an error when tying to add or modify a usergroup.
i received the following error when trying to add a new usergroup"
mysql error: Column count doesn't match value count at row 1
mysql error number: 1136
Found the conflict with the Stars hack.
The database changes for Stars in admin/usergroup.php also occur with this hack and it's likely something was left out or changed improperly which is causing the conflict. I'll post an update to the sql for users who have Stars shortly.
Thank you very much Jen ^_^
Allstar DC
09-27-2002, 06:37 AM
sorry for not replying, but i was on a short vacation
my errors are fixed, it had nothing to do with this hack, my database just got screwed up a lil.
about the stars, i have them installed too, but don't have anyprobs with it
JeffyJoe
11-12-2002, 11:41 PM
Originally posted by Jen
Found the conflict with the Stars hack.
The database changes for Stars in admin/usergroup.php also occur with this hack and it's likely something was left out or changed improperly which is causing the conflict. I'll post an update to the sql for users who have Stars shortly.
Jen, Have you updated the sql yet?
I had stars on mine and cannot get mine to work... I think the stars is the problem...
JeffyJoe
11-18-2002, 06:36 PM
What does this mean?
Database error in vBulletin 2.2.8:
Invalid SQL:
SELECT
post.*,usergroup.groupcustomstatus,post.username AS postusername,post.ipaddress AS ip,user.*,userfield.*,icon.title as icontitle,icon.iconpath,
attachment.attachmentid,attachment.filename,attach ment.visible AS attachmentvisible,attachment.counter
,avatar.avatarpath,NOT ISNULL(customavatar.avatardata) AS hascustomavatar,customavatar.dateline AS avatardateline
FROM post
LEFT JOIN icon ON icon.iconid=post.iconid
LEFT JOIN user ON user.userid=post.userid
LEFT JOIN userfield ON userfield.userid=user.userid
LEFT JOIN avatar ON avatar.avatarid=user.avatarid
LEFT JOIN customavatar ON customavatar.userid=user.userid
LEFT JOIN usergroup ON usergroup.usergroupid=user.usergroupid
LEFT JOIN attachment ON attachment.attachmentid=post.attachmentid
WHERE post.postid IN (0,2163,2198,2199,2202,2205,2396)
ORDER BY dateline
mysql error: Unknown column 'usergroup.groupcustomstatus' in 'field list'
mysql error number: 1054
Date: Monday 18th of November 2002 03:32:34 PM
Script: http://www.mysite.com/chat/chat/showthread.php?s=&threadid=392
Referer: http://www.mysite.com/chat/forumdisplay.php?s=&forumid=5
Specifically what does "mysql error: Unknown column 'usergroup.groupcustomstatus' in 'field list' " mean
(I have been screwing with this for a few weeks now and can't figure it out... considering hiring someone to fix this :(
Link14716
11-18-2002, 09:22 PM
You must have forgotten to run at least 1 of the queries. Run it again. :)
Prince
11-20-2002, 09:44 PM
excellent hack!
just installed it on ver 2.2.9
Prince
11-21-2002, 05:10 PM
Can someone post instructions to get the custom title to show up in private messages please!
Prince
11-21-2002, 05:57 PM
btw, I tried the obvious:
adding $post[groupcustomstatus] to the privmsg template, but that did not work, I also tried adding $userinfo[groupcustomstatus] with no luck.
Prince
11-25-2002, 03:21 AM
bump
matthew tucker
12-06-2002, 10:53 AM
Originally posted by Jen
And for those wondering, yes, I have a fully working and operational membership system tied into vB that tracks money sent in, expiration dates, totals, membership status, limits avatar dimensions and display based on usergroup (another reason for this hack), the whole nine yards, and it's completely automated once I enter the funds into the system. It took three existing hacks, this hack and two other hacks I wrote but have not yet published to create. [/B]
Umm, so ... are you ever gong to publish this? have you already??
I'm thinkin along similar lines but i don't want to reinvent the wheel.
I like this hack though, I will use it.
Matthew
Prince
12-06-2002, 02:04 PM
does anyone have the status titles working in PM's & global announcements?
Figment
12-19-2002, 10:15 PM
I too would like to know how to expand this hack to Private Messages.
Also interested in the membership system :)
LOD-squa
12-20-2002, 05:51 PM
Well, if this isn't set would it hide the space?
Prince
12-20-2002, 06:33 PM
A few weeks ago I spoke with Jen via e-mail and she said she would work on this....:confused:
Phat Papa Pete
12-21-2002, 11:50 PM
Hey Jen, I've installed this hack on vB 2.2.9 and it works a gem! The only problem is that my Quick Reply has disappeared and I'm pretty sure it's because of your hack. Do you know how I can get it back?
Phat Papa Pete
12-22-2002, 12:12 AM
It's okay. I was just being stupid. I edited a fresh "showthread.php" script which didn't have the 'Quick Reply' hack in it (obviously). It's all fine and dandy now. :)
Logikos
02-13-2003, 06:55 PM
how do i make it so me as the owner says President, but just me only. i dont want to make a new user group for my self, and if this worked in pms and announcments that wouuld be great. I think you would have to add some to phpinclude, though i could be wrong
[]\[]emesis: That is easily done just by editing your own user profile in the admin to use a custom user title. You could of course use another usergroup, it all depends on exactly what you are trying to accomplish and if it came be done either by editing your own profile or not.
I apologize for not getting everything updated as requested / promised. Things have been hectic the past few months and I have not had as much time as I would like to put into this and other such endeavors.
I have not tested this with the Quick Reply Hack. Most other issues are resolved simply by verifying that you haven't overwritten changes made to the SQL queries that those hacks also modified.
I will post an update asap with the hack updated to show in PMs, user profiles, etc. I need to do this for my board as well so this is definitely a priority.
Logikos
02-14-2003, 09:43 AM
well thats just the thing, im the owner of my site and im in the admin usergroup and i already have something set for admins, but i dont want to make a new user group for it to say something new.
Logikos
03-17-2003, 09:32 AM
No updates?
Sacrifice
08-17-2003, 08:17 AM
hey, is it possible to make it so that a mod/smod/admin can change there own and not change the whole thing?
Eg.
[name]
[custom usertitle]
[custom group title (mods/smods/admins only)]
brownafroduck
06-27-2004, 01:20 AM
Wow this is great! It was a bit hard to understand what I was doing at first, but now I have it running perfectly! This is exactly what I was looking for!
*clicks install*
Thanks brownafroduck!!
Remember, 99.9% of the problems people have reported are as a result of OTHER hacks that modify the same SQL queries as my hack. If you have problems installing this hack then odds are that you installed another hack that modified the same SQL queries and then overwrote those changes with these. Check the SQL if you have problems! (I haven't verified the original SQL, but don't believe any of my previously installed hacks modified the original vb SQL's modified by this hack, if I'm wrong, please let me know so I can update the instructions as needed).
brownafroduck
06-30-2004, 04:52 PM
I was reading through this thread, and people seem to think this is the same as other hacks but it isn't.
I have a usergroup system were people are randomly put into a usergroup which determines their access to a certain forum. However, I still wanted to have another status based on their post count to show how powerful they were. The other hack doesn't do that. I wanted a usergroup and userstatus fields, not a userstatus field and custom field. In fact, I haven't seen a single other hack that can do that which is why I am very pleased with this hack.
brownafroduck
06-30-2004, 10:49 PM
Question: what would I put in the template of privmsg in order to get the custom user status show up?
I've tried $fromuserinfo[groupcustomstatus], $post[groupcustomstatus], and many other things in hopes of finding something, but truthfully I have no idea what I am doing ;)
That's something I haven't gotten around to doing yet but will likely involve a change to some SQL to get the user status field accessable on the privmsg pages.
brownafroduck
07-01-2004, 08:09 AM
Okay :) Well it isn't that important, but I would be sooo grateful if you got the chance to do it.
Pixelgrounds
07-04-2004, 04:11 AM
will this hack work in vB3.0.02?
brownafroduck
07-07-2004, 12:47 AM
I wouldn't know because I haven't tried, but I seriously doubt it. The file edits wouldn't be the same... You'd REALLY have to know what you were doing to try it.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.