Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

Welcome, Guest.
Please login or register.
 
 
 
Forgot your password?

+- Forum Stats

Members
Total Members: 4214
Latest: thatsjustit
New This Month: 5
New This Week: 3
New Today: 1
Stats
Total Posts: 42791
Total Topics: 7455
Most Online Today: 60
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 64
Total: 64

Author Topic: Update detect mobile mode PHP5 to PHP7  (Read 4284 times)

0 Members and 1 Guest are viewing this topic.

Offline Rock Lee

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • Bomber Code ~ La nueva era del conocimiento
Update detect mobile mode PHP5 to PHP7
« on: November 16, 2019, 12:45:45 pm »
I am trying to move my site to PHP7.1 which did not give me major problems with the modifications that I use (I thought it would give more problems) I have only had problems with some that have to change the syntax but I am stuck with the following:

Code: [Select]
class uagent_info <== This is line 247
{
 var $useragent = "";
 var $httpaccept = "";

 //Let's store values for quickly accessing the same info multiple times.
 var $isIphone = 0; //Stores whether the device is an iPhone or iPod Touch.
 var $isAndroidPhone = 0; //Stores whether the device is a (small-ish) Android phone or media player.
 var $isTierTablet = 0; //Stores whether is the Tablet (HTML5-capable, larger screen) tier of devices.
 var $isTierIphone = 0; //Stores whether is the iPhone tier of devices.
 var $isTierRichCss = 0; //Stores whether the device can probably support Rich CSS, but JavaScript support is not assumed. (e.g., newer BlackBerry, Windows Mobile)
 var $isTierGenericMobile = 0; //Stores whether it is another mobile device, which cannot be assumed to support CSS or JS (eg, older BlackBerry, RAZR)

 // These strings cannot be used in isMobile because are way too generic
 var $genericStrings = array(
 'engineWebKit' => 'webkit',
 'deviceMacPpc' => 'macintosh', //Used for disambiguation
 'deviceWindows' => 'windows',
 'devicePpc' => 'ppc', //Stands for PocketPC
 'linux' => 'linux',
 'engineOpera' => 'opera', //Popular browser
 'deviceTablet' => 'tablet', //Generic term for slate and tablet devices
 );

 //Initialize some initial smartphone string variables.
 var $mobileStrings = array(
 'engineWebKit' => 'webkit',
 'deviceIphone' => 'iphone',
 'deviceIpod' => 'ipod',
 'deviceIpad' => 'ipad',
 'deviceMacPpc' => 'macintosh', //Used for disambiguation

 'deviceAndroid' => 'android',
 'deviceGoogleTV' => 'googletv',
 'deviceXoom' => 'xoom', //Motorola Xoom
 'deviceHtcFlyer' => 'htc_flyer', //HTC Flyer
 
 'deviceNuvifone' => 'nuvifone', //Garmin Nuvifone

 'deviceSymbian' => 'symbian',
 'deviceS60' => 'series60',
 'deviceS70' => 'series70',
 'deviceS80' => 'series80',
 'deviceS90' => 'series90',
 
 'deviceWinPhone7' => 'windows phone os 7',
 'deviceWinMob' => 'windows ce',
 'deviceWindows' => 'windows',
 'deviceIeMob' => 'iemobile',
 'devicePpc' => 'ppc', //Stands for PocketPC
 'enginePie' => 'wm5 pie', //An old Windows Mobile
 
 'deviceBB' => 'blackberry', 
 'vndRIM' => 'vnd.rim', //Detectable when BB devices emulate IE or Firefox
 'deviceBBStorm' => 'blackberry95',  //Storm 1 and 2
 'deviceBBBold' => 'blackberry97', //Bold 97x0 (non-touch)
 'deviceBBBoldTouch' => 'blackberry 99', //Bold 99x0 (touchscreen)
 'deviceBBTour' => 'blackberry96', //Tour
 'deviceBBCurve' => 'blackberry89', //Curve2
 'deviceBBTorch' => 'blackberry 98', //Torch
 'deviceBBPlaybook' => 'playbook', //PlayBook tablet
 
 'devicePalm' => 'palm',
 'deviceWebOS' => 'webos', //For Palm's line of WebOS devices
 'deviceWebOShp' => 'hpwos', //For HP's line of WebOS devices
 
 'engineBlazer' => 'blazer', //Old Palm browser
 'engineXiino' => 'xiino', //Another old Palm
 
 'deviceKindle' => 'kindle', //Amazon Kindle, eInk one.
 
 //Initialize variables for mobile-specific content.
 'vndwap' => 'vnd.wap',
 'wml' => 'wml', 
 
 //Initialize variables for other random devices and mobile browsers.
 'deviceTablet' => 'tablet', //Generic term for slate and tablet devices
 'deviceBrew' => 'brew',
 'deviceDanger' => 'danger',
 'deviceHiptop' => 'hiptop',
 'devicePlaystation' => 'playstation',
 'deviceNintendoDs' => 'nitro',
 'deviceNintendo' => 'nintendo',
 'deviceWii' => 'wii',
 'deviceXbox' => 'xbox',
 'deviceArchos' => 'archos',
 
 'engineOpera' => 'opera', //Popular browser
 'engineNetfront' => 'netfront', //Common embedded OS browser
 'engineUpBrowser' => 'up.browser', //common on some phones
 'engineOpenWeb' => 'openweb', //Transcoding by OpenWave server
 'deviceMidp' => 'midp', //a mobile Java technology
 'uplink' => 'up.link',
 'engineTelecaQ' => 'teleca q', //a modern feature phone browser
 
 'devicePda' => 'pda', //some devices report themselves as PDAs
 'mini' => 'mini',  //Some mobile browsers put 'mini' in their names.
 'mobile' => 'mobile', //Some mobile browsers put 'mobile' in their user agent strings.
 'mobi' => 'mobi', //Some mobile browsers put 'mobi' in their user agent strings.
 
 //Use Maemo, Tablet, and Linux to test for Nokia's Internet Tablets.
 'maemo' => 'maemo',
 'linux' => 'linux',
 'qtembedded' => 'qt embedded', //for Sony Mylo and others
 'mylocom2' => 'com2', //for Sony Mylo also
 
 //In some UserAgents, the only clue is the manufacturer.
 'manuSonyEricsson' => 'sonyericsson',
 'manuericsson' => 'ericsson',
 'manuSamsung1' => 'sec-sgh',
 'manuSony' => 'sony',
 'manuHtc' => 'htc', //Popular Android and WinMo manufacturer

 //In some UserAgents, the only clue is the operator.
 'svcDocomo' => 'docomo',
 'svcKddi' => 'kddi',
 'svcVodafone' => 'vodafone',
 );

I mark this: PHP Deprecated:  Methods with the same name as their class will not be constructors in a future version of PHP; uagent_info has a deprecated constructor in /home/public_html/foro/Sources/Subs-mobile.php on line 247

I understand this in the form of declaring the variable will not have more compatibility with the new branch but I tried to implement it without success, I was giving code error when trying how it is in the php documentation or it does not detect the cellular part. Any ideas where I can look or can you help me with this? Thank you for reading.


Regards!

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16233
    • View Profile
Re: Update detect mobile mode PHP5 to PHP7
« Reply #1 on: November 16, 2019, 06:44:33 pm »
It needs a proper constructor.
Do you have the whole file to share
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Rock Lee

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • Bomber Code ~ La nueva era del conocimiento
Re: Update detect mobile mode PHP5 to PHP7
« Reply #2 on: November 16, 2019, 06:57:21 pm »
Of course I attach it now

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16233
    • View Profile
Re: Update detect mobile mode PHP5 to PHP7
« Reply #3 on: November 16, 2019, 07:04:39 pm »
Try this file.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/
Like Like x 1 Love Love x 1 View List

Offline Rock Lee

