I don't want to go this direction Markus, because I want admin's to
have the flexibility to setup their installation any way they want to.
And this approach assumes a standard installation structure. Move your
farm somewhere unexpected and I don't think it will work as expected.
For example: my site.

Spent some time thinking more about this to try and really understand
the issue. PHP generally does fine working with relative paths and
seems to bypass any problems with cleanURL's. I think it must be the
browser that can't handle the relative paths when it tries to
interpret a farm image path, for example, on a cleanURL installation.
Just guessing, but the browser seems to take the URL in the address
bar, concocts a URL from it for the img based on the relative path,
and then sends that request to the server. Where nothing is found of
course.  That's the problem.

>From your other post on this topic, the solution is NOT to mix path
variables and url variables. PHP is not smart enough to handle that.
Nor is it to try and somehow figure out a "smarter" relative path--for
my reasons noted above. We also do know, that using a url instead of a
path CAN solve the farm img problem. So what is the answer?

1) For things like images, have an imgURL variable and use it rather
than an imgPath.
2) Since paths are also used in CSS, we should probably use urls in
snippets for $$farm (again), $skin, $pub, and $$img (new). This should
ensure css files always work right in cleanURL's.

As this involves several changes, I won't post the code, but put them
in the next release. Hopefully this morning, so you can test my theory
out. Now when setting cleanURL's you will probably need to set a
$farmURL (I'll try to guess the default value) and in rare situations
an $imgURL variable.

In other words, if the problem is the browser, we need to give the
browser what it needs to make the right request. Paths for PHP, URL's
for the browser. Get that right, and all our problems should be
solved!

Cheers,
Dan


On Tue, Mar 23, 2010 at 6:48 PM, Markus Weimar
<[email protected]> wrote:
> I might have found what I had been looking for all the time.
>
> Consider this pseudo code in markup.php line 801 that is executed for
> page "a.b.c":
>
>        if (file_exists($location)) {
>                if (substr($location, 0, strlen($imgPath)) != $imgPath) 
> $location =
> $fieldURL . $location;
> #               # $location is: ../boltwire/farm/img/boltwire.gif
> #               if ($cleanURL && {p0} > 1) prefix {p0}-1 times "../" to 
> $location;
> #               # $location is: ../../boltwire/farm/img/boltwire.gif
>
> When I manually add "$location = "../" . $location;" the pic works
> when {p0} is 3.
>
> I don't want to specify absolute paths, I want BoltWire to detect that
> I am using cleanURLs and that I need "../" for each sub level of a
> page.
>
> Of course it would be great to get the proper relative path whenever
> needed. For example when the skin contains a favicon. Then the
> relative path must change to match the number of sub levels or it
> won't be displayed.
>
> By the way, can anybody assure using clean URLs and having farm pics
> working on sub level pages? It's hard to believe MAMP and my Linux
> server have the same unique issue that causes this problem... Easier
> to believe that you must simply take care of the correct relative
> paths.

-- 
You received this message because you are subscribed to the Google Groups 
"BoltWire" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/boltwire?hl=en.

Reply via email to