Cleveratom Website

Cleveratom, PHP coding, Web Authoring No Comments »
cleveratom website

cleveratom website

The Cleveratom website has been given a new look and a new engine, too! For the last few months we have been relying on WordPress to drive things along, and whilst it has been OK, it has never been what we wanted. It was better than a static page, but never really did the job we needed. Fortunately, that has all changed today as we moved over to the rather brilliant ‘CMS Made Simple‘ content management system.

If you head over to www.cleveratom.co.uk you will see the new livery and be able to read all about the work that we are doing. There are many things still to add in relating to the projects we are doing, and you can always sign up to the newsletter in order to get more information on a (fairly) regular basis!

Getting a new site up and running is always traumatic in some way, and today we did battle with DNS servers, Nameservers and email records. Sheesh! No doubt we are all the better for the experience!

Engage East England, CMS Made Simple

Cleveratom, PHP coding, Reviews, Web Authoring No Comments »

A recent project required us to create a website for Rochford District Council, Uttlesford District Council and Essex County Council where users would be able to access information relating to public consultations and best practice. Nothing particularly remarkable in that – this is the sort of project that we enjoy doing as it is for a very good purpose and allows a degree of creativity in the design and approach to creating the site.

Read the rest of this entry »

WordPress bug, format.php, invalid wordpress html code

Cleveratom, PHP coding 1 Comment »

It may come as a surprise to some (but not many) folk to know that there has apparently been a long running bug in wordpress from about version 2.1 which will cause your website to fail validation. It only happens in certain situations, such as when you try and add a plugin to capture form based information from your site users. When the form code is passed to the browser, a spurious ‘p’ tag gets added in to the ‘div’ tags and therefore the code is not valid… Keep in mind that the ‘doc type’ declaration is important here too, and that in my case I was using XHTML 1.0 transitional.

So what to do? Well, on the wordpress.org website there are several threads about it, including this one where I posted a response earlier today. It seems that the issue is at least ten months old, and various solutions have been speculated. Indeed, some of these solutions seem to work for some folk, but they sure as heck didn’t work for me. Largely, they involve editing one of the core wordpress files – ‘format.php’ and either adding in a new line, or taking some away. The new line is supposed to be inserted as line 67 and reads:

$pee = preg_replace( '|(</div[>]*>\s*)</p>|', "</p>$1", $pee );

This did nothing for me at all. Other solutions included commenting out lines 66 through to 68… still nothing. However, when I asked my colleague Alex Blanc to look at the code he very quickly spotted that there was a simple fix – in his words ‘a bit of a sledgehammer approach…’ but it seemed to work.

Add this as line 91:

$pee = preg_replace( '|</p></form>\s*</p></div>|', "</form></div>", $pee );

(one line only, folks, no carriage returns…)
The placing within the function in ‘format.php’ is important – put it at the bottom of the function!

Now, it may be that you don’t need this, or that it doesn’t actually work for you – it worked for me today though. The point is that this is a known issue in wordpress and has been around for nearly a whole year, and survived several updates of the software. It really ought to have been sorted out properly by now… but hey – this is open source, right? :-)

Dark Mood V2 WordPress theme, editing wordpress files, encoding PHP

PHP coding, Scams, Web Authoring, scripting general 8 Comments »

It may come as no surprise to some to find that freely available themes have got advertising embedded in them by default. It came as a surprise to me, mind you! I downloaded and installed the Dark Mood V2 wordpress theme by Ed Canape and found that in the footer file there was a PHP function that positioned some adverts. Not rocket science, but I wasn’t happy with the kind of ads that appeared. One was a pay per click affiliate program, one about Asian entertainment (ooer…) and one about Philipine paradises. However, what really ticked me off was the fact that the function had been encoded so as to make it hard to unpick it and remove said adverts.

Of all the encoding methods available to PHP programmers, possibly the best is from Zend. One of the most pointless is gencoder (although free). Luckily, it was gencoder that had been used on this occasion. The file looks like this:

encoded php

Now, as you can see there is no easy way to get into the code and remove the advertising links. However, there are two possibilities.

Firstly, you can create a CSS rule in your stylesheet which sets the footer ‘a’ display to be none:

footer a {
display:none;
}

All this does is remove any clickable links in the footer, but leaves the remaining text. This is at best a workaround, but can get you out of a fix if you are in a hurry.

