View Full Version : Postbit_legacy: add image problem
pape sets fire
12-07-2012, 07:31 PM
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.
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
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
I guess you'd want something like:
<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:
<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
<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
Try it without the 'if', like this:
<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:
<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!
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
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.