Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.7 > vBulletin 3.7 Styles

Reply
 
Thread Tools
Mobile, Cell, Phone, PDA, iPhone Style Details »»
Mobile, Cell, Phone, PDA, iPhone Style
Version: 0.0.10a, by dartho dartho is offline
Developer Last Online: Oct 2023 Show Printable Version Email this Page

Version: 3.7.2 Rating:
Released: 03-27-2008 Last Update: 07-27-2008 Installs: 1045
Supported
Additional Files Translations Is in Beta Stage  

vBulletin 4.0 version here: https://vborg.vbsupport.ru/showthread.php?t=228986

A very cut back style with very low bandwidth usage which renders well on pretty much all small screen devices from old Nokias to new iPhones.
  • Supports viewing/posting/replying in forums
  • Supports Private Messaging
  • Supports Tags (viewing, not adding)
  • Supports viewing and replying to messages in Social Groups
  • Supports Thread Prefixes
  • has an add-on product to customise here: Extend and Customise Mobile Style (It is recommended that you install this also, but not required)
  • Supports other stuff too ....

Notes
  • If you are installing this on a vBulletin version higher than the current 'supported' version, and wish to get rid of the Out-of-Date Custom Templates Found! errors, see Post #329 for more information...
  • I suggest you also install this add-on to this style to get more out of it...
  • To modify the colour scheme of this style, you have to edit the wireless.css file by hand
  • If you use a portal such as vbadvanced which you wish to disable in mobile style, see here

Release Information
  • Version 0.0.1 - Initial release ported from my 3.6 version here
  • Version 0.0.2 - Added auto quoting when replying to a post
    - fixed "Up" link bug
    - Added 'Posted via Mobile Device' message to new posts
    - couple small non - critical bugs fixed in some links
  • Version 0.0.3 - No change other than change version to 3.7RC2
  • Version 0.0.4 - Updated with security tokens tages for forms submital, and Gold version
  • Version 0.0.5 - fixed navbar template "Home" link (you will need to edit this if your default forum page is not index.php)
  • Version 0.0.6 - added ad_hook locations, fixed page titles, fixed couple small bugs
  • Version 0.0.7 - Added Style chooser to UserCP, Post count to threads, Search Page, Attachment Sizes, More detailed time info, viewing/voting in polls, other stuff too probably
  • Version 0.0.8 - now has an addon to customise certains aspects of this style - see HERE
  • Version 0.0.9 - updated template version numbers to to 3.7.2 - no other changes have been made
  • Version 0.0.10 - Now Fully Phrased (thanks Keyser Soze) Other updates included so its add-on product can do more customization
    Both this style and the addon will have the same version numbers - it's best to make sure you update the add-on when updating the style.
  • Version 0.0.10a - fixed small bug in footer template

Install Instructions
  • Save attached XML to your local computer
  • Save attached wireless.css.txt, rename to wireless.css and upload to your forum root
  • In AdminCP go to "Styles and Templates"
  • In the "Import Style XML File" section browse to where you saved the XML
  • Click "Import" button
  • Come back to this page and click "Mark as Installed"
Other useful Add-ons to use in Conjunction with this styleOther Mobile Styles worth checking out

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #132  
Old 05-24-2008, 05:24 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I've looked through the vBulletin js files and pulled out he script needed to make the quick style chooser work - this will of course only work on mobile devices that support javascript and if teh style is not being force by an add-on.

Add the following to the very top of your footer template:

Code:
<if condition="$show['quickchooser']">
<script type="text/javascript">
<!--
var is_regexp=(window.RegExp)?true:false;
function switch_id(C,E){var F=C.options[C.selectedIndex].value;if(F==""){return }var B=new String(window.location);var A=new String("");B=B.split("#");if(B[1]){A="#"+B[1]}B=B[0];if(B.indexOf(E+"id=")!=-1&&is_regexp){var D=new RegExp(E+"id=\\d+&?");B=B.replace(D,"")}if(B.indexOf("?")==-1){B+="?"}else{lastchar=B.substr(B.length-1);if(lastchar!="&"&&lastchar!="?"){B+="&"}}window.location=B+E+"id="+F+A}
// -->
</script>
<div>
	<select name="styleid" onchange="switch_id(this, 'style')">
		<optgroup label="$vbphrase[quick_style_chooser]">
			$quickchooserbits
		</optgroup>
	</select>
