vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Postbit_legacy: add image problem (https://vborg.vbsupport.ru/showthread.php?t=292757)

pape sets fire 12-07-2012 07:31 PM

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.

kh99 12-07-2012 07:42 PM

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?

pape sets fire 12-07-2012 07:52 PM

Quote:

Originally Posted by kh99 (Post 2389161)
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

kh99 12-07-2012 07:57 PM

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>

pape sets fire 12-07-2012 08:16 PM

Quote:

Originally Posted by kh99 (Post 2389163)
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

kh99 12-07-2012 08:19 PM

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.

leejohn02 12-08-2012 12:15 PM

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

pape sets fire 12-08-2012 07:37 PM

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!

kh99 12-08-2012 08:25 PM

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). :o


All times are GMT. The time now is 10:53 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.01143 seconds
  • Memory Usage 1,734KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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