The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Calling out users in thread titles/announcements
I want to announce some features to my member and was wondering how i could do something like:
"Hey ____! Are you on the member map?" With the blank being their username to catch their attention. I thought i could do it using the vbulletin phrases and did "Hey $username! Are you on the member map?" but i got exactly that. Could you guys let me know the proper way to do this? Thanks in advance, -Ryan |
#2
|
|||
|
|||
I doubt you can actually set it in a thread title, since they are stored as in the database and not parsed by any sort of code. There are a number of ways that you may be able to do this, one option would be to:
|
#3
|
|||
|
|||
Unduly complex.....there *is* a way to do it easily with a plugin.
*This code is NOT my own, it is posted elsewhere on vbulletin.org, but I have not managed to find it again. Create a new plugin as follows: Product: vBulletin Hook Location: global_complete Title: Whatever you want to call it Code:
$output = str_replace('[username]', $vbulletin->userinfo['username'], $output); |
#4
|
|||
|
|||
Won't that also leave it open for people to use wherever they please? For example signatures/posts/threads. I know there isn't much harm in letting other people use the markup but I'd think it would be better to restrict it somewhat.
|
#5
|
|||
|
|||
Yes, that is true, it works anywhere and for anyone.
I daresay there will be ways of easily adapting that code to work only in specific circumstances, but I'm no coder so I can't do that. Of course, other users would need to know the code that generates it, and you can easily amend it from [username] to something completely different just by changing the code I posted. I used it on my forums a couple of times as a complete joke. It's quite tricky for an average user to suss it out, as it doesn't even show the tag if you quote or edit something. Nobody from my site sussed it, although I cannot say how much anyone was really that bothered! |
#6
|
|||
|
|||
Thanks guys for your responses. I went ahead and used your method Mark B because it was the simplest and did the job, but thanks anyways Osperty. Thanks for helping me out, that did the job perfectly in both announcements and thread titles.
Osperty does bring up an important point that this feature can now be utilized by everyone on your board. I personally am not worried about it because my board is an owners club for a specific boat brand and most of them have had troubles just figuring out how to add photos to the gallery let alone figuring this out. Thanks guys! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|