</div>
</if>
Alternatively (or additionally) you can add the style chooser to modifyoptions template (which will not require javascript enabled to work)

Just add:
Code:
<if condition="$show['quickchooser']">
<div class="windowbg2">Style Chooser</div>
<span>
<select name="styleid">
<optgroup label="$vbphrase[quick_style_chooser]">
$quickchooserbits
</optgroup>
</select>
</if>
</span>
<br />
before

Code:
<div>
<input type="hidden" name="securitytoken" value="$bbuserinfo[securitytoken]" />
<input type="submit" class="button" value="$vbphrase[save_changes]" accesskey="s" />
<input type="reset" class="button" value="$vbphrase[reset_fields]" accesskey="r" />
</div>
in the modify options template
Reply With Quote
  #133  
Old 05-25-2008, 11:00 AM
swissbob swissbob is offline
 
Join Date: Sep 2006
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Dartho, are your adsense ads appearing yet? I have nothing.
Reply With Quote
  #134  
Old 05-25-2008, 11:45 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

No - having played with it a little more, I think something is not quite right with it. Also I noticed that at one stage I got the ads, but after a couple refreshes the ads vanished and I was back to only having comments?
Reply With Quote
  #135  
Old 05-26-2008, 12:45 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OK - I think I have working properly now. Code for plugin below. Ads don;t show up all teh time and after a bunch of refreshes they go a way for a while. This is a google thing and I guess it depends on your sites content and who is advertising? Anyway - the following seems to work for me. It is set for showing ads just before the quick reply, but you can change the ad_location in the code to show them after first post by searching and replacing ad_showthread_beforeqr for ad_showthread_firstpost in the plugin code...



Get your mobile adsense PHP code - here's the code Google game me (DO NOT USE THIS - GET YOUR OWN)
PHP Code:
<?php

$GLOBALS
['google']['ad_type']='text';
$GLOBALS['google']['channel']='0000000000';
$GLOBALS['google']['client']='pub-0000000000000000';
$GLOBALS['google']['format']='mobile_single';
$GLOBALS['google']['https']=$_SERVER['HTTPS'];
$GLOBALS['google']['host']=$_SERVER['HTTP_HOST'];
$GLOBALS['google']['ip']=$_SERVER['REMOTE_ADDR'];
$GLOBALS['google']['markup']='xhtml';
$GLOBALS['google']['oe']='utf8';
$GLOBALS['google']['output']='xhtml';
$GLOBALS['google']['ref']=$_SERVER['HTTP_REFERER'];
$GLOBALS['google']['url']=$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$GLOBALS['google']['useragent']=$_SERVER['HTTP_USER_AGENT'];
$google_dt time();
google_set_screen_res();

function 
google_append_url(&$url$param$value) {
  
$url .= '&' $param '=' urlencode($value);
}

function 
google_append_globals(&$url$param) {
  
google_append_url($url$param$GLOBALS['google'][$param]);
}

function 
google_append_color(&$url$param) {
  global 
$google_dt;
  
$color_array split(','$GLOBALS['google'][$param]);
  
google_append_url($url$param,
                    
$color_array[$google_dt sizeof($color_array)]);
}

function 
google_set_screen_res() {
  
$screen_res $_SERVER['HTTP_UA_PIXELS'];
  
$delimiter 'x';
  if (
$screen_res == '') {
    
$screen_res $_SERVER['HTTP_X_UP_DEVCAP_SCREENPIXELS'];
    
$delimiter ',';
  }
  
$res_array explode($delimiter$screen_res);
  if (
sizeof($res_array) == 2) {
    
$GLOBALS['google']['u_w'] = $res_array[0];
    
$GLOBALS['google']['u_h'] = $res_array[1];
  }
}

