Advanced search  

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]

Pages: [1]   Go Down

Author Topic: [Patch]Opera and Slideshow  (Read 3107 times)

0 Members and 1 Guest are viewing this topic.

etienne

  • Coppermine newbie
  • Offline Offline
  • Gender: Male
  • Posts: 17
    • Etienne's Gallery
[Patch]Opera and Slideshow
« on: October 22, 2003, 08:23:10 am »

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:
Code: [Select]

// 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:
Code: [Select]
  if (document.all){
with
Code: [Select]
  if (xIE4Up){
Logged

jasendorf

  • VIP
  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 350
    • http://www.338tharmyband.com
[Patch]Opera and Slideshow
« Reply #1 on: October 22, 2003, 04:12:57 pm »

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!
Logged
Read the Online DOCs,FAQ, and SEARCH the board BEFORE posting questions for help.

rhydewithdis

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 33
    • http://www.vivrant.com
[Patch]Opera and Slideshow
« Reply #2 on: November 12, 2003, 04:52:11 am »

Hmm I tried this on the phpnuke of cpg 1.2 rc1 - no workie
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 18 queries.