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

MissKalunji 07-04-2009 04:23 AM

question

The : Custom/User Defined Useragent String

how would i write it down?

example

Android
Opera Mini

Or do i have to put commas between them?

Thanks

MissKalunji 07-04-2009 04:36 AM

Something else i notice

once i enable this : Custom/User Defined Useragent String

it switches styles for EVERYTHING....Not just the lists that i put .....

Edit : it seems like it's because i wasn't precise enough with the String like i only put : Android...i twasn't working when i put HTC_Dream Mozilla...it worked fine...

Biker_GA 07-04-2009 04:47 AM

What have you selected for mobile phones in general? Remember, this FORCES mobile devices to use the particular style defined for your mobile style.

Now, if your PC users are also getting the mobile style, you need to check the mobile style settings and ensure you have the proper styles selected for your users.

MissKalunji 07-04-2009 04:51 AM

Yeah :) my mistake was i put a comma where i shouldn't have...and it messed up the entire settings

Thanks!

ShackMaster 08-04-2009 05:56 AM

Josh...

I just found a bug with the UserCP Mobile Style Detection. If the "Use Standard Style" is selected, which it is by default, the only the default style of the forum can be used for members.

For example: I have several styles that users can select from. The default is a fluid 100% style. An option is the fixed 1024px wide style. If I have "Use Standard Style" selected in the UserCP for the Mobile Style Detection, then changing the style from 100% fluid to any of the other fixed styles does not work. However, if I change the Mobile Style Detection to "Use Mobile Style", the other styles will work.

Reckon how we can fix this? Or maybe have it default to "Use Mobile Style" for all members, unless specifically selected.

Thanks!

dartho 08-04-2009 06:27 AM

SHack Master - look at this post: https://vborg.vbsupport.ru/showpost....&postcount=222 that may be the functionality you are after?

ShackMaster 08-04-2009 07:12 AM

So would I need the other mod by Josh if I use this?

ShackMaster 08-12-2009 02:26 AM

That does not fix my issue... actually has nothing to do with it.

I need to be able to make "Use Mobile Style" the default selection instead of "Use Standard Style".

dartho 08-12-2009 02:53 AM

You may want to contact Josh directly via PM as your issues are not to do with this modification.

The post I pointed you to has an altered product file which allows users of detected mobile devices to change to other styles if they wish and thus over-ride the detection/style enforcement.

This seems to be the functionality you were after?
eg:
  • Mobile phone user logs on, gets mobile style.
  • They can then choose to use any other style they want and will then be presented with that style from then on.
  • They can also choose to switch back to the mobile style if they wish.
  • This is device based, not user based so the same won't happen if they log on from a PC.

Quantnet 08-12-2009 03:05 AM

Yes, I'm after this modified auto detect/asign mod too ;)

ShackMaster 08-12-2009 03:12 AM

Okay... I see what you mean now. It is an alternative to Josh's mod and should not cause the effect that Josh's mod is causing. I got confused thinking it was something to use in addition to his mod... or maybe I was just confused period. I will try it... and thanks!

Chicago_VLNU_4s 08-13-2009 01:12 PM

installed on 3.8.2, works fine.

jbeam 08-18-2009 02:46 PM

I did a quick search but couldn't find it.

Anyone know how to make this work for the LG Dare?

MozyMac 08-23-2009 09:18 AM

really helpful

BadgerDog 08-25-2009 12:53 PM

Installed and thank you ... :up:

Amazing...

I'm not that good at the techie stuff with vBulletin, but following the instructions dartho gave for both this mod and these:

Extend and Customise "Mobile" Style Options Version: 0.0.10b
https://vborg.vbsupport.ru/showthread.php?t=182692

Mobile, Cell, Phone, PDA, iPhone Style Version: 0.0.10a
https://vborg.vbsupport.ru/showthread.php?t=182692

... I have this running just great for our collector's site.

I tried it from my iPhone 3.0 using Safari and it was terrific. I notice that I don't get pics, but I assume that's the reason for the speed.

Thank again dartho, much appreciated and this will sure be helpful for our members who are on the road.

Three questions:

1. Is there a specific selection for Blackberry (RIM) users?

2. Is there a way for a member who is on an iPhone to decide to use Safari and display the full vBulletin web site skin, just so he can perhaps look at a pic he wants to see?

3. Does this mobile skin support a speeded up view and access to the AdminCP function? I was nervous about trying that from my iPhone. :D


BTW, because if all our mods, I'm still running vBulletin 3.67pl1 and your code seems to work fine.

Regards,
Badger
:up:

BadgerDog 08-25-2009 04:21 PM

Quote:

Originally Posted by dartho (Post 1861059)
SHack Master - look at this post: https://vborg.vbsupport.ru/showpost....&postcount=222 that may be the functionality you are after?

Hi dartho.... :)

I'm trying to get this overide option to work as well....

