Plugin Directory

Changeset 1399441


Ignore:
Timestamp:
04/19/2016 02:38:42 PM (10 years ago)
Author:
Netbiscuits
Message:

adding get method to handle missing params

Location:
netbiscuits-device-detection
Files:
2 edited
3 copied

Legend:

Unmodified
Added
Removed
  • netbiscuits-device-detection/tags/1.7/nb-dd.php

    r1388197 r1399441  
    33   Plugin Name: Netbiscuits Device Detection
    44   Description: Take advantage of the world's largest device database, within your server code, by adding Netbiscuits Device Detection to your site.  Make intelligent, device-specific adaptations to your pages before sending them to the user's device; send only what they need, and nothing they don't.
    5    Version: 1.6
     5   Version: 1.7
    66   Author: Netbiscuits GmbH
    77   Text Domain: nb_device_detection
     
    2020    *
    2121    * @since    1.0.0
    22     * @var      string
     22    * @var      string
    2323    */
    2424    protected $version = '2.0.0';
     
    208208        // make sure we have an account set-up
    209209        if ( !$client_key || !$account || !$profile ) {
    210             return;
     210            return;
    211211        }
    212212
     
    386386    * @since    1.0.0
    387387    */
     388    public function __get($property) {
     389        if (property_exists($this, $property)) {
     390            return $this->$property;
     391        } else {
     392            return "Unknown";
     393        }
     394    }
    388395    // browser parameteres
    389396    public function BrowserCanTelMakeCall() {
     
    472479            $devicetype = 'desktop';
    473480        }
    474         if (($devicetype === 'Mobile Phone' || $this->devicetype === 'MediaPlayer') && $this->isSmartphone()) {
     481        if (($devicetype === 'Mobile Phone' || $devicetype === 'MediaPlayer') && $this->isSmartphone()) {
    475482            $devicetype = 'smartphone';
    476483        }
    477         if (($devicetype === 'Mobile Phone' || $this->devicetype === 'MediaPlayer') && !$this->isSmartphone()) {
     484        if (($devicetype === 'Mobile Phone' || $devicetype === 'MediaPlayer') && !$this->isSmartphone()) {
    478485            $devicetype = 'featurephone';
    479486        }
     
    548555// For older code
    549556function dcs() {
    550     $dcs = dd::get_instance();
    551     $GLOBALS['DCS'] = $dcs;
    552     $GLOBALS['dd'] = $dcs;
    553     return $dcs;
     557    $dcs = dd::get_instance();
     558    $GLOBALS['DCS'] = $dcs;
     559    $GLOBALS['dd'] = $dcs;
     560    return $dcs;
    554561}
    555562
    556563// New API
    557564function dd() {
    558     $dd = DCS::get_instance();
    559     $GLOBALS['dd'] = $dd;
    560     return $dd;
     565    $dd = DCS::get_instance();
     566    $GLOBALS['dd'] = $dd;
     567    return $dd;
    561568}
  • netbiscuits-device-detection/tags/1.7/readme.txt

    r1388197 r1399441  
    66Requires at least: 3.1
    77Tested up to: 4.4.2
    8 Stable tag: 1.6
     8Stable tag: 1.7
    99Text Domain: nb_device_detection
    1010License: GPLv2 or later
     
    5151== Changelog ==
    5252
     53= 1.7
     54Added __get method to handle any missing params
     55
    5356= 1.5
    5457Cleaned dupe appearance in plugins admin screen, synced version numbers
  • netbiscuits-device-detection/trunk/nb-dd.php

    r1388197 r1399441  
    33   Plugin Name: Netbiscuits Device Detection
    44   Description: Take advantage of the world's largest device database, within your server code, by adding Netbiscuits Device Detection to your site.  Make intelligent, device-specific adaptations to your pages before sending them to the user's device; send only what they need, and nothing they don't.
    5    Version: 1.6
     5   Version: 1.7
    66   Author: Netbiscuits GmbH
    77   Text Domain: nb_device_detection
     
    2020    *
    2121    * @since    1.0.0
    22     * @var      string
     22    * @var      string
    2323    */
    2424    protected $version = '2.0.0';
     
    208208        // make sure we have an account set-up
    209209        if ( !$client_key || !$account || !$profile ) {
    210             return;
     210            return;
    211211        }
    212212
     
    386386    * @since    1.0.0
    387387    */
     388    public function __get($property) {
     389        if (property_exists($this, $property)) {
     390            return $this->$property;
     391        } else {
     392            return "Unknown";
     393        }
     394    }
    388395    // browser parameteres
    389396    public function BrowserCanTelMakeCall() {
     
    472479            $devicetype = 'desktop';
    473480        }
    474         if (($devicetype === 'Mobile Phone' || $this->devicetype === 'MediaPlayer') && $this->isSmartphone()) {
     481        if (($devicetype === 'Mobile Phone' || $devicetype === 'MediaPlayer') && $this->isSmartphone()) {
    475482            $devicetype = 'smartphone';
    476483        }
    477         if (($devicetype === 'Mobile Phone' || $this->devicetype === 'MediaPlayer') && !$this->isSmartphone()) {
     484        if (($devicetype === 'Mobile Phone' || $devicetype === 'MediaPlayer') && !$this->isSmartphone()) {
    478485            $devicetype = 'featurephone';
    479486        }
     
    548555// For older code
    549556function dcs() {
    550     $dcs = dd::get_instance();
    551     $GLOBALS['DCS'] = $dcs;
    552     $GLOBALS['dd'] = $dcs;
    553     return $dcs;
     557    $dcs = dd::get_instance();
     558    $GLOBALS['DCS'] = $dcs;
     559    $GLOBALS['dd'] = $dcs;
     560    return $dcs;
    554561}
    555562
    556563// New API
    557564function dd() {
    558     $dd = DCS::get_instance();
    559     $GLOBALS['dd'] = $dd;
    560     return $dd;
     565    $dd = DCS::get_instance();
     566    $GLOBALS['dd'] = $dd;
     567    return $dd;
    561568}
  • netbiscuits-device-detection/trunk/readme.txt

    r1388197 r1399441  
    66Requires at least: 3.1
    77Tested up to: 4.4.2
    8 Stable tag: 1.6
     8Stable tag: 1.7
    99Text Domain: nb_device_detection
    1010License: GPLv2 or later
     
    5151== Changelog ==
    5252
     53= 1.7
     54Added __get method to handle any missing params
     55
    5356= 1.5
    5457Cleaned dupe appearance in plugins admin screen, synced version numbers
Note: See TracChangeset for help on using the changeset viewer.