vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.7 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=228)
-   -   Forum Display Enhancements - Mobile Phone / iPhone / PDA Detection and Style Assignment (https://vborg.vbsupport.ru/showthread.php?t=173239)

BGObsession 05-29-2009 12:56 AM

Thanks - I'll give that a try - and let me just say, its so nice to have someone help answer questions on their mod as conscientiously as you do - seriously, that's great. Thanks! I'll let you know if that takes care of it....

BGObsession 05-29-2009 01:24 AM

Worked like a charm Dartho :) Now I've got a neat, utilitarian, easy to use, clean mobile skin. Thanks again!

CR_TurboGuy 05-29-2009 09:03 PM

For those that want to allow the user to override the mobile style, this is what I've done on my board:

1.) Add a new profile field that allows them to set the behavior of visiting the site from a mobile device. It either uses the standard style, or the mobile style. I made it a 'Single Selection Menu', then set the two options to be 'Use Standard Version' & 'Use Mobile Version', with the default set to 'Yes, but No First Blank Option'. It's not a required field, it is editable by the user, it is a private field, it's not searchable on the Members List, and it's not shown on the member list. For the display page, I set it to 'Options: Thread Viewing' so that it shows in that section of the options page.

2.) Next, I added a few lines of code to the 'Mobile Detection' product. The code is:
Code:

if($vbulletin->userinfo['field8'] == 'Use Standard Version')
    {
          $custom1=1;
    }

Where 'field8' is what field number my custom user field is, and 'Use Standard Version' is the option to look for. If you translate the phrases to another language, you'll need to change that. You also need to change the field number to match your custom field number.
I added the above code snippet in two places, once after this block:
Code:

$exceptbrowsers = explode(",",$vbulletin->options['brows_exceptions']);
  if(preg_match('/('.implode('|', $exceptbrowsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
    {
        $except_browser=1;
    }

and once after this block:
Code:

if ($vbulletin->options['custom1_skin_enabled'] == 1)
    {
    $custom1agents = explode(",",$vbulletin->options['custom1_skin_agent']);
    if(preg_match('/('.implode('|', $custom1agents).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
      {
          $custom1=1;
      }
    }

Oh, I forgot to mention, this will use the style chosed for 'Custom/User Defined Devices Style?' in the settings for this product. I'm sure this could be extended to allow using the users default style, but on my board, there's only three styles, the 'regular' style & the mobile style for regular mobiles & one for iPhones. None are user selectable.

I'm attaching a screenshot of my new profile field, as well as a copy of the modified Mobile Device Detection & Assignment xml file. Let me know if you have any questions.

--JOsh

testbot 06-03-2009 07:59 PM

anyone know how to add google mobile ads (AdSense for Mobile Content) to this template?

dartho 06-03-2009 09:05 PM

Check here: https://vborg.vbsupport.ru/showthrea...19#post1531419

ShackMaster 06-18-2009 03:11 AM

Thanks for adding that option JOsh... I just had two members ask me about this tonight. This should really be part of the original install.

FuegoMCS 06-18-2009 04:39 PM

Anyone tested this under 3.8.x yet?

abrecher 06-18-2009 11:21 PM

Quote:

Originally Posted by dartho (Post 1819177)
I had look at the source - the blogs addon is adding in a dropdown menu for blogs which a desktop browser is smart enough to know not to display, but the mobile browser - not so smart.

If you delete the contents of the blog_navbar_link_menu template in your mobile style, that should stop it showing up

Awesome! I was going insane trying to fix this issue.

rcadden 06-21-2009 09:12 PM

This is working just fine with v3.8.3 - though if you've got ads running, it seems to stretch things out for banners.

dartho 06-21-2009 09:42 PM

That would be a style issue - nothing to do withthis add-on


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

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01296 seconds
  • Memory Usage 1,741KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete