vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Can anyone explain {1} (https://vborg.vbsupport.ru/showthread.php?t=106632)

chrisrixon 01-29-2006 04:01 PM

Can anyone explain {1}
 
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

Quote:

Originally Posted by Xenon
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?


All times are GMT. The time now is 08:37 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01324 seconds
  • Memory Usage 1,719KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete