Facebook  Twitter 

SMFHacks.com

+-

SMFHacks.com

+- User Information

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

+- Forum Stats

Members
Total Members: 4253
Latest: Ineedsmfhelp
New This Month: 1
New This Week: 0
New Today: 0
Stats
Total Posts: 43242
Total Topics: 7516
Most Online Today: 126
Most Online Ever: 2482
(April 09, 2011, 07:02:45 pm)
Users Online
Members: 1
Guests: 102
Total: 103

Author Topic: Update detect mobile mode PHP5 to PHP7  (Read 13866 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: 16428
    • 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: 16428
    • 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: 16428
    • 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
12815 Views
Last post February 01, 2013, 09:32:20 am
by amwebby
1 Replies
12630 Views
Last post October 14, 2014, 09:35:43 am
by Labradoodle-360
1 Replies
5057 Views
Last post May 25, 2017, 01:15:53 pm
by shuban
6 Replies
4509 Views
Last post May 18, 2017, 02:58:25 pm
by balon
4 Replies
25627 Views
Last post September 15, 2023, 08:42:24 am
by Ghost

+- Recent Topics

is it possible to add support for odysee.com by SMFHacks
March 13, 2024, 10:53:28 pm

Request for admin notification by davejo
March 10, 2024, 01:31:59 am

I need help with torrent upload by Ineedsmfhelp
March 09, 2024, 10:01:13 pm

an idea for new mod (( content type with different display )) by SMFHacks
February 27, 2024, 01:36:27 pm

[Mod] RSS Feed Poster by SMFHacks
February 27, 2024, 11:57:18 am

find duplicate pictures by fvlog19
February 14, 2024, 02:22:40 pm

Error uploading video. by SMFHacks
February 08, 2024, 02:04:16 pm

Gallery icon as last added image by fvlog19
February 01, 2024, 01:04:56 pm

User Gallery Feature: move / bulk move images by SMFHacks
January 30, 2024, 05:48:25 pm

In the future it may be for smf 2.1.x? by smithloo
January 30, 2024, 12:55:34 am

Powered by EzPortal