View Full Version : [RELEASE] Custom User Titles
- Allow User to Change their titles if they are a Mod
- Allow User to Change their title based on how many posts they have
- Allow User to change their title based on how long they have been registered
- Limit length of text the user can enter
- Censor words that a user can use in their title (separate from the cuss word censor)
[I hope it all works ok as I flew through it and it seems to work on my board :) lemme know what is broke and I will fix it]
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
[Edited by rangersfan on 08-04-2000 at 01:30 PM]
um
what seems to be missing is the template for $customtext
it's called for several times in the code, but I don't see it anywhere.
I added this hack, couldn't figger out what was missing because it wouldn't show up and that seems to be what it is.
also, a coupla things in your instructions that don't seem to be quite right (or at least they are giving *me* trouble):
there are 2 calls to replace the same thing in both showthread.php and announcement.php
you seem to be missing the ">" that the end of the code to add in admin/options.php
Steps 3 and 8 in the member.php both ask for something to be added to "$DB_site->query("UPDATE user SET password". I can only find one instance of this in member.php so I assume both are added to that same instance. Does the order matter?
I think that about covers it. It's gonna be great once I can use it. Thank you for all the hard work :)
Oh yeah I said I did it fast and I was tired when I posted :( I did forget to inculde the template. oops.
Here is the template "customtext"
http://www.hedgehogwheels.com/customtext.txt
I have fixed the anomolies in the instructions.
The ">" was missing in options.php
Step 3 and Step 8 both refer to the same line and I put both changes in Step 3 and Deleted 8.
Second call to change showthread was a duplicate change, ignore it. The anouncement.php and forumdisplay.php changes are not correct. Verify yours and let me know if it works now?
absolutely perfect!
thanx for a great hack!
okay, one small thing that will apply to only certain people.
If you, like me, had the star ranks (or any other image code) set up in the user titles rather than by using the star hack that's buried deep in here somewhere, do NOT replace all the "$usertitle=$userinfo[usertitle];" strings in your files, elsewise any html you have in your user titles will be stripped, too.
The way I'm keeping bad code out is by changing the text box in the customtext template to accept a max of 25 characters.
As i said before, the stars in titles kinda has to leave.
If you dont put in the htmlspecialchars function people can still fit a <img src=> line in under 25 chars.
Originally posted by rangersfan
[usertext]
- See post below for the codeI think that you mean:
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Right?
You replied even before I have finished cutting and pasting the hack!
You could always add htmlspecialchars() when the user INSERTS the custom title, rather then waiting for it to be displayed. This would allow us admins to use HTML via the CP if we needed to. Or, you could add some sort of flag... (allowhtmlstatus)
Nice job on the hack though, saved me some time! :)
well, the 25 caharacters works great for me:)
<img src=http://www.m.com
that's 25 characters.
Originally posted by Stallion
You could always add htmlspecialchars() when the user INSERTS the custom title, rather then waiting for it to be displayed. This would allow us admins to use HTML via the CP if we needed to. Or, you could add some sort of flag... (allowhtmlstatus)
Nice job on the hack though, saved me some time! :)
Stallion yes you could do this but then that would be going against the way John handles the other fields, like "username" so I chose to try to be consistent. Doing that way means you wouldn't have to edit all the files also.
[Edited by rangersfan on 08-04-2000 at 04:26 PM]
damn it, there are SOO many hacks I want to install, but for some reason I've actually had a life this week, not sure how that happened, but it did. I WILL get these damned things in!
okay, how would I switch this line to an "or" instead of an "and" statement?
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
So you want it to be ok for a user to change their title if they have say 100 posts or they have been registered 30 days but may have only 1 post?
Code:
---------------
Code is only visible to licensed users, and only when logged into the forums.
---------------
Just change the '&&' to a '||'
in php you can actually use th word 'and' if you want but I stick to C style..
actually, I was thinking 1000 posts or 365 days
I have a lot of very active posters and a lot who read everything but post infrequently.
They are as valued as members as the ones who post like the board will die tomorrow:)
what part of code did i obviously forget to put in.I mean it doesn't remember the custom user title when i set it,so obviously it doesn't display it eather.It still shows the default one :)
You need to look at all the code that gets added to member.php and verify that it is correct.
that's where i screwed up
thnk you :)
vBulletin® v3.6.12, Copyright ©2000-2012, Jelsoft Enterprises Ltd.