function get_device_name()
{
    // Do the most exhaustive device detection possible; other method calls
    // may be used instead of DetectMobileLong if you want to target a narrower
    // class of devices.
    $mobile = new uagent_info();
    if ($mobile->DetectKindle()) {
        return 'Kindle';
    } elseif ($mobile->DetectKindleFire() || $mobile->DetectAmazonSilk()) {
        return 'Kindle Fire';
    } elseif ($mobile->DetectIpad()) {
        return 'iPad';
    } elseif ($mobile->DetectIphone()) {
        return 'iPhone';
    } elseif ($mobile->DetectMac()) {
        return 'Mac';
    } elseif ($mobile->DetectAndroidPhone()) {
        return 'Android Phone';
    } elseif ($mobile->DetectAndroidTablet()) {
        return 'Android Tablet';
    } elseif ($mobile->DetectBlackBerry()) {
        return 'BlackBerry';
    } elseif ($mobile->DetectGoogleTV()) {
        return 'Google TV';
    } elseif ($mobile->DetectIos()) {
        return 'iOS';
    } else {
        return 'PC';
    }
}
예제 #2
0
파일: script.php 프로젝트: nfreear/mQuiz
<?php

include_once "../config.php";
$uagent_obj = new uagent_info();
?>

function initPage(){
	mQ.initStore();
	<?php 
if (isLoggedIn()) {
    printf("mQ.store.set('username','%s');", $USER->username);
    printf("mQ.store.set('displayname','%s');", $USER->firstname . " " . $USER->lastname);
    printf("mQ.store.set('password','%s');", $USER->password);
}
if (!$uagent_obj->DetectIphone() && !$uagent_obj->DetectAndroidPhone()) {
    printf("mQ.store.set('source','%s');", $CONFIG->homeAddress);
}
?>
}


function addQuestion(){
	
	var qno = $('#questions > div').size()+1;
	
	var fb = $("<div class='formblock'></div>");
	var fl = $("<div class='formlabel'></div>").text("Question " +qno);
	fb.append(fl);
	var ff = $("<div class='formfield'></div>");
	ff.append("<textarea name='q"+qno+"' cols='80' rows='3' maxlength='300'></textarea>");
	ff.append("<div class='responses'>");