![]() |
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. |
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/showthrea...threadid=34968 |
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. |
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. |
i shall install....SOON
|
Quote:
|
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. |
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. :)
|
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 |
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.
|
and how would i do that?
|
PHP Code:
|
hmmm, i tried that, but it only showed the code, not the image
|
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. |
Thanks Jen ^_^
|
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.
PHP Code:
|
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" Code:
mysql error: Column count doesn't match value count at row 1 |
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 ^_^
|
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 |
Quote:
I had stars on mine and cannot get mine to work... I think the stars is the problem... |
What does this mean?
Quote:
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 :( |
You must have forgotten to run at least 1 of the queries. Run it again. :)
|
excellent hack!
just installed it on ver 2.2.9 |
Can someone post instructions to get the custom title to show up in private messages please!
|
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. |
bump
|
Quote:
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 |
does anyone have the status titles working in PM's & global announcements?
|
I too would like to know how to expand this hack to Private Messages.
Also interested in the membership system :) |
Well, if this isn't set would it hide the space?
|
A few weeks ago I spoke with Jen via e-mail and she said she would work on this....:confused:
|
All times are GMT. The time now is 06:43 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|