Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4269
Latest: Gatux
New This Month: 0
New This Week: 0
New Today: 0
Stats
Total Posts: 43594
Total Topics: 7568
Most Online Today: 128
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 0
Guests: 82
Total: 82

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

0 Members and 1 Guest are viewing this topic.

Offline Rock Lee

  • Bad Emails DO NOT EMAIL
  • 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: 16585
    • 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

  • Bad Emails DO NOT EMAIL
  • 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: 16585
    • 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

  • Bad Emails DO NOT EMAIL
  • 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: 16585
    • 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
13133 Views
Last post February 01, 2013, 09:32:20 am
by amwebby
1 Replies
12902 Views
Last post October 14, 2014, 09:35:43 am
by Labradoodle-360
1 Replies
5279 Views
Last post May 25, 2017, 01:15:53 pm
by shuban
6 Replies
4831 Views
Last post May 18, 2017, 02:58:25 pm
by balon
4 Replies
26176 Views
Last post September 15, 2023, 08:42:24 am
by Ghost

+- Recent Topics

December 2024 Sale! by SMFHacks
December 02, 2024, 10:30:38 pm

Denying members some admin settings by rickk
November 17, 2024, 12:02:55 pm

Weird setup by SMFHacks
November 07, 2024, 06:37:41 am

Restoring a deleted photo by Monocero
November 01, 2024, 04:23:56 am

Gallery Pro reinstalation by Lirorobert
October 14, 2024, 01:43:43 am

Move picture from main gallery to user gallery by SMFHacks
October 11, 2024, 09:11:00 pm

quoting part of message by Lirorobert
October 04, 2024, 03:21:40 pm

Does SMF Gallery support by SMFHacks
October 02, 2024, 06:14:26 am

Item count on Gallery Tab shows double by SMFHacks
September 26, 2024, 12:59:20 pm

Forum post missing when image over 4000x pixels is uploaded to gallery by Michel68
September 24, 2024, 01:37:17 pm

Powered by EzPortal