I installed (imported) the "mobdetect-allow_change_b.xml", but it doesn't seem to let me switch skins from my iPhone. It just stays with the "mobile" skin regardless of what I select.

Also, if I want to un-install "mobdetect-allow_change_b.xml", to return my system to the state before I imported it, I can't seem to find it in my "product list" to un-install? Am I missing something?

Thanks for any help ...

Regards,
Badger

dartho 08-25-2009 10:25 PM

Badger - You can just re-install this addon from the product-mobdetect37.xml product file (the main one in the first post) and that will overwrite the other version.

As for your other questions:
1. No, however you could use the 'custom user agent' section to have a specific style for Blackberrys
2. No - with this add-on, the user doesn't get a choice. I see from your last post that you tried the 'allow change' version - no joy? Did you enable a way to change styles (with the mobile skin addon options)
3. No - AdminCP doesn't use the temaple system which makes it a lot more difficult to "mobilise" it. As such if you view your admincp when on an iphonoe, it will give you the full admincp.

BadgerDog 08-25-2009 10:44 PM

Quote:

Originally Posted by dartho (Post 1874420)
Badger - You can just re-install this addon from the product-mobdetect37.xml product file (the main one in the first post) and that will overwrite the other version.

Thanks.. just did that and overwrote, as I don't think that secondary mod was working ... ;)


Quote:

Originally Posted by dartho (Post 1874420)
1. No, however you could use the 'custom user agent' section to have a specific style for Blackberrys

I had a Blackberry user test your skin and he said it worked pretty darn good on their "Bold" Model, so I'll just leave it. :)

Quote:

Originally Posted by dartho (Post 1874420)
2. No - with this add-on, the user doesn't get a choice. I see from your last post that you tried the 'allow change' version - no joy? Did you enable a way to change styles (with the mobile skin addon options)

Yes, I enabled the "Link on to of Navbar" option and it appears, but when it executes all I get is a screen refresh, although it shows the "xxx?style=2" statement on the browser bar, so I know it tried to do something on the iPhone. The iPhone Safari is set to use "cookies", but the forum stays in your "mobile" skin mode.

Quote:

Originally Posted by dartho (Post 1874420)
3. No - AdminCP doesn't use the temaple system which makes it a lot more difficult to "mobilise" it. As such if you view your admincp when on an iphonoe, it will give you the full admincp.

Roger that ... :up: Understood....

Thanks for your quick response... sweet product... appreciate your efforts .. :up:

Regards,
Badger

echamberlain 08-27-2009 10:31 PM

Quote:

Originally Posted by BadgerDog (Post 1874180)
Hi dartho.... :)

I'm trying to get this overide option to work as well....

I installed (imported) the "mobdetect-allow_change_b.xml", but it doesn't seem to let me switch skins from my iPhone. It just stays with the "mobile" skin regardless of what I select.

mobdetect-allow_change_b.xml doesn't appear to work. It's trying to set the bbstyleid cookie, which doesn't exist. It should be changing the styleid cookie.

Here are my modifications to the original mod to give users the ability to select another style after being presented with the mobile style. The check is also only done the first time the user hits the website each session.

Replace the first two lines of the plugin code from:
PHP Code:

if ($vbulletin->options['mob_detect_enabled'] == 1)
  { 

to:

PHP Code:

// make the cookie name a constant
define('MOD_DETECT_FLAG','mod_detect_flag');

// clean cookie
$vbulletin->input->clean_array_gpc('c', array(COOKIE_PREFIX MOD_DETECT_FLAG => TYPE_BOOL,));
  
// we only need to do this once, if the cookie doesn't exist
if ($vbulletin->options['mob_detect_enabled'] == && 
    empty(
$vbulletin->GPC[COOKIE_PREFIX MOD_DETECT_FLAG]))
  {
  
  
// add the cookie, it only lasts as long as the session
  
vbsetcookie(MOD_DETECT_FLAGtruefalse); 

and the end of the plugin code, from:

PHP Code:

    //      echo "<!-- No Mobile Device-->";
  
}


to:

PHP Code:

    //      echo "<!-- No Mobile Device-->";
  
}
  
  
// add the cookie
  
vbsetcookie('styleid'$styleid);



dartho 08-28-2009 01:45 AM

Ah - thanks! I just checked - you're right. I modified that plugin for vb 3.8 (not 3.7) and also didn't include a prefix, so that alteration would not have worked for many.

For 3.7, would modifying the Detect Mobile Device and Assign Style plugin and adding:

Code:

if (!$vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'styleid', TYPE_INT))
{

at the begining and
Code:

}
at the end not be simpler?

(for 3.8 it would be
Code:

if (!$vbulletin->input->clean_gpc('c', COOKIE_PREFIX . 'bbstyleid', TYPE_INT))
{

at the begining and
Code:

}
at the end)