function 
google_get_ad_url() {
  
$google_ad_url 'http://pagead2.googlesyndication.com/pagead/ads?';
  
$google_scheme = ($GLOBALS['google']['https'] == 'on')
      ? 
'https://' 'http://';
  foreach (
$GLOBALS['google'] as $param => $value) {
    if (
$param == 'client') {
      
google_append_url($google_ad_url$param,
                        
'ca-mb-' $GLOBALS['google'][$param]);
    } else if (
strpos($param'color_') === 0) {
      
google_append_color($google_ad_url$param);
    } else if ((
strpos($param'host') === 0)
               || (
strpos($param'url') === 0)) {
      
google_append_url($google_ad_url$param,
                        
$google_scheme $GLOBALS['google'][$param]);
    } else {
      
google_append_globals($google_ad_url$param);
    }
  }
  
google_append_url($google_ad_url'dt',
               
round(1000 array_sum(explode(' 'microtime()))));
  return 
$google_ad_url;
}

$google_ad_handle = @fopen(google_get_ad_url(), 'r');
if (
$google_ad_handle) {
  while (!
feof($google_ad_handle)) {
    echo 
fread($google_ad_handle8192);
  }
  
fclose($google_ad_handle);
}

?>
I had to move al the functions to the top of the code block for it to work in a plug in I created a called "Google Adsense Mobile" on the showthread_start hook. Here is the working plugin code:
PHP Code:
if ($styleid == xx) {
function 
google_append_url(&$url$param$value) {
  
$url .= '&' $param '=' urlencode($value);
}

function 
google_append_globals(&$url$param) {
  
google_append_url($url$param$GLOBALS['google'][$param]);
}

function 
google_append_color(&$url$param) {
  global 
$google_dt;
  
$color_array split(','$GLOBALS['google'][$param]);
  
google_append_url($url$param,
                    
$color_array[$google_dt sizeof($color_array)]);
}

function 
google_set_screen_res() {
  
$screen_res $_SERVER['HTTP_UA_PIXELS'];
  
$delimiter 'x';
  if (
$screen_res == '') {
    
$screen_res $_SERVER['HTTP_X_UP_DEVCAP_SCREENPIXELS'];
    
$delimiter ',';
  }
  
$res_array explode($delimiter$screen_res);
  if (
sizeof($res_array) == 2) {
    
$GLOBALS['google']['u_w'] = $res_array[0];
    
$GLOBALS['google']['u_h'] = $res_array[1];
  }
}

function 
google_get_ad_url() {
  
$google_ad_url 'http://pagead2.googlesyndication.com/pagead/ads?';
  
$google_scheme = ($GLOBALS['google']['https'] == 'on')
      ? 
'https://' 'http://';
  foreach (
$GLOBALS['google'] as $param => $value) {
    if (
$param == 'client') {
      
google_append_url($google_ad_url$param,
                        
'ca-mb-' $GLOBALS['google'][$param]);
    } else if (
strpos($param'color_') === 0) {
      
google_append_color($google_ad_url$param);
    } else if ((
strpos($param'host') === 0)
               || (
strpos($param'url') === 0)) {
      
google_append_url($google_ad_url$param,
                        
$google_scheme $GLOBALS['google'][$param]);
    } else {
      
google_append_globals($google_ad_url$param);
    }
  }
  
google_append_url($google_ad_url'dt',
               
round(1000 array_sum(explode(' 'microtime()))));
  return 
$google_ad_url;
}

$GLOBALS['google']['ad_type']='text';
$GLOBALS['google']['channel']='0000000000';
$GLOBALS['google']['client']='pub-0000000000000000';
$GLOBALS['google']['format']='mobile_single';
$GLOBALS['google']['https']=$_SERVER['HTTPS'];
$GLOBALS['google']['host']=$_SERVER['HTTP_HOST'];
$GLOBALS['google']['ip']=$_SERVER['REMOTE_ADDR'];
$GLOBALS['google']['markup']='xhtml';
$GLOBALS['google']['oe']='utf8';
$GLOBALS['google']['output']='xhtml';
$GLOBALS['google']['ref']=$_SERVER['HTTP_REFERER'];
$GLOBALS['google']['url']=$_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$GLOBALS['google']['useragent']=$_SERVER['HTTP_USER_AGENT'];
$google_dt time();
google_set_screen_res();

$find='"';
$replace="'";
$googlemad '';

$google_ad_handle = @fopen(google_get_ad_url(), 'r');
if (
$google_ad_handle) {
  while (!
feof($google_ad_handle)) {
    
$googlemad .= fread($google_ad_handle8192);
  }
  
fclose($google_ad_handle);
}
$vbulletin->templatecache['ad_showthread_beforeqr'] = str_replace($find,$replace,$googlemad);


You'll see I wrapped the google code in a conditional if ($styleid == xx) { ... } where xx is the styleid of my mobile style - you will need to change this and removed the opening and closing php tags.

The other changes (after moving the functions to the top) were:
1. replace
PHP Code:
$google_dt time();
google_set_screen_res(); 
with
PHP Code:
$google_dt time();
google_set_screen_res();

$find='"';
$replace="'";
$googlemad ''
2. replace
PHP Code:
    echo fread($google_ad_handle8192);
  }
  
