vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Defining a Variable in a Phrase using php (https://vborg.vbsupport.ru/showthread.php?t=222116)

sparklywater 08-30-2009 05:54 PM

Defining a Variable in a Phrase using php
 
I have a plugin which has this code:

PHP Code:

standard_error(fetch_error("fd_thisacct_is_deleted"$userinfo['username'], $userinfo['userid'])); 


fd_thisacct_is_deleted is the name of a phrase.

I want to define a variable in this phrase so that when it is called from the standard_error template, it will be able to output the variables. For example I want to define the phrase like this: <phrase 1=" $threadinfo[title]">$vbphrase[fd_thisacct_is_deleted]</phrase>

My question is, where and how can I define this phrase like that so that the variables are output only when the phrase is called?

Lynne 08-30-2009 06:01 PM

What is the content of the phrase? You should jsut have to put {1} and {2} in the places you want those two variables to display.

sparklywater 08-30-2009 06:15 PM

I can put {1} in the phrase, but I still haven't placed the <phrase 1="xx"> attribute anywhere, because it's to be placed in the standard_error template as defined by the plugin. I don't know how to modify the following plugin code to include the <phrase 1="xx"> tag:

PHP Code:

standard_error(fetch_error("fd_thisacct_is_deleted"$userinfo['username'], $userinfo['userid'])); 


Lynne 08-30-2009 07:19 PM

I don't understand... you *have* the two attributes being passed - $userinfo['username'] and $userinfo['userid'] (assuming you used valid variables, that is). So, what else are you trying to do? (Did you look this function up in the API?)

sparklywater 08-30-2009 09:06 PM

What I'm trying to do is add 2 more variables in addition to the existing 2 variables. In that case can I just add the 2 variables using commas within the function?

--------------- Added [DATE]1251670269[/DATE] at [TIME]1251670269[/TIME] ---------------

ok i found my answer here: http://members.vbulletin.com/api/vBu...ionfetch_error

Thanks.


All times are GMT. The time now is 12:03 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.01669 seconds
  • Memory Usage 1,723KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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