vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   vb variable in phrase? (https://vborg.vbsupport.ru/showthread.php?t=219096)

doa24uk 07-21-2009 02:12 PM

vb variable in phrase?
 
Hi guys,

I'm trying to use a variable ... for the thread title in a phrase ...

Is this possible??

$threadinfo[title] - that's the var i'm trying to insert but it isn't outputting the thread title, it's outputting itself ....

Marco van Herwaarden 07-21-2009 02:27 PM

Please provide the code you are using.

doa24uk 07-21-2009 02:32 PM

Hi it's just the following in a phrase...


Code:

$threadinfo[title] from MySite.com
I've also tried -

Code:

Test - $vbphrase[$threadinfo[title]]
and

Code:

Test - {$threadindo['title']}

Lynne 07-21-2009 02:36 PM

This is done quite a bit in vb. If you look at how they do it, it's done something like this:
phrase = my_phrase:
HTML Code:

The title is {1}
Code in the template:
HTML Code:

<phrase 1=" $threadinfo[title]">$vbphrase[my_phrase]</phrase>

doa24uk 07-21-2009 07:17 PM

Hi Lynne,

I think we're getting closer but still nothing unfortunately!

I've created a new phrase and put this as the text

Code:

<phrase 99xsa=" $threadinfo[title]">$vbphrase[doa_thread_title]</phrase>
Code:

Varname - doa_thread_title
Then in the phrase where I wish to call the thread title

Code:

Test - {99xsa}

And that simply out puts

Code:

Test - {99xsa}
:( :(

So close yet so far!

Lynne 07-22-2009 01:59 AM

Reread my post. The phrase itself will have the {1} in it, not any variable. Then the other code is what you put in the template to call the phrase. Like I said, if you look at the templates, you will see this method used throughout.


All times are GMT. The time now is 11:48 PM.

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.01016 seconds
  • Memory Usage 1,717KB
  • 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
  • (7)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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