PhotoPlog

PhotoPlog (http://www.photoplog.com/forum/index.php)
-   Bugs & Issues Tracker (http://www.photoplog.com/forum/forumdisplay.php?f=8)
-   -   [Closed via Lite v.1.0.7] Duplicate dirs bug in breadcrumb (http://www.photoplog.com/forum/showthread.php?t=32)

Nitro 01-22-2006 10:30 PM

[Closed via Lite v.1.0.7] Duplicate dirs bug in breadcrumb
 
Being one of the first to suffer duplicate dirs I cant believe I'v only just found this but on photoplog pages the breadcrumb icon to refresh/reload the current page still has duplicate directories. "/portal/forums/portal/photoplog/index.php"

It should be removing the /portal/forums from it and then it would be fine.

It also may well be usefull to know how you fix it as it may help me go back to being able to use relative links elsewhere from other products that appear on photoplog pages. ;)

Morgan 01-24-2006 09:01 AM

Do these match with what you have for your site?
Code:

Home Page: http://www.domain.com

Forum URL: http://www.domain.com/portal/forums

PhotoPlog Directory Setting: /portal/photoplog

PhotoPlog URL: http://www.domain.com/portal/photoplog

PhotoPlog Duplicate Setting: /portal/forums

In the default navbar template there are three links:
Code:

<a href="#" onclick="history.back(1); return false;"><img src="$stylevar[imgdir_misc]/navbits_start.gif" alt="$vbphrase[go_back]" border="0" /></a>

<a href="$vboptions[forumhome].php$session[sessionurl_q]" accesskey="1">$vboptions[bbtitle]</a>

<a href="$scriptpath"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_finallink.gif" alt="$vbphrase[reload_this_page]" border="0" /></a>

What do they look like in your navbar template?

Also what does the HTML source look like for these three links?

In general there are basically three ways to handle relative links. One is to do like PhotoPlog does and automatically make absolute links. Two is to provide text boxes where the user lists what and where to link. Three is a combination of one and two, but none is truly ideal for all directory structures, skins, sub-domains, etcetera. :(

Nitro 01-24-2006 05:51 PM

Checked these and removed /portal from the vb Home url setting

I cant see anywhere to put Photoplog URL ?

That navbar section looks identical.

Morgan 01-25-2006 10:10 AM

You can keep /portal in Home URL if that's how you want it, I was wondering the values of your settings is all. The PhotoPlog URL isn't a setting though, it's just the link to PhotoPlog on your site.

The 'Reload this Page' breadcrumb link is coming out like that because $scriptpath is returning /portal/photoplog/index.php and then PhotoPlog sees it's a relative link and prepends http://www.domain.com/portal/forums to form the link you see.

The duplicate directory, while thought of as the part to take off the end of the Forum URL, really comes off the beginning of relative links in the HTML source of a page.

In the photoplog_output_error and photoplog_output_page functions, right after all the global bits, add the following:
Code:

        if (!eregi("^http[s]?://",$GLOBALS['vbulletin']->scriptpath))
        {
                $GLOBALS['vbulletin']->scriptpath = eregi_replace("^(\./|/)","",$GLOBALS['vbulletin']->scriptpath);
                $GLOBALS['vbulletin']->scriptpath = $vbulletin->options['homeurl'].'/'.$GLOBALS['vbulletin']->scriptpath;
        }


Nitro 01-25-2006 11:39 AM

That code seems to have done the trick :)

My link to photoplog is absolute and added to my portals side menu block as are most, but theres a few default links using similar globals I am wondering if i could fix these in a similar way. I will give them a go later as the sidemenu block has relative links using variables to the portalhome forumhome and one or to others inside conditionals. Theres other blocks that also link to various sections of both portal and forums that I cant add to the left column casue of the issue. If it fixes the few variables in the portals side menu block i may have to write up a huge list for the other block types.

I am thinking if thats whats nesseacry it would probably better making a seperate file for it all and using a require call at those points instead ?

Morgan 01-25-2006 11:52 AM

Do these portal blocks have some sort of underlying commonality? Perhaps there's a variable unique to the portal that gets set and is used in each block?

Nitro 01-25-2006 06:59 PM

Yes I suspect so on the whole Im just not sure how I need to apply it. I have tried for a while today with no success so far :/

I was hoping something like this would do
PHP Code:

    if (!eregi("^http[s]?://",$GLOBALS['vboptions']->portalhome))
        {
        
$GLOBALS['vboptions']->portalhome eregi_replace("^(\./|/)","",$GLOBALS['vboptions']->portalhome);
        
$GLOBALS['vboptions']->portalhome $vbulletin->options['homeurl'].'/'.$GLOBALS['vboptions']->portalhome;
    } 

on a link thats like this in the navbar template to the portal home and I am quite sure one or two of these would cover the vast majority.

HTML Code:

<td class="vbmenu_control"><a href="$vboptions[portalhome]">$vboptions[hometitle]</a></td>
and another link which I am sure is using quite a common relative var in the vbportal, probably more common than the above.
HTML Code:

<a href="$vbpoptions[homedir]/modules.php?$session[sessionurl]name=Sections">
I will try some more later, to much lack of success makes me very tired and I start crashing out in my chair. :D I may have to ask a felllow vbportal person to take a quick look, I am sure the right syntax could be found in minutes not hours like it takes me sometimes. :)

Morgan 01-25-2006 11:16 PM

In the PhotoPlog settings.php file find:
Code:

$photoplog_src_link = $vbulletin->options['bburl'];

$photoplog_homeurl = parse_url($vbulletin->options['homeurl']);
$photoplog_schemehost = $photoplog_homeurl['scheme'].'://'.$photoplog_homeurl['host'];
$photoplog_location = $photoplog_schemehost.$vbulletin->options['photoplog_script_dir'];

And replace with the following:
Code:

$photoplog_homeurl = parse_url($vbulletin->options['homeurl']);
$photoplog_schemehost = $photoplog_homeurl['scheme'].'://'.$photoplog_homeurl['host'];
$photoplog_location = $photoplog_schemehost.$vbulletin->options['photoplog_script_dir'];

$photoplog_src_link = $photoplog_schemehost;

And then go set the PhotoPlog Duplicate Directory to empty.

What happens?

Nitro 01-27-2006 10:34 PM

I did this and I think after a breif whip round it is certainly far better, but not without some other problems, maybe these will be easier to fix tho. What it seems to do after commenting out the code from post #4 and doing this replace and removing the duplicate dir setting is:
CSS image paths now appear to be ok without the dupe dir setting.
All photoplog links appear to be ok
My portal side menu links the relative ones that are template coded seem fine too. :)
The final bread crumb link is also good.

