by rubio25 » Wed Oct 03, 2007 3:09 am
--Solved --
Now I did my resaerch, cause Zanix was saying my server would not forward the correct path.
Took me some time to figure it out. In the siggen.php file the charname is retrieved either as a $GET variable, that is when we use the usual path:
sig.php?member=charname or when we use the fake one sig.php/charname.png you get it using a global server variable named $_SERVER['PATH_INFO']
The name is than placed into a variable that is used in a SQL statement to retrieve the char's details out of the roster database.
Now when the hoster switches off some of the globals or changes them or you have another apache derivate that is using another standard, than the $_SERVER['PATH_INFO'] might be empty thus the name can not be retrieved and the expected image will not be build. In my case the PATH_INFO value in the array is empty, as a consequence the sql statment can not work and the default settings kick in.
Unless you do a proper URL redirect in .htaccess, that is the server takes care that the URL is replaced by a one which filles the $Get varibale with the proper char name, which in my case did not work either.
If you need into about how to do a redirect in the .htaccess file [url=http://www.wowroster.net/MediaWiki/SigGen#Usage]read this section in the manual
[/url]
If you do not know what this is about you need to take a weekend off and google for the .htaccess file description or consult the apache .htaccess manual.
I am not sure why the redirect did not work on my server, I am still looking into my regular expressions there but my guess is that the hoster overrides my settings as the error log does not show any .htaccess errors unless I delibaretly do introduce one to test if it is working at all.
What I did is I wrote a php script to debug which varibles do I have access to from the siggen directory and thus found one which I could use instead of $_SERVER['PATH_INFO'].
In my case I have one called $_SERVER['ORIG_PATH_INFO']
so I extended the siggen.php file as follows:
[PHP]
// do the alternate name eval when globals are screwed up
// hack if global path info is empty check if different exist
if( empty($char_name))
{
$pngspoof = $_SERVER['ORIG_PATH_INFO'];
$leftstring= "php/" ;
$char_name = extractBetweenDelimeters($pngspoof, $leftstring ,".png");
}
function extractBetweenDelimeters($inputstr,$delimeterLeft,$delimeterRight) {
$posLeft = stripos($inputstr,$delimeterLeft)+1;
$posRight = stripos($inputstr,$delimeterRight,$posLeft+2);
return substr($inputstr,$posLeft,$posRight-$posLeft);
}
[/PHP]
I set this lines directly in front of // Get image mode ( signature | avatar | etc ) around Line 98
Now the name char variable gets filled and I have what I wanted without needing to redirect and fumble around with the hoster.
So when this happens that the image url is not parsed as expected check the server varibles first to see it the name tag is empty.
Just my 2 cents.
Last edited by
rubio25 on Thu Oct 04, 2007 6:12 pm, edited 9 times in total.