fclose($google_ad_handle);

with
PHP Code:
    $googlemad .= fread($google_ad_handle8192);
  }
  
fclose($google_ad_handle);
}

$vbulletin->templatecache['ad_showthread_beforeqr'] = str_replace($find,$replace,$googlemad); 
That's about it. You could modify and or duplicate this to work with other ad_locations. Current defined ad_locations in vBulletin 3.7 (and this style) and the likely best hook location for these ads are (i'm not so sure about the ones in blue - they should work there, but there may be a more efficient place to put them. Feedback welcomed!):

ad_footer_start - global_start
ad_footer_end - global_start
ad_forumdisplay_afterthreads - forum_display_start
ad_forumhome_afterforums - forum_home_start
ad_header_end - global_start
ad_header_logo - global_start
ad_navbar_below - global_start
ad_showthread_beforeqr - showthread_start
ad_showthread_firstpost - showthread_start

Hope this helps!
Reply With Quote
  #136  
Old 05-26-2008, 02:38 AM
TechGuy TechGuy is offline
 
Join Date: Nov 2001
Location: Waynesboro, PA USA
Posts: 55
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That works great, dartho. Thanks!
Reply With Quote
  #137  
Old 05-26-2008, 03:14 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks TechGuy - post 134 updated with better instructions and info on showing mobile ads elsewhere on your site
Reply With Quote
  #138  
Old 05-26-2008, 06:35 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm looking at making a product to go along with this style so some aspects of it may be turned on/off.

Some examples are:
  • Insert a link to the default style in the navbar/footer
  • Customise/disable "Posted Via Mobile Device" message on new posts
  • Customise "Home" link (so no need to edit navbar template)
  • Display images (as opposed to just a link to the image)

What other options do you think would be good in such a product?
Reply With Quote
  #139  
Old 05-26-2008, 10:04 AM
swissbob swissbob is offline
 
Join Date: Sep 2006
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dartho View Post
I'm looking at making a product to go along with this style so some aspects of it may be turned on/off.

Some examples are:
  • Insert a link to the default style in the navbar/footer
  • Customise/disable "Posted Via Mobile Device" message on new posts
  • Customise "Home" link (so no need to edit navbar template)
  • Display images (as opposed to just a link to the image)

What other options do you think would be good in such a product?
Titles and meta tags please!
Reply With Quote
  #140  
Old 05-26-2008, 10:37 AM
dartho dartho is offline
 
Join Date: Sep 2005
Location: Australia
Posts: 2,303
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Titles should be fixed (ie. same as default style) as of the last version.

What do you suggest for meta tags?
Reply With Quote
  #141  
Old 05-26-2008, 04:58 PM
swissbob swissbob is offline
 
Join Date: Sep 2006
Posts: 36
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by dartho View Post
Titles should be fixed (ie. same as default style) as of the last version.

What do you suggest for meta tags?
Description and keywords.

For the Description, use the first 100 characters of the first posting in the page - this is what VbSEO does (although they use 150 characters by default. For categories, use the category description.

For the keywords, perhaps use the tags and/or title without the stop words. Or just use tags where they exist and leave it blank if they don't.
Reply With Quote
Reply

Thread Tools

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 01:39 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05459 seconds
  • Memory Usage 2,420KB
  • Queries Executed 27 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_code
  • (6)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete