With the increasing rate at which people browse the internet, it’s very important to optimize your site for mobile users. I have a web forum built with SMF 2.0 script and the mobile version isn’t bad at all compared to the default mobile version SMF has to offer. Unlike MyBB that has a better mobile version plugin, SMF mobile version (also known as WAP2) looks rather too crude to be of interest to any mobile user. A lot of my web forum users use Opera Mini mobile browser and I had no choice but to make the forum’s mobile version a lot better than what it was. Since mobile users are also more than 50%, I had to find ways to insert adsense for mobile into WAP2 to monetize it and I’m going to explain just how I did it. The screenshot below shows exactly how my forum looks like when viewed with Opera Mini.
Installing BXK WAP MOD
This modification gives your SMF WAP2 version a much better look. It’s not available on SMF modifications site but i got it from Empireofthesun. Sadly, the site too has been having some technical issues for some months now and this mod is almost nowhere to be found online. Fortunately, I ran a search on my hard drive, found it and uploaded it to my old mobile site.
Now, this version supports SMF 2.0 RC5 but in case you’re using SMF 2.0 or SMF 2.0.1, you need to emulate SMF 2.0 RC5 to install this mod.
Go to Package Manager, click on Advanced at the bottom right and emulate SMF 2.0 RC5
Click on Apply and now try to upload and install the mod.
How To Redirect Opera Mini To WAP2
This part is a bit tricky as you have to do edit a php file. Log in to your cPanel and locate index.php file. This is the only file that needs to be edited in order to redirect mobile users to the WAP version you just installed.
Edit index .php file by searching for this code:
if (isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false)
And replacing with this:
if ((isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'application/vnd.wap.xhtml+xml') !== false) || isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']))
Now save the file and view your web forum with Opera Mini. You should be automatically redirected to WAP2.
Inserting Ads (Adsense, Inmobi, Admob or Buzzcity) To SMF WAP2
-You first need to generate and copy out the php code for the advert and paste it to a text file. If you’re using Adsense for mobile, be sure you selected ads for both low and high end phones and copy out the codes in php format.
-Save the text file as ads.php (be sure the extension is php)
-Upload the php file to your domain root (public_html)
-Find Wireless.template.php (./public_html/Themes/default/Wireless.template.php)
-If you want the advert to appear at the top just above the header, find this code:
<center><p class="catbg">', site_logo(), '</p></center>;
-Right below it, paste this code:
-If you wish the advert to appear below, right before the footer, find this code:
global $context, $settings, $txt, $options, $boardurl, $scripturl;
-Right below this, paste this code:
You can as well add the ads to any other location depending on whether you have a clear idea on php coding. Inserting the advert at a wrong place might render your template useless.
Adding External Links To SMF WAP
The procedure is quite similar to the one above. You need to write your links in php and save it as a text file. If you don’t know how to get this done, simply edit the links and anchor texts in the example below:
echo "<div class=\"wapmenu\">\n";
echo "<a href=\"http://www.9jaclub.com/profile/?area=account;wap2\">Edit Account</a> | <a href=\"http://www.9jaclub.com/profile/?area=forumprofile;wap2\">Edit Profile</a>\n";
-Now save this as links.php and upload to public_html.
-Locate Wireless.template.php file from your cPanel
-To show the links at the top, search for this code:
-Just above this, paste this code:
-To show the links at the bottom, find:
<center>', $txt['footer'], '</center></div>
-Just above it, paste this code:
Everything posted here can be practically seen on 9jaclub.com and if you find this post helpful, say thanks by hitting the google +1 and facebook like buttons below. Thanks!