$greentag_bg = "url(../cs-images/green-tag.png) no-repeat top left"; $bluetag_bg = "url(../cs-images/blue-tag.png) no-repeat top left"; $orangetag_bg = "url(../cs-images/orange-tag.png) no-repeat top left"; $bluetag_end_bg = "url(../cs-images/blue-tag-end.png) no-repeat top right"; $greentag_end_bg = "url(../cs-images/green-tag-end.png) no-repeat top right"; $orangetag_end_bg = "url(../cs-images/orange-tag-end.png) no-repeat top right"; // Checkout $add_address_button_bg = "url(../cs-images/mainimages/addaddress_bg.gif) no-repeat top right"; $add_address_button_padding = 9; $finishedorderbox_height = 200; // Fullscreen - ( header-height + footer-height ) // Authors $author_width = $column_middle_width / 3 - 2 * $column_space; // Footer $footer_icons_bg = "url(../cs-images/footerimages/footer_icons_bg.gif)"; $FooterCategoriesList_width = 480; $RSSicon_width = 22; // Links $links_border_color = "#e2e2e2"; $links_width = $column_middle_width - 2 * $column_space; function is_chrome() { return eregi("chrome", $_SERVER['HTTP_USER_AGENT']); } if (is_chrome()) { $button_padding = "2px 0px 3px 10px"; $generalbutton_padding = "2px 10px 2px 0px"; } else { $button_padding = "1px 0px 3px 10px"; $generalbutton_padding = "2px 10px 3px 0px"; }
<div style="padding:5px; margin:10px 0; border-radius:5px; background:#E6E6E6"> <p>Test for specific versions of a browser:</p> <?php echo '<pre>if(is_ie(11)) = '; if (is_ie(11)) { echo TRUE; } echo '</pre>'; echo '<pre>if(is_firefox(35)) = '; if (is_firefox(35)) { echo TRUE; } echo '</pre>'; echo '<pre>if(is_chrome(44)) = '; if (is_chrome(44)) { echo TRUE; } echo '</pre>'; ?> </div> <?php } } ?> </div> </div> </div> <div id="secondary"> </div>
echo '<span class="itag">' . $avail_formats[$i]['itag'] . '</span> '; if ($config['VideoLinkMode'] == 'direct' || $config['VideoLinkMode'] == 'both') { $directlink = explode('.googlevideo.com/', $avail_formats[$i]['url']); $directlink = 'http://redirector.googlevideo.com/' . $directlink[1] . ''; echo '<a href="' . $directlink . '&title=' . $cleanedtitle . '" class="mime">' . $avail_formats[$i]['type'] . '</a> '; } else { echo '<span class="mime">' . $avail_formats[$i]['type'] . '</span> '; echo '<small>(' . $avail_formats[$i]['quality']; } if ($config['VideoLinkMode'] == 'proxy' || $config['VideoLinkMode'] == 'both') { echo ' / ' . '<a href="download.php?mime=' . $avail_formats[$i]['type'] . '&title=' . urlencode($my_title) . '&token=' . base64_encode($avail_formats[$i]['url']) . '" class="dl">download</a>'; } echo ')</small> ' . '<small><span class="size">' . formatBytes(get_size($avail_formats[$i]['url'])) . '</span></small>' . '</li>'; } echo '</ul><small>Note that you initiate download either by clicking video format link or click "download" to use this server as proxy.</small>'; if ($config['feature']['browserExtensions'] == true && is_chrome()) { echo '<a href="ytdl.user.js" class="userscript btn btn-mini" title="Install chrome extension to view a \'Download\' link to this application on Youtube video pages."> Install Chrome Extension </a>'; } ?> </body> </html> <?php } else { /* In this else, the request didn't come from a form but from something else * like an RSS feed. * As a result, we just want to return the best format, which depends on what * the user provided in the url. * If they provided "format=best" we just use the largest. * If they provided "format=free" we provide the best non-flash version
require_once __DIR__ . '/sandbox/system/init.php'; /* * Determine and execute a generic method of implementation */ switch (PLATFORM_ENGINE) { case 'object': // using object-orientation <strict adherence> require_once PLATFORM_SANDBOX_SYSTEM_CLASSES_PATH . DS . 'platform.php'; $platform = new Platform(); break; case 'objects': // using object-orientation <stdlib re-use> require_once PLATFORM_SANDBOX_SYSTEM_CLASSES_PATH . DS . 'standards/platform.php'; $platform = new Platform(); break; case 'stdlib': // using procedural <optimal use> // using procedural <optimal use> default: require_once PLATFORM_SANDBOX_SYSTEM_FUNCTIONS_PATH . DS . 'platform.php'; platform(); break; } /** * Detect browser type */ if (is_chrome() || is_chromium() || is_safari()) { // do nothing } else { //redirect_to('http://www.google.com'); }
echo get_browser_version(); echo '</pre>'; ?> </div> <div style="padding:5px; margin:10px 0; border-radius:5px; background:#E6E6E6"> <p>Test for specific browsers:</p> <?php echo '<pre>is_firefox() = '; echo is_firefox(); echo '</pre>'; echo '<pre>is_safari() = '; echo is_safari(); echo '</pre>'; echo '<pre>is_chrome() = '; echo is_chrome(); echo '</pre>'; echo '<pre>is_opera() = '; echo is_opera(); echo '</pre>'; echo '<pre>is_ie() = '; echo is_ie(); echo '</pre>'; ?> </div> <div style="padding:5px; margin:10px 0; border-radius:5px; background:#E6E6E6"> <p>Test for mobile/iphone/ipad:</p> <?php echo '<pre>is_mobile() = '; echo is_mobile();
function get_device_type() { $device_type = 'Unknown'; switch (true) { // Windows case is_windows() && is_firefox(): $device_type = 'Windows Firefox'; break; case is_windows() && is_chromium(): $device_type = 'Windows Chromium'; break; case is_windows() && is_chrome(): $device_type = 'Windows Chrome'; break; case is_windows() && is_safari(): $device_type = 'Windows Safari'; break; case is_windows() && is_opera(): $device_type = 'Windows Opera'; break; case is_windows() && is_ie(): $device_type = 'Windows IE'; break; // Apple Macintosh // Apple Macintosh case is_macintosh() && is_firefox(): $device_type = 'Apple Firefox'; break; case is_macintosh() && is_chromium(): $device_type = 'Apple Chromium'; break; case is_macintosh() && is_chrome(): $device_type = 'Apple Chrome'; break; case is_macintosh() && is_safari(): $device_type = 'Apple Safari'; break; case is_macintosh() && is_opera(): $device_type = 'Apple Opera'; break; case is_macintosh() && is_ie(): $device_type = 'Apple IE'; break; // Ubuntu // Ubuntu case is_ubuntu() && is_firefox(): $device_type = 'Ubuntu Firefox'; break; case is_ubuntu() && is_chromium(): $device_type = 'Ubuntu Chromium'; break; case is_ubuntu() && is_chrome(): $device_type = 'Ubuntu Chrome'; break; case is_ubuntu() && is_safari(): $device_type = 'Ubuntu Safari'; break; case is_ubuntu() && is_opera(): $device_type = 'Ubuntu Opera'; break; case is_ubuntu() && is_ie(): $device_type = 'Ubuntu IE'; break; // Linux // Linux case is_linux() && is_firefox(): $device_type = 'Linux Firefox'; break; case is_linux() && is_chromium(): $device_type = 'Linux Chromium'; break; case is_linux() && is_chrome(): $device_type = 'Linux Chrome'; break; case is_linux() && is_safari(): $device_type = 'Linux Safari'; break; case is_linux() && is_opera(): $device_type = 'Linux Opera'; break; case is_linux() && is_ie(): $device_type = 'Linux IE'; break; } return $device_type; }