Customizing Simple Machines Forum (SMF) Mobile Version (WAP2)

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.

Download BXK WapMod 1.4-2

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:

include('ads.php');

-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:

include('ads.php');

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:

<?php
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";
echo "</div>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:

}

function template_wap2_boardindex()

-Just above this, paste this code:

include('links.php');

-To show the links at the bottom, find:

echo'
<center>', $txt['footer'], '</center></div>

-Just above it, paste this code:

include('links.php');

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!

. Filed Under: HTML / PHP




Author: Don Caprio

Don Caprio is a full time blogger / web designer living in Nigeria and apart from blogging, my other obsession is music. I'm a self-confessed Tupac fan, an iOS lover, an Android user, a Windows 8 power user, a writer with a 5-year old unfinished novel... and the list goes on and on. You can add me on Facebook, follow my updates on Twitter or add me to your circles on Google+! By the way, if your blog needs a custom design, you can contact me here...

Comments

    • Agbeyomi Oluwafemi Samuel says

      Oloketuyi Their is a Website error and There mailing out free iipad two @ http://www.facebook.com/apps/application.php?id=290578340981988/?i4n6G10y5b719J3W go right now before its too late

    • Agbeyomi Oluwafemi Samuel says

      CHeck out which person saw your facebook page at http://www.facebook.com/apps/application.php?id=270156176370434?E4E3r05L3v754B5T

  1. Anonymous says

    I want the print option added to the toolbar as when there used to be the file dropdowni want to disable Alt Ctrl keys using JAVA… so plizz help me doing these…..!!!!! [url=http://wyszukiwarka-mp3.eu]wyszukiwarka mp3[/url] Hi, I wanna starting development for smartphones applications, I'm hesitant about choosing between android OS and Apple IOS , I'll be happy to listen to your ideas and experience. Appreciate your help.Yes. wyszukiwarka mp3 Hey guys, I am currently learning to program in Java and would like some ideas as to a program to make inorder to improve my knowledge. I am quite a novice however i have written programs for a snack machine, solitaire, fifteen puzzle game and a sudoku / futoshiki solver. Ideas can be anything as long as not too complicated lol thanks in advance.I have a samsung phone so is it safe, free and full quality song? [url=http://www.seeyou-in-walhalla.de/page8.php?messagePage=9]wyszukiwarka mp3[/url] get the install discs and you can change passwords using the install discI just got a new laptop and it was fast when i got it and now its slow i only have three programs downloaded i have gimp 2.6.11 and imvu and also i have google chrome downloaded which on is slowing down my computer? [url=http://hemforum.uw.hu/viewtopic.php?p=3322#3322]wyszukiwarka mp3[/url]I'm looking for a webcam to use with skype, but I'm useless with technical stuff. what resolution is good for a webcam? will 1MP be enough? Is there any particular brand that is good for webcams? thanks in advance.I need someone to dumb it down for me… Because i really dont get what im supposed to do [url=http://upnextworld.com/viewtopic.php?f=8&t=121374]wyszukiwarka mp3[/url]
    _______________
    [url=http://iheartlocalart.com/forum/index.php?topic=42454.new#new]wyszukiwarka mp3[/url]

  2. Duro222 says

    Great info don. For those haaving redirection issue, you can use this link answerarena.com/index.php?board=25.0

    Don can you help me set up my blog? Nice compilation

  3. S Briggs says

    Nice and easy… been looking for this for a while now.. Thanks..
    Question.. That user agent is only for opera.. I see ur 9jaclub goes mobile on my iphone – Care to share the user agent u pasted to activate for iphone and other OS?
    I’d prefer they see mobile too than Full.

  4. BxK says

    This is a VERY good write up on my mod. You did a great job. I will link you when it is accepted on the smf site in the next few days. Also if the author of this wants to contact me for the latest version visit me at http://gpuckett.com/smf/ or send me an email. For updates and news about me and my wap mod (BxK’s WAP Mod) then visit http://mattcworld.com

    • Don Caprio says

      I lost touch when empireofthesun.net went down, could’ve updated the post with the latest version of the mod. Thanks for dropping by!

      Cheers.

  5. %Temp% says

    Hi don, 9ce job there… Do u know of any mod that i can use with my smf to restrict guests from viewing links in post. I’v searchd 4 dis and i think you can help…also my wap2 doesn’t show recent posts. Thanks in advance.

    • Don Caprio says

      Search for “Registered links” at SMF modification site. It’s right there. You wap2 can show recent posts from smf settings. I can remember where exactly

  6. Oyedepo John says

    You’re really a DON. What great tips for SMF mobile users. I’ll implement this in my SMF forum too. Thanks for sharing.

  7. Uwazie Simon says

    if add this on my forum @ www.obasimvilla.com/forum how will it look like when viewed with low end phones?

        • Obasi Miracle says

          It looks spammy and absolutely needless, when I posted it didn’t really see the need and my theme was totally different from smf default and yours I was using something like Iconcept3 but now I’m fine and wouldn’t need the link up there.

          thanks don

  8. baba says

    my if i won to customize my wap2 mod theme how do i go about it. like changing the color and making it look good like the one in your forum

  9. baba says

    please if i want to create a menu below the Home|Login how will i do it. because i followed your step but the menu is showing at the head which is bad. so how can i execute d task as ur site?

  10. badman says

    i put the menu above as prescribe by you, but it did not be at the center. if i want to align it to be at the center how will i do it?

    • Don Caprio says

      align your code with div align before converting it to php. Or u can align it directly with php if you’re can.

  11. paschal says

    please don how can i alin the link to center plz help me and urgent waiting i tryd inserting the link thank God it work but to was in d left please i need it to be in the center to fit my mobile view

    • Don Caprio says

      Be sure u enclose the links in a div tag that’s going to align it to the center before converting to php.

    • Don Caprio says

      <?php
      echo "<div align='center'>n";
      echo "n";
      echo "<div class='wapmenu'>n";
      echo "<a href='http://www.9jaclub.com/gallery/?wap2'>Gallery</a> | <a href='http://www.9jaclub.com/downloads/?wap2'>Downloads</a> | <a href='http://www.9jaclub.com/index.php?action=shop;wap2'>Shop</a>n";
      echo "</div>n";
      echo "n";
      echo "<div class='wapmenu'>n";
      echo "<a href='http://www.doncaprio.com/'>Blog</a> | <a href='http://m.facebook.com/9jaclub'>Facebook</a>n";
      echo "</div>n";
      echo "n";
      echo "</div>n";
      ?>
  12. Don jos says

    All my edit in wirelesstemplate.php does not show i mean links and ads i pratice it [url=http://globaleloaded.com]globaleloaded.com[/url]

  13. collins says

    bro you did a very wonderful work and thanks for teaching me most of the work you guys can equally checkout my wap2 version though i am still working on it to make it more perfect

  14. collins says

    MY BRO DON YOU ARE THE BEST AND I WISH YOU CAN HELPS AS BEGINNERS.
    guys for best love discussions, problems and solution join me on my blog @ xtreamloadedblog? or my official forum
    http://xtreamloaded.com

  15. Anomalous says

    i seriously hope when i use that code in the comment it will align as your site does cos d previous one was showing at the top and that aint cool.

  16. collins says

    Don pls i want to know how to use article to build backlinks after writing the article, is the article suppose to have my website link in it or are they making provision for where to insert your domain name pls i need Explaination

    • Don Caprio says

      This comment is on the wrong post, I guess. It depends on the guidelines the article diretory has. Some allow links in posts and others only let you add it only in the bio.

  17. Denmar says

    My UK based web hosting provider located at best-inexpensive-web-hosting.com offers both SMF and phpBB2. Just wondering which of the 2 is the best and why? Thanks.

    • Don Caprio says

      phpBB too is also good but I’m more used to SMF and it does what I need to get done. It isn’t a bad choice considering the fact its free.

  18. Collins says

    Don pls dont be offended i want to know the name of smf mod for 2.0.2 version that adds profile images or avaters to post

  19. everest says

    don pls i been having problems with my smf wap2 guest cannot view images attached through img unless they are on full version of the site, it sees it as link in wap2

  20. samex4rill says

    this post has been helping alot of ppl especially me thanks infact i remodify my wap2 template with css and it looked beautiful you can check it at www.samupdate.com

  21. avaot4real says

    hello don! I did as u wrote but after editing d index file….am now getting this error whenever i visit ma site
    ”Parse error: syntax error, unexpected T_BOOLEAN_OR in / home/u289087630/public_html/index.php on line 118”

    what should i do?

    • JUSTME says

      Good day bro… your article or post helped me…… but i have a problem now… i can’t see my child board……..

      • Don Caprio says

        I had that same problem when using one of the newer versions of bXk WapMod. I’m using v1.4-2 and it works great.

  22. everest says

    Don please it seems smf group is blocking that mod now i upgraded to the latest version of smf which is 2.0.4 and i cant install the mod again pls any help or if i can manually install it please Don do something

  23. Olili Bob says

    Nice post boss, my forum view on mobile looks same with the desktop version but am sure going to try this out no matter how long it takes.

  24. peter says

    Please sir
    i want to know how this new version WapMod1.5-2.zip is working before i give it a shot.
    my smf version is 2.0.5
    thank you

      • peter says

        Please Sir help me with tutorial on how to install WapMod1.5-2.zip for SMF2.0.5.
        I dont know what to do unless i here from you. It install with errors as discussed here: http://mattcworld.com/?p=418#comments

  25. von COLLINZO says

    nice post !

    I recently wrote a post on how to insert ads after first post in smf wap mod.

    You can take a look here http://www.guruszone.net/scripts-modifications/how-to-insert-ads-after-first-post-in-smf-wapmod-wap2-template/

  26. wale says

    i got this error message Parse error: syntax error, unexpected T_ELSEIF in /home/akinlexu/public_html/index.php on line 124 when i performed d operation above. pls help me to provide a solution with it

    • Don Caprio says

      You shouldn’t get that error if you copied the code right. If you’re trying to do this on a mobile phone, it’s not gonna work.

  27. walex says

    Pls don help me with the code right under this code if((isset($_SERVER['HTTP_
    ACCEPT'])&&strpos($_SERVER
    ['HTTP_ACCEPT'],
    ‘application/vnd.wap.xhtml
    +xml’)!==false)||isset($
    _SERVER['HTTP_X_OPERAMINI_
    PHONE_UA'])) code, I tampered with it and it is giving me serious problem with my forum

  28. NigeriaKitchen says

    Hello Don, pls will the wap2 guide you gave above work for users viewing the forum with a blackberry or samsung phone inbuilt browsers or is it for opera mini users only? If yes, how can I make my forum: www.nigeriakitchen.com become responsive to users viewing with blackberry phone, samsung, etc?

    Pls I really want my forum to appear as it is when viewed with a desktop to mobile phone users, any help @Don?

    I really appreciate your effort here, God bless you Don.

Share Your Comments & Feedback:

Please do NOT use keywords in the name field because they won't be linked to anything anyway...just use your real name. Let's try to have a personal and meaningful conversation.

Commenting Note(s):
To insert code into comments, use: [php]code in here...[/php]
Some HTML tags allowed: <strong>, <em>, <del>, etc. (Just don't overdo it, please!)

Current day month ye@r *