Archive for May, 2009

featured category image wordpress-tips category image A Complex Project Using WordPress

I was recently approached by a friend and they asked me if I would be interested in setting up a new web site for them. As always, I complied and then they gave me the guidelines and specifications as follows:

1. The website was to be a bartering site and the idea was that users would add their details to the website as a means of offering their services and/or products. How I made it and what software I used was totally up to me, although knowing I was a ‘WordPress Pimp’ for most of my site creations, my friend did ask that it was not to look or work like a blog and that people could not easily see that it was a WordPress site. It needed to look professional and yet be very user friendly as well. He wanted it to run as a CMS.

2. There needed to be a login access point available via all pages throughout the site which contained username and password textboxes. Further to this, it was necessary that once the user logged in they were taken directly to a specific front-end page within the site. There was no need for users to access the admin area or backend at all.

3. Once the user logged in the login textbox would be replaced with a ‘Welcome [username]‘ and the option to logout as well. It also needed to be made perfectly clear that they were now logged in and were accessing as a member, as opposed to a guest.

4. Each user’s details needed to be set out in specific format which was consistent throughout the site. A mock PSD file was given to me showing the overall site ‘look’, including the front page, user details page [profile], search page and information pages. Each page had its own set of functions to include and each users details would be a page that could be read by other members. It was to contain all the details of what they offered and what they wanted, plus contact details, an image, and it needed to have keywords specific to each profile

5.  Guest were to be allowed access to a few pages throughout the site but members could access 99% of the site. Admins needed full access to everything but they were not overtly website savvy so it needed to be user-friendly for them to manage – without having to read lots of tutorials etc.

6.  The details the users provided had 2 distinct parts. a] Details of what they offered in terms of bartering and b] details of what they wanted to barter for in return.

7.  The search functions needed to be good enough to cater for complete searches, searches for what was offered and searches for what was wanted.

8. The site had to be quick loading and able to cater for upwards of thousands of users within the database, with possibly hundreds+ online at any given moment.

9. Each page required different set of functions, and in addition the sidebars also needed to have their own set of different functions, on different pages and posts too.

10. SEO was an important consideration and had to be dealt with in the best possible way.

And that was the basic starting point.

Now I have to admit, a few of these specifications had me thinking quite a bit as to whether or not WordPress was a good option for this particular project. But I like a challenge and so I did a quick bit of research, sat down and thought about the best way to go about a few of the major  requirements and then I dug my boots in and went for it.

Of course, the great aspect of opting for using WordPress is the sheer amount of plugins that are available, mainly because of the large volume of people using this product.

In all honesty, I would have to say that this has not been an easy project and at times, I was pulling my hair out wondering how I was going to accomplish some of the elements needed, but I am happy to report that as of now, it is all completed.

I have learned quite a bit about some parts of WordPress that I have never really touched upon before, had to find and then ‘hack’ some of the plugins I decided to use for the varying areas, and perhaps most significantly, had to do all of this within a very short time frame.

If nothing else, this project really has proven to me that WordPress certainly is a very flexible product and that it can be used in many different ways.

For those of you who think that some of the elements involved within this project would be useful to you, just let me know via the comment section and I will help out where I can.

I am also considering packaging the whole thing and making it available for others too, but still not sure as to whether this is a good idea or not.

featured category image wordpress-tips category image Theme Footer Spam: How to remove

I was recently working on a site for a client who had chosen a theme they liked and then hired my services to individualise it for them. The basic structure they preferred was in place, but they wanted to change the ‘look’, add in some further functionality, and make it so that the theme was more suited to their particular style. I find that this type of work is all pretty much the norm for many clients and all was going well with this project until I tackled the footer and noticed that this was one of those themes [which are becoming more and more prevalent] that contained some script/coding, which meant that the user could not remove the link back to the theme design author.

Now, I am all for giving credit where credit is due and in 99% of cases I do leave the link to the theme designer in place. Obviously, some clients specifically ask to have this removed, however in this instance, it was not so much that it was linking back to the theme author, but rather, that it was full of links and references which were dubiously ‘spam’ focussed.

So, into the footer file I dived, expecting to find the normal layout and a href”s which could be easily changed. And this is where the trouble started. Instead of the file displaying PHP and HTML code, it simply contained a long string of letters and numbers all wrapped very neatly inside one set of PHP tags, such as this example below.

