Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 Programming Discussions
Register FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 01-19-2017, 10:56 PM
SilverBoy SilverBoy is offline
 
Join Date: Feb 2002
Location: Libya
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Asset Manager and Mobile Browsing!!

Hi

I notice that no one can use asset manager to upload files if he browsing using his mobile phone !!

If this is a known issue, is there any trick to solve it?

Thanks in advance.
Reply With Quote
  #2  
Old 01-19-2017, 11:00 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by SilverBoy View Post
...If this is a known issue, is there any trick to solve it?
Yes...put away the toy and log on using a computer. :erm:
Reply With Quote
Благодарность от:
SilverBoy
  #3  
Old 01-19-2017, 11:03 PM
SilverBoy SilverBoy is offline
 
Join Date: Feb 2002
Location: Libya
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
Yes...put away the toy and log on using a computer. :erm:
LooooooooL

Really is there any solution? I'm trying to get new responsive theme but the designer asked me to disable asset manager because it will not work with mobiles, and after check it with my current style I found what he say is right !!
Reply With Quote
  #4  
Old 01-22-2017, 01:13 AM
SilverBoy SilverBoy is offline
 
Join Date: Feb 2002
Location: Libya
Posts: 497
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think in newattacment.php file, if we can add check if the user uses mobile to browse then disable asset manager before this line

PHP Code:
$templater->register('asset_enable', $vbulletin->userinfo['vbasset_enable'] ? $vbulletin->options['vbasset_enable'] : 0); 
Is it right guessing? if that then how I can make the check for mobile?

--------------- Added [DATE]1485058458[/DATE] at [TIME]1485058458[/TIME] ---------------

I found the half of the solution, here is the check code from include/init.php file
PHP Code:
// Test mobile browser
$mobile_browser = false;
$mobile_browser_advanced = false;

    if (stripos($_SERVER['HTTP_USER_AGENT'], 'windows') === false OR preg_match('/(Windows Phone OS|htc)/i', strtolower($_SERVER['HTTP_USER_AGENT'])))
    {
        if (
            preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android|Windows Phone OS|htc)/i', strtolower($_SERVER['HTTP_USER_AGENT']))
            OR
            stripos($_SERVER['HTTP_ACCEPT'],'application/vnd.wap.xhtml+xml') !== false
            OR
            ((isset($_SERVER['HTTP_X_WAP_PROFILE']) OR isset($_SERVER['HTTP_PROFILE'])))
            OR
            stripos($_SERVER['ALL_HTTP'],'OperaMini') !== false
        )
        {
            $mobile_browser = true;
        }
        // This array is big and may be bigger later on. So we move it to a second if.
        else if (in_array(
                    strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4)),
                    array(
                    'w3c ','acs-','alav','alca','amoi','audi','avan','benq','bird','blac',
                    'blaz','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
                    'ipaq','java','jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
                    'maui','maxo','midp','mits','mmef','mobi','mot-','moto','mwbp','nec-',
                    'newt','noki','oper','palm','pana','pant','phil','play','port','prox',
                    'qwap','sage','sams','sany','sch-','sec-','send','seri','sgh-','shar',
                    'sie-','siem','smal','smar','sony','sph-','symb','t-mo','teli','tim-',
                    'tosh','tsm-','upg1','upsi','vk-v','voda','wap-','wapa','wapi','wapp',
                    'wapr','webc','winw','winw','xda ','xda-')
                )
            )
        {
            $mobile_browser = true;
            if(strtolower(substr($_SERVER['HTTP_USER_AGENT'], 0, 4)) == 'oper' AND  preg_match('/(linux|mac)/i', $_SERVER['HTTP_USER_AGENT']))
            {
                $mobile_browser = false;
            }
        }
    }

    if (
        $mobile_browser
            AND
        preg_match('/(ipad|ipod|iphone|blackberry|android|pre\/|palm os|palm|hiptop|avantgo|plucker|xiino|blazer|elaine|Windows Phone OS|htc)/i', strtolower($_SERVER['HTTP_USER_AGENT']))
    )
    {
        $mobile_browser_advanced = true;
    } 
The problem is that I was mistaken about newattacment.php file it is not the responsible about checking if the asset manager enabled or not.

Any hint?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:47 AM.


Powered by vBulletin® Version 3.9.0
Copyright ©2000 - 2017, vBulletin Solutions Inc.