test
Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • q8xbox Friend
    #185830

    Hello,

    I have create new template for mobile in the link below and I want when the user enter the site using mobile redirect him to the new template. How can I do that ?!

    http://www.s3rwa.net/wordpress

    Regards,

    Ninja Lead Moderator
    #486584

    Many ways to work with it but you can use php code

    Open index.php on ROOT path
    find

    require_once JPATH_BASE.'/includes/framework.php';
    change to


    require_once JPATH_BASE.'/includes/framework.php';
    require_once ( JPATH_BASE .DS.'libraries'.DS.'joomla'.DS.'factory.php' );
    jimport( 'joomla.environment.browser' );

    $browser = &JBrowser::getInstance();
    if($browser->isMobile())
    {
    /*Your code place here*/
    header('Location: http://www.s3rwa.net/wordpress/');
    }

    q8xbox Friend
    #486685

    Thanks Ninja Lead but it does not work for me…?!

    q8xbox Friend
    #486730

    any help. please ?!

    Ninja Lead Moderator
    #486801

    <em>@q8xbox 364811 wrote:</em><blockquote>any help. please ?!</blockquote>

    Please pm me url, admin access and ftp access, I shall check it for you

    q8xbox Friend
    #487217

    Does it work or not…?!

    Ninja Lead Moderator
    #487305

    <em>@q8xbox 365405 wrote:</em><blockquote>Does it work or not…?!</blockquote>

    I helped you add external code check device browser on your site.


    require_once 'Mobile_Detect.php';
    $detect = new Mobile_Detect;
    $deviceType = ($detect->isMobile() ? ($detect->isTablet() ? 'tablet' : 'phone') : 'computer');
    if($deviceType!='computer')
    {
    /*Your code place here*/
    header('Location: http://www.s3rwa.net/mobile');
    }

    It’s working now, please check it and let me know the result

    q8xbox Friend
    #487361

    Thanks Ninja Lead, every thing work fine now 😀

    q8xbox Friend
    #488625

    Hello,

    Can i add button on mobile template to switch to Desktop Template or not ?!

    Ninja Lead Moderator
    #488689

    <em>@q8xbox 367258 wrote:</em><blockquote>Hello,

    Can i add button on mobile template to switch to Desktop Template or not ?!</blockquote>

    You can do that and i appreciate the hard work on your site, try this :

    + Go link http://www.s3rwa.net/mobile and add button Switch to Desktop Template with link format
    <blockquote>http://www.s3rwa.net?ui=desktop</blockquote>

    + Open code http://www.s3rwa.net/index.php running Desktop Template
    Add condition ui = desktop do not redirect to mobile site

    You can hire a developer for getting this customization done.

    q8xbox Friend
    #488714

    Thanks Niinja Lead,

    I really don’t don’t know any developer. Is it possible to help out if your time allows it. please ?!

    Regards,

Viewing 11 posts - 1 through 11 (of 11 total)

This topic contains 11 replies, has 2 voices, and was last updated by  q8xbox 11 years, 9 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum