View Full Version : Can anyone explain {1}
chrisrixon
01-29-2006, 04:01 PM
Can anyone explain the {1} that appears in strings, for example:
unread_x_nav "Unread {1}"
I looked at the code and gets fed into a sprintf so I would have thought %s or %d etc would make more sense? :ermm:
Xenon
01-29-2006, 04:28 PM
well, but it'S possible that phrases have more than one variable, so {1} stands for the first parameter, {2} for the second...
chrisrixon
01-29-2006, 04:51 PM
Yes I agree with that, but I don't see how sprintf knows {1} means 1st variable. I thought it expected things like %s, %d etc :nervous:
Xenon
01-29-2006, 04:59 PM
ah, now i see what you mean, hmm, don't see it right now as well
oops ^^
tehste
01-29-2006, 05:13 PM
ah, now i see what you mean, hmm, don't see it right now as well
oops ^^
its probably because vb developers thought {1} and {2} would make more sense to end users...
akanevsky
01-29-2006, 06:11 PM
As far as I can judge, {1}, {2} etc. is just a nice and friendly user end thingy. In the $vbphrase array, these get replaced with % equivalents.
Andreas
01-29-2006, 06:45 PM
build_language() converts the bracevars into the necessary %x$s stuff
chrisrixon
01-30-2006, 08:07 AM
Ahhh, thanks for that. Somehow that spurred me on to complete my hack.
My hack is to make the Unread after Private messages red but only if there are unread messages:
http://www.xatquiz.com/img/unread.gif
Being a bit of a newbie is this 1 line hack worth posting and if so where is the best place?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.