Helpful Information
 
 
Category: vBulletin 3 Discussion
Sourcing images in VB sometimes not right...

Okay - Here's what I'm trying to fix.

My site is strictly https driven, and it's driven as 2 different domain names pointing to the same codebase.

When I look in my browser and have it display the rendered HTML source, MOST of the images that are rendered are done so with an appropriate "src=/images/image.gif".

HOWEVER, there are places either in the code, or in the templates where the !@#$%^ images are being rendered using the complete URL, NOT a virtual one, (e.g. src=http://site.com/images/image.gif"), and it's causing me some irritating issues. Almost like it's prepending the entire homepage name as a literal to the image!

Could someone please tell me what the variable name or reference is in the templates and code that is causing this so I can search the occurrences out, and what I should replace it with to make it work correctly?

Note: The board is almost completely stock, like 4 whole lines of customization in the whole board and that's only in globals.php, and ALL of my images are sourced to the included images directory. I can't see ANY reason to use the "Homepage Name" in *any* dynamic page on the site. Or is there and I'm just too ignorant to see it?

Thank you SOOOO very much!

wryanh... actually the proper vbulletin code would be...

{*imagesfolder}

no asterik

not images/ but i think both work... i just find it more effective using that ;)

hope that helps :p regards...

g-force2k2

I appreciate the quick reply, but I think you have it reversed. :)

The problem is, when the image is is being referenced by the entire URL string, it's getting that URL from the "Homepage Name" in the admin options.

I need the "src=" to drive itself from using the default virtual location - not the full reference so as not to possiblly use the wrong site reference.

What is need is what string to search for in the code or the template that is actually driving the FULL image path, and I need to pare them down to the correct use of the implied "DocumentRoot" that was being used when the page was being rendered.

Here's what a troubleshooting page from redhat says on what I'm trying to accomplish:

----------
When a client uses HTTPS to request a page that references its images with HTTP, the client cannot retrieve the images and displays a broken image instead. For example, the following HTML tag does not work when the document is retrieved using HTTPS:

<img src=http://www.yourhost.com/images/images.gif>


To ensure that image references work regardless of whether clients request pages via HTTP or HTTPS, reference the images without specifying a protocol, like this:

<img src=./images/images.gif>
----------

(In this case, it isn't the http vs. https that's biting me in the arse, it's the domain name itself! I need to get rid of it!

Originally posted by g-force2k2
wryanh... actually the proper vbulletin code would be...

{*imagesfolder}


Otay - I think you posted a change in the midst of my second reply :classic:

Then where is some of the code getting the whole URL with the Hostname from the Admin screen field?

Does {*imagesfolder} have "./images" or is it set to the whole protocol+path? Then, maybe I can edit where ever {*imagesfolder} is being set to hardocde it to "./images/" ?

Actually where is it being set? I had to edit my post to add the asterisk cuz it was resolving to the whole path!










privacy (GDPR)