  • Jr. Member
  • **
  • Posts: 58
    • View Profile
    • Bomber Code ~ La nueva era del conocimiento
Re: Update detect mobile mode PHP5 to PHP7
« Reply #4 on: November 16, 2019, 07:18:13 pm »
Perfect and now I understand what is failing, thank you very much for the help! :)


Regards!

Offline Plus

  • Member
  • *
  • Posts: 3
    • View Profile
Re: Update detect mobile mode PHP5 to PHP7
« Reply #5 on: March 05, 2020, 10:51:13 am »

Offline SMFHacks

  • Administrator
  • Hero Member
  • *****
  • Posts: 16233
    • View Profile
Re: Update detect mobile mode PHP5 to PHP7
« Reply #6 on: March 05, 2020, 10:52:49 am »
Only customers can see attachments on the forum currently.
Get your Forum Ranked! at https://www.forumrankings.net - find out how your forum compares with others!

Like What I do? Support me at https://www.patreon.com/vbgamer45/

Offline Plus

  • Member
  • *
  • Posts: 3
    • View Profile
Re: Update detect mobile mode PHP5 to PHP7
« Reply #7 on: March 05, 2020, 11:19:05 am »
sorry the mod public thx again

 

Related Topics

  Subject / Started by Replies Last post
4 Replies
3587 Views
Last post February 01, 2013, 09:32:20 am
by amwebby
1 Replies
4298 Views
Last post August 30, 2013, 08:46:57 am
by SMFHacks
1 Replies
3463 Views
Last post October 14, 2014, 09:35:43 am
by Labradoodle-360
1 Replies
4096 Views
Last post May 25, 2017, 01:15:53 pm
by shuban
6 Replies
3437 Views
Last post May 18, 2017, 02:58:25 pm
by balon

+- Recent Topics

prettyurls - TroubleShooting.wiki by thatsjustit
March 24, 2023, 07:56:39 pm

Download Gallery Option by SMFHacks
March 23, 2023, 09:34:02 am

Lost attachments by pete
March 22, 2023, 10:24:17 am

Additional Permissions by mickjav
March 18, 2023, 05:21:23 am

[Mod]Discord Web Hooks by SMFHacks
March 17, 2023, 08:48:30 am

Site upgrade to 2.1 by SMFHacks
March 12, 2023, 08:51:19 am

Theme/CSS design wanted by mickjav
March 11, 2023, 12:10:11 pm

Category Images by Anmer
March 10, 2023, 06:20:04 am

DownloadsPro - Topic Link by Anmer
March 08, 2023, 03:18:05 pm

Bulk File Import by SMFHacks
March 08, 2023, 07:56:23 am

Powered by EzPortal