Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 05-22-2013, 01:16 AM
dethfire dethfire is offline
 
Join Date: Feb 2003
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default conditional for member viewing to only see

I have a section in memberinfo that I want only the member of that profile to see. aka if I am viewing my profile, I want a section only I can see. What is that conditional? thanks!
Reply With Quote
  #2  
Old 05-22-2013, 02:11 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It would help to know what template you are adding this code to.
Reply With Quote
  #3  
Old 05-22-2013, 02:31 AM
dethfire dethfire is offline
 
Join Date: Feb 2003
Posts: 441
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

memberinfo

will this do?

<if condition="$bbuserinfo['userid'] == $userinfo['userid']">
Reply With Quote
  #4  
Old 05-22-2013, 03:50 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It should.
Reply With Quote
  #5  
Old 05-22-2013, 08:26 PM
snakes1100 snakes1100 is offline
 
Join Date: Dec 2001
Location: Michigan
Posts: 3,733
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

vb3 programming section Lynne
Reply With Quote
Благодарность от:
Lynne
  #6  
Old 05-22-2013, 09:21 PM
Xexiu Xexiu is offline
 
Join Date: May 2008
Location: Barcelona
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello Lynne.

That code worked for me. I added:

Code:
<if condition="$userinfo['userid'] == $bbuserinfo['userid']"></if>
And the "button" only showed for the user that was browsing. Now my question is:

How do I do this?

http://www.vbulletin.com/forum/forum...ms#post3971219
Reply With Quote
  #7  
Old 05-23-2013, 12:59 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You said you wanted to only show some code to the viewer if they are viewing their own profile, so doesn't that condition do that?

As for the code you linked to, you are getting the avatar for the viewer of the page, not the profile owner.
Reply With Quote
  #8  
Old 05-23-2013, 12:19 PM
Xexiu Xexiu is offline
 
Join Date: May 2008
Location: Barcelona
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

And whats the code to show the avatar for the profile owner?

I need something like this:

<if condition="$show['profile_owner']">
<img scr="url_to_avatar_of_profile_owner" /> // similar as the one I made $user_ava[0]
<else />
<img src="no_avatar.gif" />
</if>

I had tried "prepared[avatarurl] in <img src="prepared[avatarurl]" />, (other than $user_ava[0]") but doesn't work!

See example:

http://www.1st-hacks.com/members/prue.html

The avatar is shown correctly on ministats_block but not on profile (below the profile picture)!
Reply With Quote
  #9  
Old 05-23-2013, 07:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to use php, a plugin, to get the avatar based on who is viewing.

But I don't understand.... if you are the profile owner and viewing the page, you want to show the profile owners avatar, otherwise you want to show the no_avatar.gif - is that correct? If not, please write out your condition in a sentence like I just did.
Reply With Quote
  #10  
Old 05-24-2013, 12:47 AM
Xexiu Xexiu is offline
 
Join Date: May 2008
Location: Barcelona
Posts: 54
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok, let me explain myself. I have a plugin that shows avatar on all pages. The plugin is:

Code:
require_once('./includes/functions_user.php');
   $user_ava = fetch_avatar_url($vbulletin->userinfo['userid']);

if ($user_ava[0] == "")
  $user_ava[0] = "http://www.1st-hacks.com/images/as4/avatars/user.gif";
It uses $user_ava[0] to display the avatar. So <img src="$user_ava[0]" /> Show's the user avatar.

Ok, now here it the problem/question/issue! I had modified the memberinfo template to show an avatar 160x160 dimensions using $user_ava[0]. The good news: It shows up.

- Now here comes the bad news. The avatar is showing under the profile picture and shows the avatar of the current userid (user whom is browsing right now the forum - his/her avatar). Thats ok, if he browses his/her profile (his/her avatar will show up - ok).

- But when he goes to another profile (different than her/his profile), the avatar should be of that user/profile, not her/his (the one that browsing). By default it shows the avatar of the user bowsing on all pages. Don't know if you get me.

I need a conditional to say, something like:

If the actual user is browsing his/her profile, show her/his avatar. If he browses a different profile, show the avatar of that profile/user.


P.D. Does nothing to do with this thread, but whats the conditional "php" to show to userid? I know that the template conditional is: <if condition="$bbuserinfo['userid'] == 1"></if> // shows to ID 1 // But how do you do the same in php plugin?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:05 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.05867 seconds
  • Memory Usage 2,258KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete