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 08-13-2009, 03:34 PM
gorentals gorentals is offline
 
Join Date: May 2008
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Displaying Images in Profile Block instead of Text?

Lets say I have 3 Custom Fields. Game1, Game 2, Game 3

And I want my members to enter codes for each of the 3 games.
Anyone know how to accomplish this?
Reply With Quote
  #2  
Old 08-13-2009, 04:01 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think there is an article in the articles forums on how to add a block to the profile/member.php page. Have you looked there?
Reply With Quote
  #3  
Old 08-13-2009, 07:10 PM
gorentals gorentals is offline
 
Join Date: May 2008
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

THanks Lynne. I did find this https://vborg.vbsupport.ru/showthread.php?t=203775

I am able to create the fields, and the block, but I don't know the code on how to display images based on a field.

So lets say I have field 1: text (to be used as the alt text of graphic)

Then in profile Block I would like to display a graphic that represents Field 1.

Does this make sense to anyone?

Thanks for your time
Reply With Quote
  #4  
Old 08-13-2009, 07:18 PM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You can do it how I did mine and create an if conditional for each one by using a code like this...
HTML Code:
<if condition="$post[fieldxx]">
	<img src="$stylevar[imgdir_misc]/$post[fieldxx].gif" alt="" />
</if>
And change xx to your profile field number. You must also have the image named exactly how the profile field is written. For example, if you have an option that says "Marine Corps", you must name your image "Marine Corps.gif" or whatever extension you want to use (.gif, .png, etc.)

Hope that helps you out
Reply With Quote
  #5  
Old 08-13-2009, 08:42 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

See if what Brooks posted is what you wanted. You may want to add something in where it says alt="". Like alt="$post[fieldxx]" ? It's hard to tell without actual examples of what you will have in the fields.
Reply With Quote
  #6  
Old 08-13-2009, 11:50 PM
gorentals gorentals is offline
 
Join Date: May 2008
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you guys for helping me out. Here is my code in the Memberinfo Template at the bottom: I am also on Vbulletin 3.8.3

<div id="sidebar_container">
<!-- sidebar -->
$template_hook[profile_right_first]
$blocks[stats_mini]
<!--new block-->
<!-- $id -->
<div id="$id" class="tborder content_block">
<h4 class="thead block_title">
<a href="#top" class="collapse_gadget" onclick="return toggle_collapse('$id')"><img id="collapseimg_$id" src="$stylevar[imgdir_button]/collapse_generic{$vbcollapse['collapseimg_'.$id]}.gif" alt="" border="0" /></a>
<a name="$id"></a>
<span class="block_name">Codes</span>
</h4>
<div class="block_content" id="collapseobj_$id" style="{$vbcollapse['collapseobj_'.$id]}"><div class="alt1 smallfont block_row block_footer">
<if condition="$post[field15]">
<img src="$stylevar[imgdir_misc]/$post[field15].png" alt="$post[field15]" />
</if>

</div></div>
</div>
<!-- / $id -->
<!--new block-->


$template_hook[profile_right_mini]
$blocks[friends_mini]
$blocks[youtube]
$blocks[albums]
$template_hook[profile_right_album]
$blocks[groups]
$blocks[visitors]
$template_hook[profile_right_last]
<!-- / sidebar -->
</div>

<!-- end usercss -->
</div>

$footer

</body>
</html>

Ok I can see the Codes Block, but nothing shows. I have a Field called mk and its field15. What is entered in that field is just numbers. Is my code wrong? thanks for any assistance.
Reply With Quote
  #7  
Old 08-14-2009, 12:10 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The code you wrote is looking for image files named 2322.png or 222.png or whatever-the-number-is.png. If you always want it to show mk.png, then you need to change $post[field15].png to mk.png
Reply With Quote
  #8  
Old 08-14-2009, 12:49 AM
gorentals gorentals is offline
 
Join Date: May 2008
Posts: 89
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok I changed the code. No matter what I have in Field15 the graphic never shows up in my codes block. Is there something wrong with my block code? The field is just a single text field. Logically it looks like it should display the image. I am at a loss as to why nothing displays.
Reply With Quote
  #9  
Old 08-14-2009, 01:36 AM
HMBeaty's Avatar
HMBeaty HMBeaty is offline
 
Join Date: Sep 2005
Posts: 4,141
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by gorentals View Post
Ok I can see the Codes Block, but nothing shows. I have a Field called mk and its field15. What is entered in that field is just number codes like... 2322-2222-2223-2322. I also created a file called mk.png to show as the graphic in the block. Is my code wrong? thanks for any assistance.
If you have 2322-2222-2223-2322 entered in the field, your image needs to be named 2322-2222-2223-2322.png or .gif or whatever
Reply With Quote
  #10  
Old 08-14-2009, 01:37 AM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I should have noticed... you can't use $post right there, it's should be $userinfo.
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 12:36 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.04643 seconds
  • Memory Usage 2,256KB
  • 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
  • (1)bbcode_html
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete