PDA

View Full Version : use vbphrase with arguments in php code


aminp30
05-11-2016, 02:44 AM
Hi
how can I use phrases with argument in php code?
for example this is a phrase defined in vb: by_x_in_forum_y
this phrase has two argument
how can I define this two arg. in php

MarkFL
05-11-2016, 03:29 AM
You need to use the "construct_phrase()" function. For example, in one of my products, I have the phrase "markfl_tppf_blocktitle" which is defined as:

Top {1} Thread Starters For "{2}"

I then use the PHP code:

$markfl_tppf_title = construct_phrase($vbphrase['markfl_tppf_blocktitle'], $user_count, $foruminfo['title_clean']);

to construct the phrase with its parameters, and store the resulting string in a variable, which I then pass to my custom template. :)

aminp30
05-11-2016, 04:01 AM
thank you so much
it worked as I expected

MarkFL
05-11-2016, 04:05 AM
Glad to help! :D

To me that is somewhat simpler than passing the parameters to the template, and then having vB construct the phrase there.

aminp30
05-11-2016, 04:47 AM
I'm not comfortable with template and also I'm beginner as you know. :D
I have to learn and search more about coding in vb