The second thing to do is decode the file! Again, there are two ways to achieve this, but probably the simplest is to edit the ‘eval’ statement to read ‘print_r’ instead. If you then run the code in your browser you’ll see that it makes a bit of a mess visually, but you can still right click and ‘view source’. What you are looking for is at the bottom of the page:

if((isset($v) AND $v==0) OR (isset($t) AND $t==false)){die('This script is protected by <a style"color:cyan\" href="http://www.gencoder.sf.net\"><b><font color"#330099\">G-Encoder</font></b></a>');}echo "<div id"footer\">n";
echo " Powered by n";
echo " <a href="http://wordpress.org\">WordPress</a>n";
echo " and Design by Ivy's <a href="http://www.rubberstampguides.com/\">Rubber Stamp</a> n";
echo " Guiden";
echo " <p><a href="http://www.kirrhi.com/\">Pay Per Click Affiliate Program</a> | <a href="http://yeinjee.com/asianpop/tag/asian-entertainment/\">Asia Entertainment</a> | <a href="http://www.paradise-philippines.biz/\">Paradise Philippines</a></div>n";
echo "</div>n";
echo "n";
echo " <?php wp_footer(); ?>n";
echo "n";
echo "</body>n";
echo "</html>n";

Now you can see the code more clearly, and you can easily see what needs to happen. The last four lines are all you need… in fact, one of those can be deleted! What you really need is the call to the wordpress footer routines and to close the body tag and close the html. This is all that is necessary to complete the footer file in wordpress. Armed with this knowledge, go back and change the ‘print_r’ statement if you like, but better yet, just delete all of that guff. In it’s place simply add the following few lines of code. You can leave out the ‘div’ tags if they are not needed:

<div class="footer">
<?php wp_footer(); ?>
</div>
</body>
</html>

and that’s it. Save the file and you have got yourself an advert free footer space on your wordpress blog.

Thanks (as ever) to Alex Blanc for his timely and ultimately very simple solution to the problem, and no thanks whatsoever to the person who decided to a) put adverts in the footer, and b) encode them at all. I believe each person needs to have the right to choose whether to display adverts, and in this case I chose most strongly not to!

The Fixture Exchange, Donation to S.P.I.R.E

Fixex.com, PHP coding No Comments »

For the last ten years or more I have been working with Pete and Liz Conner to run an online site for youth rugby teams to make fixtures at short notice, when their normal ones have fallen through. The situation can be dire for some clubs – having a team eager to play, being let down by their opposition and deciding that soccer might be a better sport to play… some clubs never fully recover from the loss of their youth teams, since these are the life blood of the club and grow to be the next generation of adult players.

Hence the need for Fixex – a wonderful site for teams to use at a minimal cost. The fee is just £10 per season for the entire youth section in a club to make use of the service. For that you get unlimited access to the database of available fixtures, your own space to manage your fixtures and links to every other club in the exchange. It isn’t the only exchange in the country, but it is a good one.

Pete Conner died in 2005 and there was a real danger that the  exchange wouldn’t survive. The software was aging and needed updating, Liz was in a terrible state after her loss and I have to say I wasn’t much better! However, we persevered. I found out a bit about PHP coding and re-built the site, Liz found out about using email and took on the callers to the exchange. Between us we have managed to get by.

Each year all of the proceeds from running the system are donated to S.P.I.R.E (Support Paraplegics in Rugby Enterprise) – a charity that was established by the RFU. The donation is modest, usually around £250 to £300 pounds, but it is consistent. The presentation is made at Twickenham every January during the annual ‘extravaganza’ where clubs from all over the country are invited to meet up and sort fixtures for the coming season. Usually, this means clubs from the South East, mostly, although many come from much further afield. This year we donated another £300 and are pleased to have done so – a big ‘thank you’ is due to all of the clubs who subscribe and to Keith Norman who organises the event with the RFU. We are also hugely grateful to the RFU for hosting the event and providing food and drink for the evening… without the support of folk like Alan Black, this event could not take place in such prestigious surroundings.

And so the exchange continues. The web site is at http://www.fixex.com and a lot is happening over there. A new version of the software was released this weekend, and more development is underway. I couldn’t do any of it without the wonderful MX Kollection Dreamweaver plugins developed by Interakt (who have been bought by Adobe).

We are renaming the donation to be the ‘Peter Conner Award’ and are looking for other good causes to support as well as S.P.I.R.E – the intention is to find and help those who against all odds manage to find a way to achieve within rugby union. We will no doubt announce more about this as the year progresses.

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in