CR_TurboGuy 09-08-2009 12:19 PM

Quote:

Originally Posted by ShackMaster (Post 1861047)
Josh...

I just found a bug with the UserCP Mobile Style Detection. If the "Use Standard Style" is selected, which it is by default, the only the default style of the forum can be used for members.

For example: I have several styles that users can select from. The default is a fluid 100% style. An option is the fixed 1024px wide style. If I have "Use Standard Style" selected in the UserCP for the Mobile Style Detection, then changing the style from 100% fluid to any of the other fixed styles does not work. However, if I change the Mobile Style Detection to "Use Mobile Style", the other styles will work.

Reckon how we can fix this? Or maybe have it default to "Use Mobile Style" for all members, unless specifically selected.

Thanks!

Ok, I think if I'm understanding the correctly, you are saying that it defaults to using the standard style, and you want it to default to using the mobile style, correct? If so, then change the order of the options for the profile field, so that 'Use Mobile Version' is the first option.

As to being able to choose other styles when the 'Use Standard Style' is set, I think that is because my mod uses the styleid set in the 'Mobile Device Detection' settings for the 'custom' device type. You might try changing the
Code:

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

to
Code:

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

then I would think that it would use whatever style is the default for the board.

Let me know if I'm way off base on my assumptions & I'll try to figure out how to get things working. Just FYI thought, if you couldn't tell by my forum, I run a haunted house & this time of year I'm pretty busy, so it may take a little to get back to you.


--JOsh

Edit - I'm attaching the XML file with the changes that I mentioned above.

Joey Link 09-17-2009 07:56 PM

Any chance in a future version you could give the user the option of viewing the mobile style or the full version? That would be ideal for me, as many iphone users view the full version but some prefer the mobile. It'd be nice to alert all mobile users that there is a mobile option.

dartho 09-17-2009 09:12 PM

Hi Joey - have a look at the 3 posts preceding yours which have 3 ways of doing this.

Kottonmouth801 09-18-2009 01:29 AM

Hello Dartho,

I was "chatting" with you in the mobile skin forum.

I am still having an issue with 3.8.2 conflicting with this mod when you try to register from a mobile device.

Although I.... Am not complaining because I can read that this was designed for 3.7.

But......

I love this mod and have been using it on 3.8.2 for quite sometime and have been extremly pleased.

I recently added a Registration button to the the mobile skin and this is when I found the bugg.

The bugg is definitly with this modification not the skin.

Will not let you register from a mobile device.

I also tried to turn captcha off but this did not help either...?

Any Ideas???

Thanks... :)

dartho 09-18-2009 08:08 AM

Sorry - your problem lies elsewhere. My test site is currently 3.8.2 and this mod coupled with the mobile style have no (no visual) issues with registering a new user.

Kottonmouth801 09-18-2009 04:10 PM

Hello dartho,

May I ask which skin you are using?

Because I just tested it on a test board (3.8.2) and it doesn't work there either.

But... When I turn this modification off it works just fine to register from a mobile device..

Also.....

I noticed that your mobile skins do not have a registration option on them.

Do you have any suggestions?

dartho 09-18-2009 09:32 PM

I'm using my mobile style (https://vborg.vbsupport.ru/showthread.php?t=174375)

I didn't add a register button/link as I never intended for people to register via it. However on my 3.8.2 test site which has ONLY my mods installed, it has no issues (also only uses Q&A human verification)

Sorry - no other suggestions other than those already made.

Kottonmouth801 09-21-2009 07:22 AM

I have tracked conflict down.

I beleive it is conflicting with this mod.

https://vborg.vbsupport.ru/showthread.php?t=183917

Really wanted to continue using this mod instead of creating .m site

Thanks for your time.

:up:

dartho 09-21-2009 07:47 AM

Goodo - do you have the mobile add-on installed? (https://vborg.vbsupport.ru/showthread.php?t=182692)

if so, adding the following code to the disable addons section should disable the 'stop registration bots' addon in when in the mobile style
Code:

//disable "Stop the Registration Bots"
$vbulletin->options[StopBotReg_enable]=0;


Kottonmouth801 09-21-2009 04:27 PM

:up: :)

Awesome....!!!!!!!

I turned my data program off this month on my phone to try to save a few dollars.

So.. when my wife gets home I will test code with her phone.

I will keep you posted on the results.

Also.... do you think many robots will get around on the mobile skin?

I am stll "scratching my head" about robots on the mobile side.

hmnnnn......

I will let you know.

Thanks....!!!!!!!
:up:

"Also"

I dont beleive I have this mod installed https://vborg.vbsupport.ru/showthread.php?t=182692 and..... I am confused on why I would need it?


All times are GMT. The time now is 12:47 PM.

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.02027 seconds
  • Memory Usage 1,862KB
  • 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
  • (10)bbcode_code_printable
  • (4)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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