What appeared to end up getting broken from it is the navbar links on any photoplog page ie usercp etc as by default these are relative to the forum directory (so possibly the footer links aswell). Yes in the navbar I can make them relative from the webroot instead which is one answer. However other galleries do not need it in similar layouts and I am not sure why.

The layout I use is.

/portal
/portal/forums
/portal/photoplog

The layouts I have done elsewhere with other galleries is not much different but often the portal is in the webroot not in a subdir.
What I will do over the weekend is apply the change on the live site where I know all styles in use are in much better shape than some of the same styles on the test install. I should have a final confirmation on how its panning out then and I think one of those styles uses replacements aswell. :)

Nitro 01-28-2006 02:50 PM

settings.php fix Applied to live site.
 
I think building on this is the way to go, from what I can see on my live install it has cured all duplicate directories without the need to have anything set for it in photoplog settings. :) Thats the good news because vbportal also has a module dropdown box in the menu block to save housing all links in a list, this is also now functioning as would be expected.

The bad news is (and I have been throught it relatively thoroughly in an untouched vb default style), is default links called in a relative to forum root related to going to forum pages appear to be broken, also the default styles css image paths and stylevar image paths are relative to forum root so they too are broken. The images are easy to fix in this instance by using a replacement variable. The links present a more awkward situation. One quite simple suggestion would be for photoplog to carry extra cp settings for forum path and forum url, ie $vbpotions->photoplog->[bbdir] and [bburl] and then carry its own header, navbar and footer. I think all relative referenced links and images not from the webroot can then be defined in a relative way using the extra variables in all photoplog templates. Theres probably a better way but I'm not a php expert.
I am sure I had to repair some links in a photopost install I did a few weeks back for someone for this very reason and had to make them relative to webroot with portal defined variables.

To summarise it should now be good for photoplog to have elements from other 3rd party scripts that dont sit in forum root either to use relative links and paths with their own variables and anything that this fix currently breaks in vb links and images can certainly be fixed in a relative way. Not so good for those who have a few dozen styles with a lot of individual customisations tho as the likelyness of the these 3 main templates being individual to each style is high, which is why I hope theres a way to build on the fix for those people. :)


All times are GMT. The time now is 06:45 AM.

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