forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: edgey8843 on April 07, 2006, 02:15:18 pm

Title: incorrect links displayimage.php
Post by: edgey8843 on April 07, 2006, 02:15:18 pm
got it loaded ok on two difrent servers but seem to have incorrect links on the forward backward buttons above the pictures
http://www.branshaw.no-ip.com/cpg144/displayimage.php?album=random&cat=0&pos=-10  if you try you will see what I mean. If you place mouse over arrow it returnes full machine path not the server path any Idea's on where to look to correct problem.
Title: Re: incorrect links displayimage.php
Post by: Nibbler on April 07, 2006, 02:28:05 pm
Look at phpinfo.php, find the server var that contains the correct value, and then place it first in the list in include/init.inc.php

Code: [Select]
$possibilities = array('REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL', 'SCRIPT_NAME','SCRIPT_FILENAME');
Title: Re: incorrect links displayimage.php
Post by: edgey8843 on April 07, 2006, 03:38:23 pm
looked at phpinfo.php but cannot see any reference to server var
Title: Re: incorrect links displayimage.php
Post by: kegobeer on April 07, 2006, 03:41:30 pm
edgey, you misunderstood Nibbler's request.  Point your browser to phpinfo.php and find the server var that contains the correct value.
Title: Re: incorrect links displayimage.php
Post by: edgey8843 on April 07, 2006, 04:01:36 pm
soz I know that not thinking have all the info up but not certain what I should be looking at various paths am I looking under PHP Variables which section. have been through php ini manually but couldn’t see anything wrong
Title: Re: incorrect links displayimage.php
Post by: Joachim Müller on April 07, 2006, 04:39:13 pm
have been through php ini manually but couldn’t see anything wrong
you're not suppossed to. Re-read above recommendations.
Title: Re: incorrect links displayimage.php
Post by: edgey8843 on April 08, 2006, 12:56:29 pm
left this Friday just not thinking straight have now re read and under stood have tried various variables at beginning of the code
Code: [Select]
$possibilities = array('REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL',

'SCRIPT_NAME','SCRIPT_FILENAME');
FOR EXSAMPLE
Code: [Select]
$possibilities = array('HTTP_HOST', 'REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL',

'SCRIPT_NAME','SCRIPT_FILENAME');
no matter what no diffrence rem ing that line seems to make it work or certainly work beter I have tried removing lets say redirect_urljust to see the difference removing something from this line of code does but that makes no difference only removing the complete line helps
Title: Re: incorrect links displayimage.php
Post by: Nibbler on April 08, 2006, 01:14:45 pm
If you post the relevent part of your phpinfo then we can help you.
Title: Re: incorrect links displayimage.php
Post by: edgey8843 on April 08, 2006, 01:26:58 pm
have attached the copy of init.inc.php as a txt file this has the line remed if you check http://www.edgey.no-ip.com/cpg144/ you can see how this works better compared to the one at http://www.branshaw.no-ip.com/cpg144/index.php with the line of code still in place this affects the slide show button and previous next photo arrows in displayimage.php
Title: Re: incorrect links displayimage.php
Post by: Nibbler on April 08, 2006, 02:16:34 pm
If you post the relevent part of your phpinfo then we can help you.
Title: Re: incorrect links displayimage.php
Post by: edgey8843 on April 08, 2006, 02:28:07 pm
Code: [Select]
$PHP_SELF = '';
$ORIGINAL_PHP_SELF = $_SERVER['PHP_SELF'];
//$possibilities = array('REDIRECT_URL', 'PHP_SELF', 'SCRIPT_URL', 'SCRIPT_NAME','SCRIPT_FILENAME');
foreach ($possibilities as $test){
  if (isset($_SERVER[$test]) && preg_match('/([^\/]+\.php)$/', $_SERVER[$test], $matches)){
    $PHP_SELF = $_SERVER['PHP_SELF'] = $_SERVER['SCRIPT_NAME'] = $matches[1];
    break;
  }
}
this is at edgey.no-ip.com with line remed and works better than with line in though you have to click on at least two diffren pictures.
Title: Re: incorrect links displayimage.php
Post by: Joachim Müller on April 09, 2006, 10:35:57 am
if you don't do as Nibbler suggested, then there's nothing we could do to help you. What part of the sentence
If you post the relevent part of your phpinfo then we can help you.
do you not understand?