[Patch]Opera and Slideshow [Patch]Opera and Slideshow
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

[Patch]Opera and Slideshow

Started by etienne, October 22, 2003, 08:23:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

etienne

The slideshow is not working with Opera... javascript error!
The reason is that there is no 'real' browser detection.

Here is a small modification to slideshow.inc.php in order to make it compatible with Opera:

at the beginning of the javascript add:

// Agent sniffer shamelessly 'stolen' from the excellent X library from cross-browser.com
var xOp7=false,xOp5or6=false,xIE4Up=false,xNN4=false,xUA=navigator.userAgent.toLowerCase();
if(window.opera){
  xOp7=(xUA.indexOf('opera 7')!=-1 || xUA.indexOf('opera/7')!=-1);
  if (!xOp7) xOp5or6=(xUA.indexOf('opera 5')!=-1 || xUA.indexOf('opera/5')!=-1 || xUA.indexOf('opera 6')!=-1 || xUA.indexOf('opera/6')!=-1);
}
else if(document.layers) xNN4=true;
else {xIE4Up=document.all && xUA.indexOf('msie')!=-1 && parseInt(navigator.appVersion)>=4;}


Then replace, in the function runSlideShow alll occurences of:
  if (document.all){
with
  if (xIE4Up){

jasendorf

Beautiful... tested on my installation and I will fix this in the CVS (edit)once sf is done with its maintenance(/edit).  Thank you etienne!
Read the Online DOCs,FAQ, and SEARCH the board BEFORE posting questions for help.

rhydewithdis

Hmm I tried this on the phpnuke of cpg 1.2 rc1 - no workie