Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
  #1  
Old 12-07-2012, 07:31 PM
pape sets fire pape sets fire is offline
 
Join Date: Nov 2012
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Postbit_legacy: add image problem

Hello, I have a problem and if anyone can help I would be grateful.

I add in my postbit a field image.
From the admin panel and I created the field with the list of all the images I uploaded to my ftp, as they are spelled correctly.

what I need is to know what the codes that I have to add in my postbit_legacy (I'm using that of Etiket) since I can not get it working to display images that each user selects.


grateful if you can help me.
Reply With Quote
  #2  
Old 12-07-2012, 07:42 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

So you have added a custom profile field for a user to select an image, and now you want the code to display the image? What are the values of your profile field, are they file names? And where are the images on your server?
Reply With Quote
  #3  
Old 12-07-2012, 07:52 PM
pape sets fire pape sets fire is offline
 
Join Date: Nov 2012
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
So you have added a custom profile field for a user to select an image, and now you want the code to display the image? What are the values of your profile field, are they file names? And where are the images on your server?
the profile field is: field10
the names of the files are written with the same name that were uploaded to the server.
inside the server are in: public_html/foro/images/misc/equipos

thanks a lot for responding
Reply With Quote
  #4  
Old 12-07-2012, 07:57 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I guess you'd want something like:

Code:
<img src="images/misc/equipos/{post.field10}">

and maybe something after {vb:raw post.field10}, like .jpg or .gif if you need it.

Also if there's a possibility that a user hasn't chosen any image, you might want to check for it, like:

Code:
<vb:if condition="$post[field10]"><img src="images/misc/equipos/{vb:raw post.field10}"></vb:if>
Reply With Quote
  #5  
Old 12-07-2012, 08:16 PM
pape sets fire pape sets fire is offline
 
Join Date: Nov 2012
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by kh99 View Post
Code:
<vb:if condition="$post[field10]"><img src="images/misc/equipos/{post.field10}"></vb:if>
I tried this code but it worked for me, still do not see anything. driving me crazy
Reply With Quote
  #6  
Old 12-07-2012, 08:19 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Try it without the 'if', like this:

Code:
<img src="images/misc/equipos/{vb:raw post.field10}">


Then view the html source of your page and see what's there.
Reply With Quote
  #7  
Old 12-08-2012, 12:15 PM
leejohn02 leejohn02 is offline
 
Join Date: Apr 2011
Posts: 90
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

can you give me and link to the site, and what are the image names, it should be an easy fix, also check the images to make sure they all end in the same extension for example they should all be jpg or png or gif, not a mix of all the different ones
Reply With Quote
  #8  
Old 12-08-2012, 07:37 PM
pape sets fire pape sets fire is offline
 
Join Date: Nov 2012
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have finally been able to solve the problem! It took a while to see what the problem was because in the html view pictures loaded even though they were properly uploaded and named.

Finally the line has been as follows:

PHP Code:
<center
          <
vb:if condition="$post['field10']">
          <
img src="{vb:stylevar imgdir_misc}/equipos/{vb:raw post.field10}" align="center" alt="{vb:raw post.field10}" border="" /></vb:if>
          </
center

Maybe it is not spelled correctly but it works, recently I'm starting with this and I'm doing my best, and I'm starting a forum from the start.

I am very grateful that I have helped!
Reply With Quote
  #9  
Old 12-08-2012, 08:25 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for posting the update. And sorry I misled you with a basic mistake in my previous posts (which I corrected above to avoid misleading anyone in the future).
Reply With Quote
Reply

Thread Tools
Display Modes

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 11:22 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04484 seconds
  • Memory Usage 2,239KB
  • Queries Executed 11 (?)
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
  • (4)bbcode_code
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)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_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
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete