コード例 #1
0
ファイル: player.php プロジェクト: robjcordes/nexnewwp
 public function buildPlayer($profileid = 1, $videoid = 1, $autodetect = 1)
 {
     global $wpdb;
     $profile = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "allvideogallery_profiles WHERE id=" . $profileid);
     $this->width = $profile->width;
     $this->height = $profile->height;
     if (isset($_GET['slg']) && $autodetect == 1) {
         $slug = $_GET['slg'];
         $video = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "allvideogallery_videos WHERE slug='{$slug}'");
         $videoid = $video->id;
     } else {
         $video = $wpdb->get_row("SELECT * FROM " . $wpdb->prefix . "allvideogallery_videos WHERE  id=" . $videoid);
     }
     if ($video->type == 'thirdparty') {
         $result = '<div style="width:' . $this->width . 'px; height:' . $this->height . 'px;">';
         $result .= $video->thirdparty;
         $result .= '</div>';
     } else {
         $arr_params = array();
         $custpage = $profile->custom_page_url ? $profile->custom_page_url : $this->curPageURL();
         if (isset($_GET['catid'])) {
             $arr_params['catid'] = $_GET['catid'];
         }
         if (isset($_GET['sort'])) {
             $arr_params['sort'] = $_GET['sort'];
         }
         $flashvars = 'base=' . get_option('siteurl') . '&wp=1&vid=' . $videoid . '&pid=' . $profileid . '&page=' . urlencode(@add_query_arg($arr_params, $custpage));
         $detect = new IsMobile();
         $result = $detect->isMobile() ? $this->gethtmlplayer($profile, $video) : $this->getflashplayer($profile, $flashvars);
     }
     $this->updatehits($video->slug);
     $cust_class = $profile->custom_player_class ? $profile->custom_player_class : 'avs_player';
     $output = '<style type="text/css">' . "\n";
     $output .= $profile->player_css . "\n";
     $output .= '</style>' . "\n";
     $output .= '<div class="' . $cust_class . '" style="width:' . $this->width . 'px;">' . "\n";
     if ($profile->title) {
         $output .= '<div class="title">' . $video->title . '</div>' . "\n";
     }
     if ($profile->category) {
         $output .= '<div class="category"><strong>Category : </strong>' . $video->category . '</div>' . "\n";
     }
     if ($profile->hits) {
         $output .= '<div class="hits"><strong>Hits : </strong>' . $video->hits . '</div>' . "\n";
     }
     $output .= '<div style="clear:both;"></div>' . "\n";
     $output .= $result . "\n";
     if ($video->description) {
         $output .= '<div class="description">' . $video->description . '</div>' . "\n";
     }
     $output .= '</div>' . "\n";
     return $output;
 }
コード例 #2
0
<?php

session_start();
require_once 'config.php';
require_once 'framework.php';
require_once 'php/ismobile.class.php';
@($fw = new scaleDB(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB));
@($ismobi = new IsMobile());
if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION)) {
    include_once 'header.php';
    ?>
		<section>
			<form action="_changePassword.php" method="post">
				<table <?php 
    if ($ismobi->CheckMobile()) {
        echo 'class="table-style"';
    }
    ?>
>
					<thead>
						<tr>
							<td colspan="2"><h2>User Password Change</h2></td>
						</tr>
					</thead>
					<tbody>
						<tr>
							<td>
								Old Password: 
							</td>
							<td>
								<input name="oldPass" type="password" size="15" maxlength="25" required />
コード例 #3
0
<?php

// basic require file...
require_once "ismobile.class.php";
echo '<h1> Example 1 - is mobile device or not? </h1>';
$ismobi = new IsMobile();
if ($ismobi->CheckMobile()) {
    echo 'Your mobile device is a ' . $ismobi->GetMobileDevice() . '? ';
} else {
    echo "It isn't a mobile device...";
}
echo '<br /><br />';
echo '<h1>Example 2 - Test User Agents</h1>';
$agents_test = array("Nokia6600/1.0 (4.09.1) SymbianOS/7.0s Series60/2.0 Profile/MIDP-2.0 Configuration/CLDC-1.0", "BlackBerry8330/4.3.0 Profile/MIDP-2.0 Configuration/CLDC-1.1 VendorID/105", "Opera/8.01 (J2ME/MIDP; Opera Mini/3.0.6306/1528; en; U; ssr)", "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3", "Mozilla/5.0 (Linux; U; Android 1.6; en-it; HTC_TATTOO_A3288 Build/DRC79) AppleWebKit/528.5+ (KHTML, like Gecko) Version/3.1.2 Mobile Safari/525.20.1", "Mozilla/5.0(iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10");
// test wap mobile browser
$http_accept = array("text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "application/vnd.rim.html,text/html,application/xhtml+xml,application/vnd.wap.xhtml+xml,text/vnd.sun.j2me.app-descriptor,image/vnd.rim.png,image/jpeg,application/x-vnd.rim.pme.b,application/vnd.rim.ucs,image/gif;anim=1,application/vnd.rim.jscriptc;v=0-8-8,application/x-javascript,application/vnd.rim.css;v=1,text/css;media=screen,application/vnd.wap.wmlc;q=0.9,application/vnd.wap.wmlscriptc;q=0.7,text/vnd.wap.wml;q=0.7,*/*;q=0.5");
$ismobiuser = new isMobile($agents_test[rand(0, 5)], $http_accept[rand(0, 1)]);
if ($ismobiuser->CheckMobile()) {
    $mobileDevice = $ismobiuser->GetMobileDevice();
    echo 'User Agent: ' . $ismobiuser->GetUserAgent();
    echo '<br /><br />';
    echo 'Mobile Device: ' . $mobileDevice;
}
コード例 #4
0
ファイル: viewScale.php プロジェクト: Auzarius/php-inshop-cms
<?php

session_start();
require_once 'config.php';
require_once 'framework.php';
require_once 'php/ismobile.class.php';
/*header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
	header("Cache-Control: post-check=0, pre-check=0", false);
	header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
	header("Pragma: no-cache"); // HTTP/1.0
	header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");*/
@($fw = new scaleDB(SQL_HOST, SQL_USER, SQL_PASS, SQL_DB));
@($ismobi = new IsMobile());
if ($fw->isLoggedIn($_SESSION) && $fw->isValidUser($_SESSION)) {
    include 'header.php';
    if ($_SERVER['REQUEST_METHOD'] == "POST") {
        if (isset($_POST['submit'])) {
            if ($_POST['submit'] == "Edit Scale" && $fw->isAdmin($_SESSION)) {
                ?>
				
				<h2>Scale Edit</h2>
			<?php 
                $id = "";
                $username = $_SESSION['USER']['username'];
                if (isset($_GET['id'])) {
                    $id = $_GET['id'];
                } else {
                    die("Could not get the scale ID from the form, please notify an admin");
                }
                if (!($scale_information = $fw->getScale($id))) {
                    die;