4images Module Intergration Errors & Blank Page [Help Ne

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
#1   4images Module Intergration Errors & Blank Page [Help Ne
jerfersor
CZ Newbie
jerfersor has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Aug 13, 2005
0.00 posts per day
Posts: 2
Points: 76
   
Hello all!

I've sucsessfully installed phpnuke 7.7 and patched it , dont i deserve a star? icon_lol.gif anyways..
I needed a image gallery and it seemed that 4images should be the safest and the best, according to what I've read

So I went ahead and installed it (v1.71).. again .. read all files and did what I was supposed to, i believe.... it even worked by itself.. but when i intergrated it .. well.. things werent so smooth.

I think I've done everything i was suposed to ....
but I get an error and a empty page when i click on the gallery module icon_sad.gif

when using firefox
Warning: ob_start(): output handler 'ob_gzhandler' cannot be used twice in /home/pqhdlbci/public_html/reallgames/reall/mainfile.php on line 83

Fatal error: Cannot redeclare stripos_clone() (previously declared in /home/pqhdlbci/public_html/reallgames/reall/mainfile.php:114) in /home/pqhdlbci/public_html/reallgames/reall/mainfile.php on line 114

and nothing shows up... but the error.

with ie
Warning: ob_start(): output handler 'ob_gzhandler' cannot be used twice in /home/pqhdlbci/public_html/reallgames/reall/mainfile.php on line 77

Fatal error: Cannot redeclare stripos_clone() (previously declared in /home/pqhdlbci/public_html/reallgames/reall/mainfile.php:114) in /home/pqhdlbci/public_html/reallgames/reall/mainfile.php on line 114


The errors are slightly different but the same .. if you know what i mean...

The site is still being built.. [ Register or login to view links on this board. ]
you can see it yourselves.. nowhere else I get this errors...

I've looked into mainfile.php
These are my lines 74 thru 88 mainfile.php
if ($phpver >= '4.0.4pl1' && isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'],'compatible')) {
   if (extension_loaded('zlib')) {
      @ob_end_clean();
      ob_start('ob_gzhandler');
   }
} elseif ($phpver > '4.0' && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && !empty($_SERVER['HTTP_ACCEPT_ENCODING'])) {
   if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
      if (extension_loaded('zlib')) {
         $do_gzip_compress = true;
         ob_start(array('ob_gzhandler',5));
         ob_implicit_flush(0);
         header('Content-Encoding: gzip');
   }
}
}

These are my lines 110 thru 122 mainfile.php

// We want to use the function stripos,
// but thats only available since PHP5.
// So we cloned the function...
if(!function_exists('stripos')) {
  function stripos_clone($haystack, $needle, $offset=0) {
    return strpos(strtoupper($haystack), strtoupper($needle), $offset);
  }
} else {
// But when this is PHP5, we use the original function   
  function stripos_clone($haystack, $needle, $offset=0) {
    return stripos($haystack, $needle, $offset=0);
  }
}


so on line 82
         $do_gzip_compress = true;

i replaced the tru by false
         $do_gzip_compress = false;


and it took the first line of error (about line 77) on Internet Explorer.
But the error about line 83 on firefox is still there.
and on both cases the error about line 114 never goes away.
These are the only errors I get on my page... the forums have the compression turned off.

I read on line 111
thats only available since PHP5.
and my server is running PHP 4.3.10 ... but again .. that is a "if" function.

any toughts?

Thanks in advance


Back to top Reply with quote
#2   re: 4images Module Intergration Errors & Blank Page [Hel
Kelly_Hero
PayPal Donation
CZ Revered Member
 Codezwiz Site Donator
usa.gif southcarolina.gif
Occupation: Web Developer
Age: 59
Gender: Female
Website:
Status: Offline
Joined: Aug 20, 2003
0.48 posts per day
Posts: 3765
Points: 351,412
   
This is just a shot in the dark, but give these a try. Replace the lines of code you posted above with the ones below. Make sure to make a backup copy first!

if ($phpver >= '4.0.4pl1' && isset($_SERVER['HTTP_USER_AGENT']) && strstr($_SERVER['HTTP_USER_AGENT'],'compatible')) {
   if (extension_loaded('zlib')) {
      @ob_end_clean();
      ob_start('ob_gzhandler');
   }
} else {
if ($phpver > '4.0' && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && !empty($_SERVER['HTTP_ACCEPT_ENCODING'])) {
   if (strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
      if (extension_loaded('zlib')) {
         $do_gzip_compress = true;
         ob_start(array('ob_gzhandler',5));
         ob_implicit_flush(0);
         header('Content-Encoding: gzip');
   }
}
}
}


// We want to use the function stripos,
// but thats only available since PHP5.
// So we cloned the function...
if (!function_exists('stripos')) {
  function stripos_clone($haystack, $needle, $offset=0) {
    return strpos(strtoupper($haystack), strtoupper($needle), $offset);
  }
} else {
// But when this is PHP5, we use the original function   
  function stripos_clone($haystack, $needle, $offset=0) {
    return stripos($haystack, $needle, $offset=0);
  }
}


In the first set, I think the problem is that there is an elseif statement. PHP doesn't use elseif, ASP does.

In the second set, I think the problem is that there is no space between the if and (!function_exists('stripos')).

Hope this helps. Post back here if it doesn't fix the problems.


Back to top Reply with quote
#3   re: 4images Module Intergration Errors & Blank Page [Hel
jerfersor
CZ Newbie
jerfersor has been a member for over 19 year's 19 Year Member
Gender: Male
Status: Offline
Joined: Aug 13, 2005
0.00 posts per day
Posts: 2
Points: 76
   
I've got it now icon_smile.gif
the full line, for whoever has the same problem to be fixed, is
from .../modules/Gallery/includes/page_header.php
if(!isset($mainfile)) { include("mainfile.php");}

wich should be replaced by:
if(!isset($mainfile)) { require_once("mainfile.php");}


Thanks!!!


Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb  
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
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
You cannot attach files in this forum
You cannot download files in this forum