vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Is he/she is my buddy? (Template conditional) (https://vborg.vbsupport.ru/showthread.php?t=117767)

NonCompare 06-06-2006 03:38 AM

Is he/she is my buddy? (Template conditional)
 
How to make a conditional if the user viewing my profile is my buddy or not?

Any help is greatly appreciated.

nicholas 06-07-2006 03:31 AM

*bump

OK, I really get stuck with this. So far this is what I have tried. On member.php, I add the following code:
PHP Code:

// set-up for buddylist conditional - profile view
$mybuddies explode(' '$userinfo['buddylist']);
if(
in_array($bbuserinfo['userid'], $mybuddies))
{
    
$isbuddy true;
}
else
{
    
$isbuddy false;


and on MEMBERINFO template, I test it
HTML Code:

<if condition="$isbuddy">
        I'm on $userinfo[username]'s buddy list.
<else />
        I'm not on $userinfo[username]'s buddy list
</if>

Unfortunately, I have no luck to get it working. I really need your help on this, please...

Freesteyelz 06-07-2006 09:20 AM

See if this link helps.

nicholas 06-08-2006 08:24 AM

Ok, I've figure it out. On member.php, add
PHP Code:

$mybuddies explode(' 'trim($userinfo['buddylist'])); 

and on MEMBERINFO template,
HTML Code:

<if condition="in_array($bbuserinfo['userid'], $mybuddies)">
I'm one of his buddy
<else />
I'm not his buddy
</if>

Just wondering, why is it that if I put the in_array() conditional on member.php it doesn't work?


All times are GMT. The time now is 01:32 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.00946 seconds
  • Memory Usage 1,724KB
  • 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_html_printable
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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