?php $E7dab924f505e1bffgh8a0292fa5883a9746=’dZDBasMwDIbP81OIPEB82Wm4Lmwt7Lw6jdelZiJRY
4trHVQMoefs4oZQymi2RJ/2fxH636iSfjeAV2h25KSah0Vpls1ec1UxneUxWOcx9JIJe0sqMKOE2pOBwCwYI
RZ3JgaLGOHI8o7VWprFSMbk2oKVyFU6y9UgbBF5oOnRfJL1o7Cp4btv0kW4+VsbMXqgKnfQAfhAHOVRrT
aLTwBX8BHB0jx7VpForyQI1p6ewrxhlDKvQbBG8Fq/8Hh7fnXar3K4bKbfvEhUZJZdsVyuhmTDNMN8dacc+
PNCS3WaO9LOHurTlmn9U3′;echo(gzinflate(base64_decode($E7dab924f505ed4j1bf8a0292fa5883a9
746))); ?

Removing the code does nothing more than destroy the footer completely and trying to leave it in place and work around it, also has it’s fair share of other issues, so what to do to make this a working footer file? Now I would imagine there may be several methods of choice at this point, with the dissection of the theme functions php file  – in unison with hacking the footer file – probably sitting at the top of the ladder. The trouble with this, was I did not have the time to spend going down this road, so I opted for something else.

What if I was to bypass the footer call completely, I thought to myself? And that is exactly what I did. In typical fashion the footer was being called from all of the major post and page files by using the standard code:  <? php get_footer(); ? >

So, in order to by bypass it I created a new footer file, named it footer_new.php and then simply dropped in a new call using the following code instead: < ? php include(‘templates/footer_new.php’); ? >

I prefer to keep additional customised pages in a templates folder, so that is why you see the reference to ‘templates’ in the code, but this can work just as well using any other named folder or you can place it straight into the theme root directory just as easily too.

Note too: That solved the problem of the footer being uneditable, but as I do not like to leave code sitting on a site that I have no real idea as to what it is doing, I also opened the functions.php and removed the same lengthy string of code as was found in the footer, and just to be safe, also deleted the original footer.php file.

If you know of an easier method, then please do let me know, but for now, at least this appears to have resolved the problem and given me full control over the site as it should have been in the first place. Another factor that may need to be considered here, especially in light of the fact we do not know exactly what this code is doing in its entirety, is that your site could well be compromised. Again, just to be safe, I changed the login passwords  [after removing the code] in order to prevent any further problems.

post-its category image Current Work in Progress: 12-05-2009

Client Four – Set up of WP as a CMS – complete overhaul of backend panel to cater for large user database – redo backend interface. Adding complex role and login features.

post-its category image Project Completed: 12-05-2009

Current Projects:
Client Three – Recovery of ‘lost’ database and repair of tables. Update of WP and plugins to latest versions. Add widgets to theme

plugins category image wordpress-tips category image An Easy Gallery Option

There are literally hundreds of ways you can make a gallery within WordPress, with various options, such as using gallery plugins, external scripts and plain ‘ol html code.

One option you may not be aware of though, is to use two plugins combined that run on the LightBox display structure.

Here are 6 images that I have uploaded to demonstrate how this gallery looks on the page, and then we will take a look at what is involved in setting up a gallery such as this.

Keyword: EASY

Technology400 x 300A small image such as a logo3d_006zhuchki_10duckmona

Personally, I am not a huge fan of the Media Uploader, [I much prefer to use ftp and my own-named image directory] however, for this exercise, I have used what WordPress specifically provides for this task.

So, what did I need to make this simple gallery?

1. Two plugins: Lightbox 2 [basic Lightbox which provides Ligtbox functionality] and Add Lightbox [automatically adds the rel="lightbox[ID-OF-THE-POST]” to images linked in a post. The ID-OF-THE-POST is unique per post so all images per post are grouped in one lightbox set.]

2. A few assorted images – I deliberately chose a mix of varying sizes for this example.

3. 5 minutes of your time.

And that’s it! What could be easier for a simple little gallery?

post-its category image Now using WordPress 2.7.1

No known bugs at the moment and all is secure and running smoothly