coppermine-gallery.com/forum

Support => Older/other versions => cpg1.3.x Support => Topic started by: mikeall on January 29, 2005, 01:30:41 AM

Title: Language link (bug?)
Post by: mikeall on January 29, 2005, 01:30:41 AM
Great piece of software!

I have recently enabled the langauges for CPG v1.3 and the flags can seen at the bottom of this page:
http://craftcards.82au.com/cards/index.php

To see the link problem, hover over the flags and see the link location (which if clicked will cause a 404).

An example of the link is http://craftcards.82au.com/var/subdomain/craftcards/html/cards/index.php?lang=dutch

I have bolded the problem section. I had a look in the functions but couldn't find a solution.
Is the problem with here?:


//get the url and all vars except $lang
//$cpgChangeUrl = $_SERVER["SCRIPT_NAME"]."?";
$cpgChangeUrl = $_SERVER["SCRIPT_NAME"]."?";
foreach ($_GET as $key => $value) {
    if ($key!="lang"){$cpgChangeUrl.= $key . "=" . $value . "&";}
}
$cpgChangeUrl.= 'lang=';

Title: Re: Language link (bug?)
Post by: donnoman on January 29, 2005, 01:53:16 AM
It worked fine for me.

Dump the cache of your browser and retest.
Title: Re: Language link (bug?)
Post by: mikeall on January 29, 2005, 01:54:33 AM
I changed the line (1589 of functions.inc.php) of code to:

$cpgChangeUrl = $_SERVER["PHPSELF"]["SCRIPT_NAME"]."?";

and the problem is fixed.

The develpers might want to adjust this if it isn't fixed already.
Title: Re: Language link (bug?)
Post by: mikeall on January 29, 2005, 01:55:17 AM
Quote from: donnoman on January 29, 2005, 01:53:16 AM
It worked fine for me.

Dump the cache of your browser and retest.

That was because I just fixed it and you posted just before I could post.
:)
Title: Re: Language link (bug?)
Post by: kegobeer on January 29, 2005, 02:08:08 AM
There is no $_SERVER["PHPSELF"].  If you upload this:

<?php
echo $_SERVER["PHPSELF"];
?>

you should get absolutely no output.

You can list all server variables available like this:

<?php
phpinfo();
?>

You'll see all _SERVER varaibles you can access.  Your server may not have SCRIPT_NAME available, but you may have another variable you can get the script name from.