PDA

View Full Version : Looking for member name variable


setishock
10-17-2011, 09:51 AM
4.1.2 full suite
Treavor over at vb com said to post this here.
I found this really neat script on a site another member there mentioned in a thread. It's a javascript goody that puts a digital clock, full blown day and date, with a time of day greeting.
I parked it in the Welcome to the blah blah phrase translation box and after adding a br to the welcome, it works fine. Well, it needs some apperance tweaking. http://animeappeal.com/forum.php?styleid=93
My idea is to edit the welcome to the blah blah to welcome, member. But got snagged on what to put in to call the member by screen name. Would one of you coder types please point me to what I need to add to the phrase to make it work like I want it to?
Treavor also suggeted using this variable {vb:raw bbuserinfo.username} but all it does is print the var itself. How do I compose the phrase so that it shows Welcome, membername?

kh99
10-17-2011, 12:44 PM
So if I understand correctly, you want to modify some javascript that currently display "Welcome to the blah blah" to display "Welcome, member" like the vbulletin welcome message? Probably what you want to do is edit a template to insert some code that defines a javascript string variable with the message you want to display. You can steal the phrase out of the header template and use something like this:


<script type="text/javascript">
var welcome_message = '{vb:rawphrase welcome_x_link_y, {vb:raw bbuserinfo.username}, {vb:link member, {vb:raw bbuserinfo}}}';
</script>



then of course in the javascript you'd use welcome_message where you want the message.

setishock
10-17-2011, 03:48 PM
Close but no cigar. I want to edit the built in welcome to the blah blah phrase. The JS for the clock and all is independant of that.