Written: October 3, 2010
I’ve been integrating client web sites with a popular WordPress plugin in called “Events Manager” that allows me to show show events in my sidebar:
I can also show events as a one month calendar:
One feature that was really missing from this plugin was search. There simply is no integration with the powerful search capability in WordPress for this plugin because of how this plugin was designed, it doesn’t use Posts therefore WordPress doesn’t know what to search.
My solution was to update the search.php file in my theme template by adding the following PHP code to search the custom table used by this plugin:
Line 13 is the name of the database table used by the plugin, in my case: wp_em_events.
Line 14 is where we get the search string that our web visitor has typed.
Lines 17 to 19 are where we query the database table looking for any matches with the search string in the event name or the event notes.
Lines 21 thru 27 will display all the events that match our search. On one client site the results look like this:
For my search.php file I inserted the custom code just above The Loop.
I love the power of re-using a WordPress plugin to enhance a web site however sometimes I have to get in there and do some PHP and database coding to get the feature that I need to complete the plugin.
Earlier today I vented about Things a Mac Cannot Do, and I feel much better now.
So, why did I buy a MacBook Pro in the first place?
1) Cross-Platform browser testing
In my web development business I need to make sure that web pages look OK in both PC and Mac. About a year ago I bought an iMac and used it in my home office. Now I’m not using my home office as much, instead I’m in an office space in Tualatin so I didn’t want to lug the 24″ iMac along with me each day. The portability of the MacBook Pro lets me tote it to the office. Most Mac users have Safari so I double check that my client sites look OK on in Safari. The biggest issues right how is that bold fonts in Safari on Mac look about 25% larger than on any other browser.
2) Multi-OS Support
As a backup when my PC dies, I need another computer to work on. With the MacBook Pro I have installed Windows XP and Windows 7 using a virtualization tool from Parallels. Four different attempts at putting Mac OS X on my PC simply failed, so having a MacBook Pro it was very straight forward to get multiple OSes up and running without violating a license agreement.
On the MacBook Pro I have installed two main Windows programs: Outlook 2007 and Quicken 2009. I can restore the two back-up files for these programs and continue working on my MacBook Pro.
3) Better Sound
I love classical music and the built-in speakers for the MacBook Pro simply sound better than the Harmon Kardon speakers on my HP Laptop.
4) LCD Display with Matte Finish
My HP laptop has an annoying glossing finish, so that means that I can see my own reflection in it like a mirror. Talk about distractions. On the MacBook Pro my LCD version has the matte finish, or what they also refer to as anti-glare.
While my HP is in for replacement of the motherboard I’m having them swap out the glossy display for a matte display.
5) Built-in Bluetooth
To get a wireless mouse to work on my HP laptop I had to buy a Logitech mouse with a USB connector and plug that into a free port. I don’t like that little connector hanging out. The MacBook Pro has bluetooth support built-in so no ugly USB connector sticking out of the laptop. My wireless mouse on the Mac is the Magic Mouse, very cool to use the finger motions and it even supports Right-Click – something that all PC users simply have to use.
9) Build Quality
My PC is mostly plastic and nylon, not exactly long lasting materials. The MacBook Pro is aluminum and well built. I’ve upgraded the Hard Drive from 260GB to 500GB and got to open up the case to complete the job. The MacBook Pro is a marvel of modern engineering and styling.
10) Reliability
I just read this study from SquareTrade that shows the reliability of Apple laptops to HP laptops is about a factor of 1.5X in favor of Apple.
On Wednesday this past week my three year old HP Pavilion laptop running Windows 7 decided to die. This failure caused me to use a MacBook Pro as a replacement.
Fortunately for me just the week earlier I had bought this MacBook Pro from a guy on Craigslist. What attracted me to the MacBook was the fact that it could run both Mac OS and Windows 7 using a virtualization technology from Parallels.
Installation was straight forward however there was a point where I had to tell my virtual Windows 7 machine that there was no floppy disk installed.
So, here’s my list of things that a MacBook Pro cannot do compared to a PC laptop:
1) Font size
I’m used to a 17 inch display with resolution of 1440 x 900 pixels which makes the default fonts used in programs easy to read even for my 53 year old eyes.
On the MacBook Pro they couldn’t live with the standard 1440 x 900 pixels, instead they had to increase the pixel density to 1680 x 1050, just enough increase to noticeably decrease the size of the fonts, forcing me to start wearing reading glasses. Yes, on a few applications I can increase the font size by pressing Command +.
On the PC with Windows you can change the size of the fonts globally in the Control Panel, not so with the System Preferences on the Mac OS X.
Another odd difference on the Mac is any font with the Bold tag, or in HTML the Bod syntax. On the Mac this bold size is much more pronounced than on a PC, even when using Safari on Mac and Safari on PC the bold is about 25% bigger on the Mac. It even makes pages like www.cnn.com look just ugly.
2) 10 Key Pad
My HP has a full-size keyboard plus a full 10 key pad to the right of the keyboard. Very useful for: numbers, Home, End, Insert, Page Up, Page Down, Delete.
All of this is totally missing on a MacBook Pro. Apple decided to omit the 10 key pad and dedicated keys in favor of a large space devoted to the speakers. OK, the MacBook Pro has way better sound, however I dearly miss my dedicated keys. Instead on the MacBoook Pro I have to used multi-key sequences to mimic my single key commands.
Now that I’m talking about keys I have to mention that the Control key on a PC is located in the bottom-left corner and fits my left pinky finger perfectly, since I do hundreds of Control C and Control V operations per day.
On the MacBook Pro they move the Control key inwards, so that I cannot use my Left pinky finger any more for Copy/Paste, etc. Instead I have to use Command C and Command V, which requires me to learn an entirely new finger position.
This transition is so awkward, it reminds me of a musician trained on an instrument and then being handed a similar instrument but with the keys in totally new locations. Steep learning curve is required.
3) Resize a window
On a PC I can grab any of 4 edges to resize a window.
Not so on a Mac, because I can only resize by grabbing the lower right corner.
4) Delete key
On a PC the delete key will actually delete the character to the right of the cursor however on a Mac the same delete key does a backspace instead. To get a real delete key on the Mac you have the two key combination of Fn Delete.
5) Screen layout
On a PC I love to have 100% of the screen layout devoted to my tasks at hand, it’s simple to do.
On a Mac you have this Menu Bar on the top of your screen at all times whether you like it or not. To me it is a major annoyance to see the Menu Bar on the top of my screen. It becomes even more ludicrous when I connect an external monitor to my laptop and have an Application on the external monitor yet the Menu Bar for my App on the right is displayed on the laptop screen on the left, forcing me to mouse over two screens to do things like File>Print or View>Options. Talk about unintuitive.
6) USB Headset
On my PC I just plugin the USB headset and the sound switches from the built-in speakers to my headset however on the Mac I have to go into System Preferences> Sound and tell it to use the USB headset.
7) Replacing the Hard Drive
My MacBook Pro came with a 260GB hard drive and I wanted to upgrade it to a 500GB hard drive. On my PC I just remove two screws, unplug the old drive and plugin the new drive, easy.
On the MacBook Pro it is more involved requiring a dozen or more screws and a careful sequence (found on the web) taking about 15 minutes to complete.
Summary
Yes, the PC and MacBook Pro are two different animals and I have to re-learn how to do simple, repetitive things. I just wanted to rant and rave a bit today.