You are hereTech News
Tech News
Tech News
phpBB3 Mobile Style / Theme
One of my users pointed out to me while phpBB 3 renders fine on mobile browsers with the default template, there's too much pinching and zooming and the such to read a phpBB forum effectively. Therefore, he wondered if there was a style I could implement with some browser detection so that mobile users would have a better phpBB experience. To my surprise, phpBB 3 has no inherent support for mobile browsers and it doesn't seem as if phpBB 4 has any plans on implementing a mobile style/theme/MOD by default. After a lot of searching and some trial and error, I finally found a working solution and wanted to write out that post here so people could follow.
I found phpBB Mobile which was only just recently developed (good timing) less than a month ago. It is a MOD for phpBB that allows for user agent detection so that if one of your normal users browses from their mobile phone, their browser's user agent is detected and a mobile style is used to display your forum. While there is some documentation and a forum dedicated to this MOD, I wanted to add some notes to their documentation.
- Download the phpBB Mobile MOD.
- Extract the archive locally before uploading to your server for easier manipulation.
- Inside the archive open /phpbb_mobile_(version)/install_phpbb_mobile.xml in a browser so that you can read the instructions.
- The first "step" you are presented with is a SQL CREATE TABLE command to create the phpbb_mobile table. Note, if you used a different table prefix for your phpBB 3 install, you need to change the table name in this SQL query (for instance, I used phpbb3_*). Run this SQL command on your database server.
- The next section is a "File Copy". Copy the files from your extracted archive in the /phpbb_mobile_(version)/root/ folder to the root section of your forum installation on the web server.
- The next section is called "Edits". Download the /includes/constants.php and /includes/session.php files from your web server and make the necessary edits locally and then re-upload back to your web server.
- You will be at the "DIY Instructions" section. Log into your Admin Control Panel, Click on the System tab, click on "Administration Control Panel" link on the left side vertical menu, click on Styles, click on Style management, click on Styles, and then in the drop down to the right select phpBB Mobile and click Add module.
- You should now click "Enable" to enable the module.
At this point, the MOD is installed, but still doesn't do anything "useful" for your mobile users. You still need to install your mobile styles and then create the browser rules and associate them with your mobile styles. You might be wondering if anyone has developed any good mobile styles. The best one I found was an iPhone style also made by phpBB Mobile.
- If you need to install a new mobile theme at this point, you must go back to the System -> Admin CP -> Styles -> Style management -> Styles page and Delete the phpBB Mobile MOD. Why? Because, if you go to the Styles tab when this MOD is installed (doesn't matter if Disabled or Enabled), you can't properly install new styles/themes. After this is done, install your mobile style as normal. After you are done installing the style, re-add/re-enable the phpBB Mobile MOD.
- At this point, you need to know what your mobile style's Style ID is. If you go to your database, browse the data in the phpbb_styles table (replace phpbb with whatever prefix you used) and you'll want to take note of the ID for your mobile style.
- In the Admin CP, click on the Styles tab. You will now notice that phpBB Mobile options are displayed right there on the Styles page. Here, you will add the rules for which style is shown for which browser. The way the rules work is that the "Browser" box should include some unique text string found in a specific browser's User Agent and then the ID for the style you want should go into Style box. So, for instance I added the following - "Android", "iPhone", "webOS" all pointing to style "5" which is my mobile style.
That's all you need to do! Now, obviously, with every upgrade you make to the core phpBB installation, you will have to make sure that this MOD doesn't break. Good luck.
How To: Setting up Virtualization on Windows Using VMWare Server
One of the greatest strengths of today's computing environments that is completely underutilized by most of the user base around the world is that of virtualization. Virtualization allows you to run multiple "guest" operating systems simultaneously on a single machine. You might ask - "Why is this so groundbreaking?". Virtualization offers numerous advantages over traditional single operating system setups for a lot of reasons, but not limited to the following -
- No longer need to dual, triple or "more" boot your main machine so you can stay in the operating system that is most comfortable to you while allowing you to learn, test and experiment with other operating systems (great way to learn Linux).
- No need to run multiple computers saving on power and equipment costs while also saving on space (only needing one keyboard/mouse, no A/B switch, no KVM needed, etc.)
- Quicker and more efficient restores of system settings and data allowing for more testing of applications, settings, etc.
- Increased flexibility in moving virtual machines from one physical machine to another.
Those are just some of the advantages of setting up a virtual environment. Now that I have convinced you on virtualization merits, how do we get everything setup. My virtualization software of choice is VMWare Server 2.0 which is free to use and allows you to install this software on your current operating system. My computer at home was running Windows Vista Ultimate at the time which made the decision of what virtualization software easy to use as Windows Virtual Server 2008 doesn't support Windows Vista.
Installing VMWare Server 2.0
Here's a pretty easy guide to follow for installing VMWare Server.
Once VMWare Server 2.0 is up and running on your "host" machine, you want to start setting up "guest" machines. In preparation of starting the guest virtual machine process, you want to obtain an ISO of every operating system you want to setup. For me, I get all my Windows ISOs through my MSDN Universal subscription, but you can definitely create Windows ISOs other ways. For Linux distros, you can download those freely from that distro's website. After you have all the operating system ISOs you need, you are ready to create your first guest virtual machine.
Creating a Guest Virtual Machine
For this example, I am going to create a Windows 7 Ultimate guest virtual machine because it's probably the most complicated (and that's not saying much). I followed this guide for creating a Windows 7 virtual machine. You would follow very similar steps for setting up any other VM whether Windows or Linux.
Using Your New Guest VM
I won't rehash too much of what is already spelled out in the above guide; however, there are a few things I want to point out. When you load up the VMWare Web Access Home Page, you may get an authentication prompt and you have no idea what to put in. You will put in the same username and password that you used to log into Windows. After that, you will want to make sure you install VMWare Tools as directed by the guide. This allows for much easier copying and pasting between your host and guest machines. In addition, I have found that VMWare Web Access doesn't work properly in some browsers like Google Chrome so you might be forced to use a browser that you don't normally use like Internet Explorer - especially when trying to launch the console plug-in.
Once you have powered on your guest VM, click on the Console tab in the Web Access page, load the console plug-in viewer and start using your new VM! Good luck to everyone trying to setup virtualization - once you go virtualization, you'll never go back.
Filezilla and Unhiding .htaccess
Here's a quick tip post that will help those doing web development on an Apache web server and cannot see their .htaccess which FTPing. If you use Filezilla as your FTP client, by default, Filezilla may hide the .htaccess file during a remote directory listing. To view the file using the Filezilla FTP client, click on Server and make sure the "Force showing hidden files" option is checked. Your .htaccess file should now be viewable in the remote directory.
Installing Magento on 1and1 VPS Hosting
After having issues installing Magento on a GoDaddy Virtual Dedicated Server (VDS), I had two clients that wanted Magento installed on 1and1's Virtual Private Server (VPS) hosting package. After struggling with this process, I decided that I would document that process.
- Log into your 1and1 Control Panel.
- Click on Domains and setup your domain as necessary. This will link your domain to your hosting package.
- Click on Server Administration -> Server Access Data. Here, you will find all the login information needed to login to your Virtuozzo and Plesk control panels as well as your SSH login.
- Login into the Virtuozzo control panel. Click System Services and then drill down into the psa and mysqld services to make sure they are started and that auto-start is enabled.
- Login into the Plesk control panel. Click Domains -> Create Domain. Fill out the domain information as necessary and create your FTP account at the bottom of this page. Click Next when done.
- On the resulting page, uncheck the option for PHP safe_mode. Click Finish at the bottom of the page.
- Upload the Magento files to the webserver. You can most easily do this by FTPing using the login you created when setting up the domain in the Plesk Panel. You can also SSH into your server, upload the Magento tar and untar the archive into your /var/www/vhosts/
/httpdocs directory. - Try loading your domain in a browser. If you try to load your site in a browser and you get a "Whoops" error stating that you have an invalid PHP version, this is due to the fact that when 1and1 images your server they use an older version of PHP. Therefore, you have to update your version of PHP and you should continue with these steps. If not, try to install Magento and disregard the following steps.
- SSH into your server and type the following command - wget -q -O - http://www.atomicorp.com/installers/atomic.sh |sh
- Type yum update to check the available updates, but choose No to install these updates.
- Type yum update php and choose Yes to all the prompts.
- Type yum update mcrypt* and choose Yes to any prompts.
- Type yum update mhash* and choose Yes to any prompts.
- Type yum update php-mcrypt* and choose Yes to any prompts.
- Type yum update php-mhash* and choose Yes to any prompts.
- Type /etc/init.d/httpd restart to restart Apache.
- Re-load your domain in your browser and you should be able to install Magento now.
Hopefully, this guide helps everyone get their Magento installation up and running with little effort on 1and VPS hosting.
Installing mcrypt on a GoDaddy Linux Virtual Dedicated Server (VDS)
Recently, I was given a consulting project to develop an e-commerce site and I immediately thought of Magento - an open source e-commerce solution written in PHP. Magento is one of the better pieces of software that goes widely unknown by many since very few people develop e-commerce sites (as opposed to say Drupal where everyone and their kids are bloggers).
However, upon installation of Magento on my GoDaddy Linux Virtual Dedicated Server (VDS), the installation will stall on the mcrypt dependency. The mcrypt library stores several algorithms that help secure your e-commerce site's data. Unfortunately, by default, the GoDaddy VDS package does not have the mcrypt library installed. To install mcrypt, follow these steps -
- SSH into your VDS with your favorite SSH client or the SSH Java applet offered by GoDaddy.
- Login with your credentials.
- Su to the root user.
- Type "yum install mcrypt*". Say yes to the prompts.
- Type "yum install mhash*". Say yes to the prompts.
- Type "yum install php-mcrypt*". Say yes to the prompts.
- Type "yum install php-mhash*". Say yes to the prompts.
- Restart the server.
Once the server has restarted, you can re-run the Magento installation and you will be able to successfully complete the wizard.
Fixing Windows Update Failure - Error Code 0x643
Today, as I was patching my machine, I noticed that I still had not installed the Visual Studio 2005 Service Pack 1 on my work development machine (a Windows Server 2003 R2 box). I loaded up Windows Update, selected the VS 2005 SP1 checkbox, let the update download and chose to install. After what seemed like 10 minutes of hanging and nothingness, the update installation failed. Huh? I went to "Review Your Update History" and clicked on the question mark next to the failure icon and the resulting pop-up simply stated Error Code: 0x643 and with 3 very useless links to find out more information.
To save everyone time, the fix can be found here and this link will ask you to download a patch that fixes the insufficient contiguous virtual memory problem that prevents you from installing certain .msi or .msp files. Run the executable after it has finished downloading and then return to Windows Update to finish patching your software. Good luck!
Microsoft Virtual Server 2005 R2: Fixing the "An error occurred accessing the website application data folder" Error
Recently, while trying to work on simultaneous consulting projects, I had the need to install and run multiple VPN clients on my development machine. What was the result of trying to actually do this? Blue screened. I pretty much had figured something nasty was going to happen, but curiosity killed the server. Therefore, I figured I would finally turn to virtualization to solve my dilemma. I recently received my MSDN Universal disks and decided to install Microsoft Virtual Server 2005 R2 on my Windows 2003 Server development box. The install is quick and painless and the initial post-installation documents states that a web site was created to administer your Virtual Server. I loaded up the URL and received the following error -
Just to give you an idea what type of environment I was working in, I was trying to set this up using -
- Workstation: Windows Server 2003 Standard Edition
- My workstation was part of a Windows 2003 Domain
- I was signed into my workstation with my own account which is a Domain Admin
As a Domain Admin, I would have assumed that I had the proper credentials; however that didn't seem the case. To resolve this problem, I had to create (or use an existing) local administrator account and when presented with a login box, to use the local login and not your domain login. In addition, if the issue persists, open up IIS and under the Authentication options for the Virtual Server site, make sure that anonymous logins is unchecked. Those two options should resolve any initial security issues that you may have after first installing Virtual Server 2005 R2.
Early phpBB 3 Impressions
Although there are numerous free bulletin board software packages available, ever since Hagrin.com was registered I made phpBB my board of choice. Recently, phpBB announced their version 3 Release Candidate 1 package and I decided that I would give the new version a test run and see how the package is shaping up. Since barring any major bugs this RC would be made the final release, I felt comfortable evaluating the package in a production environment and to evaluate it under the same careful eye I would any production application.
The one area that I will cut them some slack is in the documentation department. Unfortunately, when you're installing and setting up a piece of brand new software you rely on the documentation heavily sometimes - especially, like in my case, where you are upgrading an older system and your main concern is data preservation. Problems started immediately when I went to read the upgrade instructions from the phpBB website and found limited "just point and click" instructions to perform the conversion. What this page fails to tell you is that it's the furthest thing from the truth for completing a sucessful 2.0 to 3.0 upgrade. To actually successfully upgrade, you need to:
- Do not, I repeat not overwrite your phpBB 2.0 files. You need to keep these in place.
- Copy phpbb 3.0 files onto your webserver into a directory different than your current forums directory.
- When creating the database tables, you need to make the new phpBB 3.0 tables in the same database/schema as your old 2.0 tables, but remember to use a different table name prefix.
- Complete the installation process.
- Complete the conversion process (the point and click interface mentioned in the link posted above).
- Move your old phpBB 2.0 files out and move your new phpBB 3.0 files into your old forums directory.
Not so point aned click huh? However, I'll cut them some slack because I was able to find the documentation somewhere eventually and documentation usually catches up over time. Oh, and don't forget to clean out your database of the old phpBB 2.0 tables that are still there.
Once the board is up and running, you do have to marvel out how things have progressed for phpBB over time. Most of the changes you see are on the backend; however, the default prosilver theme definitely gives users a brand new experience when using phpBB 3.0. First, in the prosilver theme, user information for a post is located on the right hand side as opposed to the traditional left hand side. New user options such as reporting posts and being able to grab in-depth information about a poster/poster in a single click proves a worthwhile feature. A "Friends & Foes" option was introduced to give users the ability to create a more social networking/Slashdot like feel to their forums where having friends and foes allows users to filter through data easily. On the admin side of things, phpBB did tremendously great work when handling how bots are able to crawl your site by not assigning them a SID or session ID so that your URLs remain consistent and void of any long, always changing querystrings. phpBB developers also improved the caching system which should help server load in times like the "Digg Effect" and other large sites picking up your site's content. Finally, phpBB finally gave admins the ability to edit templates through the Admin Control Panel as opposed ot having to edit files manually.
However, there are a few missing features from the newest phpBB version which disappointed me. The lack of a RSS feed for the user's board really seems the biggest missing feature especially with the advent of iGoogle, Netvibes, RSS readers, etc. In addition, especially with the explosion of CSS layouts, I'm surprised that users do not have the ability to move poster information from the right to left side in the default prosilver theme and that type of functionality isn't introduced.
Overall, I give phpBB a thumb up on their newest release, but would still like to see some very rudimentary improvements and features added to bring the board more inline with how users are using the web these days.
Drupal 5, META tags and SEO
After a long overdue hiatus from writing in my Search Engine Optimization Guide, I have finally added a new entry in a series of hopefully many new articles covering SEO issues raised on today's Internet. Today, I added an entry concerning Drupal 5 and assigning unique META tags to help differentiate your content. Check back for more SEO articles as I can crank them out (hopefully one a day for a while).
SEO: Drupal 5 - Adding Unique META Tags
Posted By: hagrin
Date: 30 May 2007
Overview:
While pre-packaged software can save a lot of time in development costs, if not properly configured, a webmaster could potentially cripple their site's search engine rankings if certain search optimization techniques and guidelines are not followed. Drupal is a content management system that is extremely feature rich through it's module system and community support; however, search engine optimization isn't an extreme focal point for their developers. Therefore, out of the box, Drupal does fail at being 100% SEO friendly. Fortunately, due to Drupal's strong community, SEO friendly modules have been developed. One such module, META Tags (also known as nodewords), closes a major SEO deficiency extremely well and provides Drupal site owners the flexibility to create high ranking sites.
Aren't META tags Outdated?
Now, I know what you're all about to say - META tags don't work anymore and are so "1990s". While it's true that they aren't as influential as they once were, META tags still help identify content to search engines, especially the minor search engines. In addition, unique META description tags help prevent your pages from being put into "supplemental hell" and help users get a better idea of what your content actually contains. Even if the benefits aren't immediately realized through search engines weighting META tags heavily, including unique keyword and description information can only serve to help users find your content and differentiate the content across your site.
How Does it Work?
Installing the META tags module is extremely easy and works exactly like every other module installation. Once installed site admins can go to the Content Management section and click on the newly created Meta tags link. Here, you can set all the options you need including a global copyright, a GeoURL, global keywords, robots values and other settings. In addition, if you are utilizing categories or taxonomy, you can set keywords based on the tags you select which provides you flexibility at every level. I would suggest using some standard keywords that apply based on the tags you select and then add content specific keywords at the page/story level for the best performance.
If you plan on using Drupal to power your site, installing the Meta tags module is a search engine optimization must.
Resources
Version Control
- Version 1.0 - 30 May 2007 - Original Article