[SOLVED] Embedded Breadcrumb Navigation
ozgreg
Joined: 2003-10-18
Posts: 1378 |
Posted: Mon, 2005-04-18 04:29 |
Hiya, Having a problem with using the breadcrumbs for navigation when running a embedded gallery. As soon as you navigate down into sub albums and select the breadcrumb you get the following error message.. Warning: Cannot modify header information - headers already sent by You can reproduce the issue by navigating via the following link -> http://www.ozgreg.com/gallery2.php |
|
Posts: 32
I'm also trying to integrate Gallery2 with my Wordpress install and having the same problem, dunno what it is...
Posts: 1378
Debug Log -> http://www.ozgreg.com/debug.zip
Posts: 32509
what is in your main.php on line 416?
Posts: 32
header("Location: $redirectUrl");
Posts: 32509
most often the reason for these "headers are already sent" errors is that there is a space/newline at the end of one of the involved files or that there's somewhere some debug output.
the first place i'd start searching is config.php (but then all G2 pages should show the error) and then the files you edited.
Posts: 32
The strange thing is that I don't get this error if I browse the gallery as stand alone... (www.mysite.com/galley2/main.php)
Posts: 1378
It is an embedded problem not a stand alone problem, take away the embedding and it works fine..
I am also getting the same error message when performing Editing on Albums etc..
Posts: 8601
that means the extra space or blank line is in your embed code or the embedding app, and not in any G2 file. the "headers already sent" message will tell you "output started at..." so you can find the extra whitespace to remove.
Posts: 1378
Mindless, Firstly I believe you would be getting this error all the time if it is a space issue in the calling embedding code secondly the error seems to be just limited to when gallery redraws a screen it has already rendered. (IE When navigating via the breadcrumbs and also when selecting an action (ie rebuilding thumbnails) in the Album Edit.)
I thought it was some template problem until I could also get the error during Album Editing..
Posts: 32
any Ideas where to start looking for the source of this error?
Posts: 32509
-> the error is in your gallery2.php file at line 11. look for newlines, spaces, ...
Posts: 32
Line 6-8 in foto.php
6: <head profile="http://gmpg.org/xfn/11">
7: <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>
8: <meta http-equiv="Content-Type" content="text/html; charset=<?php bloginfo('charset'); ?>" />
If I try to remove line 7 I get the same error again. It looks like the error always are in the first line in the <head> section.
Posts: 8601
arnoadam, you need to rework your embedding code.. you can't output any html before calling GalleryEmbed::handleRequest.
Posts: 32
Thnx!
That's it, everyting are working now!
Posts: 8601
arnoadam, great!
ozgreg, were you able to fix up your gallery2.php file?
Posts: 1378
No I moved around the $g2data = GalleryEmbed::handleRequest(); before any HTML output which was the issue however when you select a breadcrumb now you just get a blank page..
Posts: 32509
ah, i see the problem. you don't obey the 'isDone' tag.
if G2 already redirects/outputs something directly, i.e. doesn't use the parents template, then it sets the $g2data['idone'] (see embed.php for spelling, not sure right now).
so if (isset($g2data['idone']) && $g2data['idone']) {
exit;
}
and don't output any html for yourself.
Posts: 1378
I removed that code because it was outputting a BLANK page when this happened because of the exit command..
I originally had..
Which = Blank page when reusing any page (ie breadcrumb)
Posts: 32
this is my foto.php and it's working for me.....
Posts: 1378
Which is what I have got which leads to a blank page when I use the breadcrumbs..
Just as a side not you do not need
<link rel="stylesheet" type="text/css" href="http://www.mysite.com/gallery2/layouts/siriux/layout.css"/>
<link rel="stylesheet" type="text/css" href="http://www.mysite.com/gallery2/templates/layout.css"/>
If you add the elements of those stylesheets to your WP Style. In fact I would recommend doing this so you can easy do a one style sheet changes everything approach..
Posts: 32509
ozgreg, without taking a closer look (cause i fail to understand why this happens),... please take a look at the xaraya integration file xaruser/main.php (this corresponds to this gallery2.php file.
'cause the xaraya integration works, also for breadcrumb links.
see the demo at http://nei.ch/test/xaraya/ (out of date, demo install only)
Posts: 1378
Believe me Valiant I have pulled the php apart and back together, moving from simple to complex scripts. I been adding php apps to phpbb boards for a few years so I am not a stranger to the template environments but this one has gotten me by the short and curly..
Frustrating as all hell, because I got my site css working well except for this..
*sighs*
Edit: Now this is interesting I turned off require('./wp-blog-header.php');
and the breadcrumbs worked fine.. (Gallery was in embedded standalone) ;)
Posts: 1378
Unfortunately It just been proved that nothing is wrong with my embedding code for WP and G2. It seems on certain hosts WP & G2 do not play well together.
I cannot see anyway forward on this other than to abandon this integration and looking for alternativeness that do play well.
Posts: 13451
ozgreg, can you elaborate on how/why that happens?
Posts: 1378
The issue is for some unkown reason in my hosting environment as soon as I run embedded Gallery selecting a WP breadcrumb the page just fails to load (they return blank) (even although the URL is correct)
Valiant has kindly verified my embedded script, and loaded a blank copy of WP / Gallery on his servers verifying I was not losing my mind..
I also did the same with another vanilla installation of WP/Gallery verifying that I was losing my mind..
In all cases I cannot get my breadcrumbs to work while using the same script Valiant G2/WP breadcrumbs work fine..
You are very welcome to look @ my site right now and see the issue first hand -> http://ozgreg.com/
Short of moving hosting firms I am just about out of options..
Posts: 32
ozgreg, I don't think there is anything wrong with your code but did you try arnoldjw's plugin?
Posts: 1378
This one -> http://wordpress.org/support/topic.php?id=31329
Then the answer is yes. I like his work although he has a few stylesheet issues, and I would like to change some of the way his code works because G2/WP allows better detection that just reading cookies etc.
Same issue however As soon as I navigate via a breadcrumb = blank page..
Posts: 2
UPDATE: Nevermind! I missed the "get_header()" call at the top. Taking that out fixed my problem.
I am having a similar problem on my site (http://blog.mahshie.net/photos.php), although I get the following error message:
My embed file (photos.php) file is based on ozgreg's code, but is pretty simple:
Am I having the same problem, or am I missing something obvious?
Posts: 1378
I been playing around and playing around getting my hosting company to do some serious work on why my Gallery was returning a blank page then I noticed that G2 on the breadcrumbs changes the URI and basically adds a highlightid..
It is this that is breaking my Gallery! When I removed the highlight from my URI (pathbar.tpl) all was smooth sailing..
What does highlightId do in the URI and am I breaking Gallery in removing it??
Posts: 8601
including the highlightId parameter will make it jump to the right page of a multipage album.. ie, if you're viewing photo X and click it's parent album Y in the breadcrumb it will go to page 3 of Y if that's where X's thumbnail is shown.. (it sends a redirect to reach this page, don't know if that's any help it why it doesn't work for you).
Posts: 1378
Update Thanks to Bharat help, we added the following code to my gallery2.php which has fully restored the breadcrumbs..
Posts: 3
Where exactly did you put this? I'm experiencing the same problems on a typo3 systems with embedded gallery2.