I was interested in the very same thing, so today I took the initiative and managed to get this to work. I also managed to disable Shadowbox-JS in conjunction with WPTouch in that you can choose to disable Shadowbox-JS only when viewing the mobile theme and leave it enabled when the user turns off the mobile theme by click the toggle in the footer of the WPTouch template.
Please note that I have tested this and confirmed working on both an iPhone 3GS and iPod Touch, and used a Firefox plugin to emulate it working for the iPad. Please let me know if you have any issues or concerns.
To disable Shadowbox-JS completely across the site when it is being viewed using an iPhone, iPod, or iPad, edit the “shadowbox-js.php” file and near the end of that file (at line 168) look for the line:
} else {
if ( @include ( dirname ( __FILE__ ) . '/inc/frontend.php' ) ) { $ShadowboxFrontend = new ShadowboxFrontend (); }
}
and replace it with the following:
} else {
if ( @include ( dirname ( __FILE__ ) . '/inc/frontend.php' ) ) { // detect if iPhone/iPad/iPod and disable shadowbox if true
$browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
if ($browser == false) {
$browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
if ($browser == false) {
$browser = strpos($_SERVER['HTTP_USER_AGENT'],"iPad");
if ($browser == false) { $ShadowboxFrontend = new ShadowboxFrontend (); } } }
// end detection
}
.. and now Shadowbox-JS is now automatically disabled when your site is viewed on either an iPod, iPhone or iPad. (You can add/remove/change the HTTP_USER_AGENT lines to your liking if you only want to disable it on iPad or have it include another platform like Android or whatever you like)
If you use WPTouch and would like to disable Shadowbox-JS *only* when the user is viewing it under the mobile theme, and have it re-enable when they view the full site (which is kind of pointless as Shadowbox still won’t work properly on any iDevice) but if you want it to work this way, you’ll first need to add the iPad User Agent to the WPTouch “wptouch.php” file (otherwise the mobile theme will not display when viewing on an iPad). Edit around line 242 of the “wptouch.php” file and add the iPad user agent to the $useragents array:
"iPad", // Apple iPad
Now edit the “shadowbox-js.php” file and (at line 168) look for the line:
} else {
if ( @include ( dirname ( __FILE__ ) . '/inc/frontend.php' ) ) { $ShadowboxFrontend = new ShadowboxFrontend (); }
}
and replace it with the following:
} else {
if ( @include ( dirname ( __FILE__ ) . '/inc/frontend.php' ) ) { // detect if iPhone/iPad/iPod and disable shadowbox if true
if (strpos($_SERVER['HTTP_USER_AGENT'],"iPhone") | strpos($_SERVER['HTTP_USER_AGENT'],"iPad") | strpos($_SERVER['HTTP_USER_AGENT'],"iPod")) { include ('./wp-content/plugins/wptouch/wptouch.php');
if ( bnc_is_iphone() && $wptouch_plugin->desired_view == 'normal' ) { $ShadowboxFrontend = new ShadowboxFrontend (); }
}
else { $ShadowboxFrontend = new ShadowboxFrontend (); }
// end detection
}
And that should do it.
Enjoy.