I need to get GT-NextGen working for My_eGallery for my new www.canadianhottie.ca site, which uses a pretty modded Gallery, but the URL's for the gallery's and pics are the same.
I am a little different in that I am using IIS and ISAPI_rewrite. But should not make a difference. I have GT working for the rest of my site.
I already have the ISAPI_rewrite rules in place, and created a GoogleTap/GT-Gallery.php file. I am using the new GT-Nextgen 0.4, seems everyone else in this old thread had been using the older versions.
I think it may have something to do with the "&do=" ?? Looking at the other GT-Modulename.php files I don't seem to see any that have this?
Has anyone actualy got GT working for My_eGallery?
hamesh Support Mod
Joined: Feb 13, 2003
Posts: 170
Location: Canada
Posted:
Wed Mar 01, 2006 12:33 pm
I can't believe I'm still on this list Oh, really nice site by the way!
Well haven't used PHP-Nuke or My_eGallery for a few years now. First, my advise is to abandon My_eGallery altogether. Go get Menalto Gallery or Coppermine, either of which can plug into Nuke and are actively developed. If you use My_eGallery, it's just a matter of time until you get hacked, trust me on this.
But if you absolutely must use My_eGallery (shudder), the problem is with the amphersans in the URLs. If you look at the URLs in the HTML source of your pages, you'll see that the Gallery URLs can contain a mix of '&' and '&'. for example, here's the URL to a link to one of the images on your homepage:
Notice the mis-matched amphersans between Gallery and file? So either edit the lines in your GT-Gallery.php file so the amphersans match up in the URLs. Or do what I did and edit the PHP source of the My_eGallery modules files and update all the URLs in the code so they all use one convention or the other, but not both.
_________________
canadaka Corporal
Joined: Aug 05, 2004
Posts: 71
Location: Vancouver, Canada
Posted:
Wed Mar 01, 2006 12:54 pm
thanks for the reply and your comments on my site. Its a new site that's a spawn from www.canadaka.net which as been running nuke since 2000.
I want to stay with My_eGallery, I like it. I use coppermine on some other sites its good too. But my main reason to stay with it is I have over 5000 pictures and 20,000 comments in it already, I don't want to lose it all.
I have been hacked through My_eGallery, but leart from these hacks and have secured the gallery, im sure not 100% nothing is, but much better than out of the box.
Thanks for your tip woth the &
makes sense. I will scan through the my_egallery code and change all the & to &. It should be that way anyway!
canadaka Corporal
Joined: Aug 05, 2004
Posts: 71
Location: Vancouver, Canada
Posted:
Wed Mar 01, 2006 1:09 pm
no luck
I went through all the files in the gallery folder and looked for lone &, found a few but almost everything was using & already.
So it must be something else...
hamesh Support Mod
Joined: Feb 13, 2003
Posts: 170
Location: Canada
Posted:
Wed Mar 01, 2006 1:14 pm
Easy enought to test. Edit this new line in GT-Gallery.php:
Ah, you're right. The rule and the line in GT-Gallery.php match the URL so no reason it shouldn't work. Are you GT'ing any other section of your site? And do those work correctly?
Almost seems as though the GT-Gallery.php is not being called or included, so the rewrite rule works, but there's no matching URL array so it just redirects the rewritten URL to the standard one.
_________________
canadaka Corporal
Joined: Aug 05, 2004
Posts: 71
Location: Vancouver, Canada
Posted:
Wed Mar 01, 2006 2:20 pm
Yes GT is indeed working for the rest of the site. example check the forums
I also edited the forum rules to include my mods like the medals, stats, and stuff.
There shouldn't be any code i need to add to the Gallery module.. there isn't for the others. just the code inserted to the sites header.php, footer.php and sessions.php
So it must be a problem with the GT-Gallery.php ? How could i test if its being included?
Well i added some junk that would break the code:
Code:
urlin = array(dsfsdfdsf
and the Gallery pages continue to load properly... so that must mean its not being included right? I did the same to the GT-Forums.php and the forums were broken, blank page.
hamesh Support Mod
Joined: Feb 13, 2003
Posts: 170
Location: Canada
Posted:
Wed Mar 01, 2006 2:28 pm
Yeah I'd look at it from that angle. May not being included at all. Unfortunately I can't be of much further help as don't use Nuke or Meg so can't test anything on my end. Hopefully someone else will jump in, but I think you're on the right track...
_________________
canadaka Corporal
Joined: Aug 05, 2004
Posts: 71
Location: Vancouver, Canada
Posted:
Wed Mar 01, 2006 2:41 pm
hey well thanks for the help so far.
heh this is driving me nuts!
in header.php there is this code:
Code:
$nextgen_path = "GoogleTap/GT-".$nextgen_name.".php";
if ($next_gen_ob == 1) {
if (file_exists($nextgen_path)) {
ob_start();
} else {
$next_gen_ob = 0;
}
}
to test i changed "GT-".$nextgen_name.".php" to "GT-Gallery.php" which will stop GT from working for the rest of the site, but should make sure that the GT-Gallery is being included? Well made no difference.
Now i did find one thing in "admin/modules/gallery/config.php
there is this line:
now when you view the page source the "Gallery&file=" is correct, before it was indeed outputting "Gallery&file=".
But alas GT still not working in galery. I will post any updates.
canadaka Corporal
Joined: Aug 05, 2004
Posts: 71
Location: Vancouver, Canada
Posted:
Wed Mar 01, 2006 2:45 pm
doing some trouble shooting.. ot the header.php i added the echos
Quote:
//Make the path to the GT-NExtGEn Files
$nextgen_path = "GoogleTap/GT-".$nextgen_name.".php";
if ($next_gen_ob == 1) {
if (file_exists($nextgen_path)) {
echo "TRUE";
ob_start();
} else {
echo "FALSE";
$next_gen_ob = 0;
}
}
function replace_for_mod_rewrite(&$s, $nextgen_path) {
//Check to see if file exists before continuing
if (file_exists($nextgen_path)) {
include($nextgen_path);
echo " TRUE 2";
}
$s = preg_replace($urlin, $urlout, $s);
return $s;
} #End of Google Tap Header
on the http://www.canadianhottie.ca/gallery.html you only see 'TRUE"
so indeed its not getting into the replace_for_mod_rewrite function which actualy includes the GT-GALLERY.php.
The replace_for_mod_rewrite is alled in the footer.php
Quote:
echo "next_gen_ob: ". $next_gen_ob;
#Start of GoogleTap Footer
if ($next_gen_ob == 1) {
// Store Buffer in $contents
$contents = ob_get_contents();
//Replace all standalone &'s with &'s
$contents = preg_replace("(&(?!([a-zA-Z]{2,6}|[0-9\#]{1,6})[\;]))", "&", $contents);
//Fix up for && in script and bad coding of middot;'s, and ;'s
$contents = str_replace(array("&&", "&middot", "&nbsp"), array("&&", "·", " ;"), $contents);
//delete output buffer and stop buffering
ob_end_clean();
//display modified buffer to screen
echo replace_for_mod_rewrite($contents, $nextgen_path);
} else {
//if module has unusual method of including footer, make NExtGEn variables
//global and try it again. If variables have values for NExtGEn it will succeed
//else it will go to normal footer.
global $next_gen_ob, $nextgen_path;
if ($next_gen_ob == 1 AND $nextgen_path != "") {
$contents = ob_get_contents();
$contents = preg_replace("(&(?!([a-zA-Z]{2,6}|[0-9\#]{1,6})[\;]))", "&", $contents);
$contents = str_replace(array("&&", "&middot", "&nbsp"), array("&&", "·", " ;"), $contents);
ob_end_clean();
echo replace_for_mod_rewrite($contents, $nextgen_path);
}
}
#End of GoogleTap Footer
In the footer I added the "echo "next_gen_ob: ". $next_gen_ob;"
on a module that GT is working on it will echo out "next_gen_ob: 1" at the bottom. On the gallery pages it is blank "next_gen_ob: ".
So the problem lies there somewhere.
canadaka Corporal
Joined: Aug 05, 2004
Posts: 71
Location: Vancouver, Canada
Posted:
Wed Mar 01, 2006 3:54 pm
lol
well at least i have a good record now. maybe someone else will have a simular problem and find this all useful.
The problm is that the $next_gen_ob and $nextgen_path are not getting passed to the footer.php with the My_eGallery module... im not sure I tried a bunch of things to try and get it too.
I give up with that, BUT i have found a workaround! I got GT working in my Gallery now!!!!
What I did is in the root of the Gallery module folder edited the index.php
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum