Click for Full Image

For some time now I have wanted to build a mobile vBulletin powered page for my mobile style and I finally succeeded after a few hours of messing around with it. It took a little bit of time, but I hope it helps you out.

Why am I build this mobile page? Well I wanted to make it easier to get mobile users to be able to see a page that had links to all my mobile apps without having to view it on the main forum style since I have set all mobile users to see the mobile style.

1. Create a php page:
- Create a new file, whatever you want to call it (let’s say test.php).
- Open up test.php and add the following (replace TEST with whatever template you want to show – WARNING: the template name is CASE SENSITIVE!!!):

<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT', 'test.php');
define('CSRF_PROTECTION', true);  
// change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('Test',
);

// pre-cache templates used by specific actions
$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits = construct_navbits(array('' => 'Test'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Test';

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('Test');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());

?> 

The above is based on Lynne and Gary’s post over at vBulletin.org on “How to Create Your Own vBulletin Page”, but here we are building it out for vBulletin’s Mobile style.

2. Creating the Template:
- Make sure you create this page in your Mobile Style, not your default or Master Style.
- Open your mobile style and in the dropdown menu choose “Add New Template”
- Add the following in your new template:

{vb:stylevar htmldoctype}
<html xmlns="http://www.w3.org/1999/xhtml"<vb:if condition="$vboptions['enablefacebookconnect']"> xmlns:fb="http://www.facebook.com/2008/fbml"</vb:if> dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
<head>
	{vb:raw headinclude}
	<title>{vb:raw vboptions.bbtitle}</title>
	{vb:raw headinclude_bottom}
</head>
<body>

{vb:raw header}

{vb:raw navbar}

<div id="pagetitle" class="pagetitle ui-bar-b">
	<h1 class="pagetitle">{vb:raw pagetitle}</h1>
</div>



YOUR CONTENT HERE
	





{vb:raw footer}
 </body>
</html>

A couple things of note:
Make sure that if you already have a normal vB powered page that you name your mobile style page something different as not to override your older page.

Please let me know if you have any questions or you can post in the comments if you need any help.

{ 2 comments }

The other day Joe from BlackBerry Os left a comment on another post about adding ads to the mobile style and wanted to know how to ad an advertisement above the logo in the vBulletin Mobile Style.

So I thought I would so a post on how to do it:

In your admincp got to your mobile style and find Header, Open the header template and find:

<div id="header"> 

(should be the second line)

And add your ad code above

My current code looks like this

<div align="center"><a href="URL">
<img src="IMAGE AD" alt="Your Ad Text Here"/></a> </div>

This will display adds on every page of your site in the header. For the best results, I would suggest using a 320×50 ad spot.

Please let me know if you have any questions or post in the comments if you need any help.

{ 5 comments }

Internet Brands Acquires Mobile App Creator Forum Runner

March 9, 2012

This is pretty interesting… LOS ANGELES, CA, Mar 07, 2012 – Internet Brands today announced the acquisition of Forum Runner ( www.forumrunner.net ), a mobile application that allows forum users to interact with online communities from mobile devices. Forum Runner will operate as part of Internet Brands’ vBulletin software division. You can read the rest [...]

Read the full article →

Add Adsense After 1st and Last Post in vBulletin Mobile Style

February 28, 2012

A couple weeks ago I showed you how to add Goolge Adsense to your vBulletin Mobile Sytle. I got an email from someone looking to add Adsense between the first and last post in a thread. So I’m happy to share how to do it here. First open up you mobile suite under your style [...]

Read the full article →

How to Add “What’s New” to vBulletin Mobile Style Header

February 8, 2012

One thing that bothers me and some of my members when using the vBulletin mobile style is that you have to do 2 taps (clicks) to see if any new posts have been made; you have to click on the grid button and then the “what’s new” button. My members hated that and so did [...]

Read the full article →

ForumCon is Back for 2012

February 2, 2012

This year it will be once again in San Francisco, this time at the Hotel Kabuki on June 12th. I was wanting to go to Chicago last year, but my schedule just wouldn’t allow for it. This year I’m really thinking about going. Since it’s on the West Coast and it’s just a short flight [...]

Read the full article →
Page 1 of 1312345...10...Last »