vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Styles (https://vborg.vbsupport.ru/forumdisplay.php?f=161)
-   -   vB 3.5 Lite !! 0.02 BETA !! (https://vborg.vbsupport.ru/showthread.php?t=92071)

dartho 05-28-2006 10:02 PM

This is not my work - I asked sometime back and someone posted this. It works under 3.5.4 for me from my PDA.

To make your mobile style automagically selected when a mobile device is detected edit your global.php, search for :
Code:

// #############################################################################
// if user can control panel, allow selection of any style (for testing purposes)
// otherwise only allow styles that are user-selectable

and add the following immediately above it:
Code:

// BROWSER DETECT
 
  $browsers = array(
      "Windows CE",
      "WebTV",
      "AvantGo",
      "Blazer",
      "PalmOS",
      "lynx",
      "Go.Web",
      "Elaine",
      "ProxiNet",
      "ChaiFarer",
      "Digital Paths",
      "UP.Browser",
      "Mazingo",
      "Mobile",
      "T68",
      "Syncalot",
      "NetFront",
      "Danger",
      "Symbian",
      "Nokia",
      "Xiino",
      "AU-MIC",
      "EPOC",
      "BlackBerry",
      "Wireless",
      "Handheld"
      );
 
  if(preg_match('/('.implode('|', $browsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
  {
      $mobile=1;
  }
  else if (isset($_SERVER['HTTP_UA_OS']))
  {
      if (strstr($_SERVER['HTTP_UA_OS'],"POCKET PC") !== false)
      {
          $mobile=1;
      }
  }
  else
  {
      $mobile=0;
  }
 
  if ($mobile==1)
  {
      //echo "You are on a mobile device!";
      $styleid='9';
  } 
// END BROWSER DETECT

Change the 3rd last line " $styleid='9'; " to the style number of your mobile/pda Style. You can add user agent strings of other browsers to the list.

**NOTE - YOU CAN NOT OVERRIDE THIS, IF YOU ARE ON A MOBILE DEVICE THIS WILL BE THE ONLY STYLE YOU CAN USE

ON another note, if you need to get to otherwise unavailable screens when in your mobile style - just manually enter in the URL you want to go to...

Zachery 05-29-2006 06:42 AM

darth mind if I adapt this and make it a product to do this?

Lil status update I've been working on the style somewhat trying to get the new thread interface working right.

dartho 05-29-2006 02:34 PM

Be my guest. I've searched for where I got the info form in the first place, but to no avail as yet...

I have been using a modified version of "Alabama" style (which in itself is a modified version of the "Archive" or PDA style) for a while to work with PDAs. This was under 3.0.9, I only ugraded to 3.5.4 yesterday, so am using this style for the moment till I can redo my mobile style for 3.5.4. I'm not a coder, so it's very much a trial and error thing for me.

I'm looking forward to any further mods you make to it. I have a few regular PDA users (320x240 resolution) including myself and would be happy to test for you.

Zachery 05-29-2006 06:31 PM

I've got a cell coming in a few days and I'll be getting a DS lite in the near future (release day hopefully). Both which should help speed things up.

cdoyle 07-01-2006 01:14 AM

Hi, has there been any update for this style?

I would like to have it on my forum, but with no way for the user to go back to a normal style. I really can't use it yet.

dartho 07-01-2006 01:34 AM

it shouldn't too hard to have a link which goes to the default style. worst case is have a post with a link to your forum home using default style:


www.website.name/forum/index.php?styleid=xxx

where xxx is the styleid number of your default style...

SnitchSeeker 07-05-2006 07:54 AM

Quote:

Originally Posted by Zachery
Overtime I plan to continue development of this to include a plugin to auto switch to the style on identified pda / mobile phone user agents.

and continue the slimlined templates in other places, at least as much as possible, preferably for the usercp (or at least parts).

Has this been done yet?

This looks great Zachery! I just want to wait to install it until it is fully developed.

Zachery 07-06-2006 10:04 AM

Not yet, the cost to develop on my phone would be atad much.

EricaJoy 07-07-2006 10:50 AM

Quote:

Originally Posted by dartho
This is not my work - I asked sometime back and someone posted this. It works under 3.5.4 for me from my PDA.

To make your mobile style automagically selected when a mobile device is detected edit your global.php, search for :
Code:

// #############################################################################
// if user can control panel, allow selection of any style (for testing purposes)
// otherwise only allow styles that are user-selectable

and add the following immediately above it:
Code:

// BROWSER DETECT
 
  $browsers = array(
      "Windows CE",
      "WebTV",
      "AvantGo",
      "Blazer",
      "PalmOS",
      "lynx",
      "Go.Web",
      "Elaine",
      "ProxiNet",
      "ChaiFarer",
      "Digital Paths",
      "UP.Browser",
      "Mazingo",
      "Mobile",
      "T68",
      "Syncalot",
      "NetFront",
      "Danger",
      "Symbian",
      "Nokia",
      "Xiino",
      "AU-MIC",
      "EPOC",
      "BlackBerry",
      "Wireless",
      "Handheld"
      );
 
  if(preg_match('/('.implode('|', $browsers).')/i', $_SERVER['HTTP_USER_AGENT'], $match))
  {
      $mobile=1;
  }
  else if (isset($_SERVER['HTTP_UA_OS']))
  {
      if (strstr($_SERVER['HTTP_UA_OS'],"POCKET PC") !== false)
      {
          $mobile=1;
      }
  }
  else
  {
      $mobile=0;
  }
 
  if ($mobile==1)
  {
      //echo "You are on a mobile device!";
      $styleid='9';
  } 
// END BROWSER DETECT

Change the 3rd last line " $styleid='9'; " to the style number of your mobile/pda Style. You can add user agent strings of other browsers to the list.

**NOTE - YOU CAN NOT OVERRIDE THIS, IF YOU ARE ON A MOBILE DEVICE THIS WILL BE THE ONLY STYLE YOU CAN USE

ON another note, if you need to get to otherwise unavailable screens when in your mobile style - just manually enter in the URL you want to go to...

Instead of forcing the styleid, would it be possible to display a different page to a mobile browser? Something like "you have a mobile browser! would you like to see a mobile formatted version or a regular formatted version of the site?" then give them the option to choose which version to use.

dartho 07-11-2006 05:19 AM

probably, but I'm not sure how to do this...

Anyone? Bueller?


All times are GMT. The time now is 11:57 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.01364 seconds
  • Memory Usage 1,759KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)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