The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Converting username text to url
I created a function I was wondering if I could have someone look it over. It pretty much takes the text in a post and looks for a username, and if there is one, it will mark it up as url and usergroup color. Anyway heres the code.
PHP Code:
|
#2
|
||||
|
||||
That will potentially fail miserably on a forum with a lot of users. There is really no practical way to do this on a large scale.
|
#3
|
|||
|
|||
Is there anyway to do this by using a bbcode?
|
#4
|
||||
|
||||
You could create bbcode for your users to use:
HTML Code:
<a href="/forums/member.php?username={param}">{param}</a> |
#5
|
|||
|
|||
Also any chance that would be able to mark it up to the usergroup color?
|
#6
|
||||
|
||||
What I wrote is just a simple bbcode to do the username. If you want the usergroup color, you'd have to write some actual code to get it.
|
#7
|
|||
|
|||
just one more question.... to do the color, the code I would create, would I put the code in the replacement box or would I have to create a function or hook? I know you can only use html in the replacement box so I guess I couldn't use any variables correct?
Sorry im a noob. I just don't know how the whole bbcode replacement box works for vbulletin. |
#8
|
||||
|
||||
You would have to write a plugin, I believe. I've never done anything with the bbcode, so I'm not exactly sure how you would go about it. I've seen threads here about it though, so just do a search and you should find some info.
|
#9
|
|||
|
|||
Please tell me I'm close:
PHP Code:
Keep getting this in my shoutbox: Code:
Parse error: parse error, unexpected $end in W:\Forums\includes\class_bbcode.php(360) : eval()'d code on line 33 Parse error: parse error, unexpected $end in W:\Forums\includes\class_bbcode.php(360) : eval()'d code on line 33 Parse error: parse error, unexpected $end in W:\Forums\includes\class_bbcode.php(360) : eval()'d code on line 33 PHP Code:
|
#10
|
||||
|
||||
I don't know if it's correct or not, but I do see that you have three beginning and two end parenthesis in the first code box you posted and that will cause an error (they don't add up correctly).
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|