vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   vb:if to if (https://vborg.vbsupport.ru/showthread.php?t=269991)

Scanu 09-09-2011 03:12 PM

vb:if to if
 
Hi :9 i have this code on the header (THAT WORK)
PHP Code:

<vb:if condition="$bbuserinfo['field5']">
<
vb:else />
test
</vb:if> 

so i want to do a plugin and i write
PHP Code:

    <hookname>global_start</hookname>
            <
phpcode>
    <![
CDATA[
if (
$bbuserinfo['field5'])
{}
else {
$template_hook['header_userinfo'] .= 'test';
}
]]>
</
phpcode

But doesn't work, someone can help me?

kh99 09-09-2011 03:17 PM

You want

PHP Code:

if ($vbulletin->userinfo['field5']) 


Scanu 09-09-2011 03:21 PM

Oh thank you :) I will try it

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

kh99 thank you so much this work perfectly

Scanu 09-11-2011 09:16 AM

And if i want more fields? Would be
PHP Code:

if ($vbulletin->userinfo['field5,field6']) 
or
if (
$vbulletin->userinfo['field5,6']) 


Paul M 09-11-2011 10:24 AM

Neither, you have to specify each one fully and individually.
PHP Code:

if ($vbulletin->userinfo['field5'] OR $vbulletin->userinfo['field6']) 


Scanu 09-11-2011 11:23 AM

ok thank you Paul i have just another question how do i get it work this type of phrase "Custom Profile Fields" anywhere (for example field1_ title)

BirdOPrey5 09-11-2011 01:56 PM

Quote:

Originally Posted by Tecnowii (Post 2244556)
ok thank you Paul i have just another question how do i get it work this type of phrase "Custom Profile Fields" anywhere (for example field1_ title)

There is no built it means to get the title of a custom field. You would have to make a new query (or modify an existing one I suppose) to get that info.

Scanu 09-11-2011 02:23 PM

I don't know.. If i go in custom profile field under the name of my custom field "Translations" i click on it and there is a phrase "$vbphrase[field1_title]" with the same text of the title

BirdOPrey5 09-11-2011 03:42 PM

Quote:

Originally Posted by Tecnowii (Post 2244591)
I don't know.. If i go in custom profile field under the name of my custom field "Translations" i click on it and there is a phrase "$vbphrase[field1_title]" with the same text of the title

That's a good pint, I wasn't even thinking of a phrase... I was just thinking as a variable. It has to be a phrase, you're right.

Scanu 09-11-2011 04:22 PM

the problem is that seems don't work


All times are GMT. The time now is 01:08 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.00999 seconds
  • Memory Usage 1,735KB
  • 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
  • (5)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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