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

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

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