PhotoPlog

PhotoPlog (http://www.photoplog.com/forum/index.php)
-   Feedback & Suggestions (http://www.photoplog.com/forum/forumdisplay.php?f=3)
-   -   relative links (http://www.photoplog.com/forum/showthread.php?t=473)

cheesegrits 08-03-2006 08:03 PM

relative links
 
Morgan,

I'd often wondered why the need for the relative / absolute links deal in the Plog options. Now that I'm creating my own vB project (rebuilding my ISP user provisioning system inside vB) which resides in a subfolder, I discovered the various issues with relative versus absolute links.

However, I seem to have found a way of overcoming this without having to do any manual link replacement. I hesitate to mention this, because I'm sure you already know about this, and there's probably other reasons for the way you are handling the relative links issue ... but ...

What I'm doing is, right at the top of the headinclude template I have:

Code:

<!-- vCheese edit -->
<if condition="defined('IN_CHEESE')">
    <base href="$vboptions[bburl]/index.php" />
</if>
<!-- end vCheese -->

... where IN_CHEESE is defined in my global.php, just before the usual chdir to forum root. As long as I handle my own links correctly, this magically resolves all the other relative link problems on the navbar, footer, etc.

Anyway, as I said, I'm sure you already know about this base href trick, but just in case ...

-- hugh

Morgan 08-04-2006 03:35 AM

Thanks, the BASE tag can work well, assuming user agents interpret it correctly, but it won't work on some JavaScript in PhotoPlog like 'switch mode' though it could cut down on the number of items in the Relative/Absolute settings.

If anyone wants to try it, edit the vB headinclude template like cheesegrits says:
Code:

<if condition="PHOTOPLOG_SCRIPT">
        <base href="$vboptions[bburl]/$vboptions[forumhome].php" />
</if>

Then remove entries piecewise from the Relative/Absolute settings, testing as you go along, to determine what can be removed and what needs to stay. The action, href, src, and url lines should be able to be removed.

cheesegrits 08-04-2006 05:33 PM

Thanks for the heads up about certain JS scripts, I'll watch out for that.

Luckily for me, the main app I'm creating is strictly private, for use by our staff only, so I have control over the browsers. IE is the only guarrantee, FireFox is "best effort" but if something doesn't work, tough.

I'm just glad I found that base href thing, even if it may not solve all my link problems (although so far it has done the job). That whole relative / absolute link issue was driving me nuts! I thought I was going to spend half my life editing templates and writing URL substitution code. :eek:

-- hugh


All times are GMT. The time now is 08:16 PM.

Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.