January 24th, 2008
Being not a great reader when I saw the advert for the new series Dexter I had no idea what is was all about, it was the blood red artwork that attracted me to the a. One I read the overview I knew I just had to give it a try. The premise is forensics technician for the Miami police by day and a serial killer by night, but he’s a nice guy so he onlykills bad people, killers, killer who get away with it. I love it, it has a very dark humour and it keeps you on the edge of your seet. Its so good I just had to read the book. The book does start of with a few minor difference to the TV series but nothing major. The book provides the main story arc for season on, but buy the end the two do start to diver slightly with different characters making it though to the end in each. If you like black homur or people getting what they deserve I’d recommend this.
Posted in Recommendation | No Comments »
January 23rd, 2008
Over the last year or so I’ve been getting used to programming in PHP, and I’ve long been at a stage when I can say my PHP skills are as good if not better than my skills in ASP.NET or ASP, an that I can accomplish more or less anything I need to in PHP.
However I would not say that I know PHP inside out, there are many function around the margins that you would not use day to day that might be very useful. There are times when I need to do things that send me trawling though the PHP site to find anything that will make the task possible or at least a little easier. But as with anything if you don’t use it regular you will soon forget what you can do and you have to research it again the next time.
Here I plan to document everything that I discover, no matter how little as a quick reference for me, and hopeful some sort of help to others.
I do a lot of work with WordPress which involves using its API. This can be a little frustrating sometimes, nothing more so that when you find the feature you need to it outputs directly to the screen, and there is no alternate function that allows you to execute the function into a variable. A couple of functions like this are next_posts_link and previous_posts_link that are used to display next and previous buttons on the site. For me they work fine individually and only display is needed, but I’d like to know if neither are shown so i can do something else. After trawling the API for an alternative and finding nothing, and not wanting to write a non API solution that may not be compatible with future release, I fell upon a kludgy but very workable solution.
PHP has a set of Output Control Functions that allow interception of any screen output into a buffer. There are many function in this section that maybe useful, but the ones i found useful are
- ob_start: which start the interception of all output.
- ob_get_contents: that lets you read all the buffered output up to this point into a variable.
- ob_end_clean: that finishes the buffering of the out put.
Here is an example of how I used these commands to solve the WordPress problem
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| ob_start();
next_posts_link('« Previous');
$previous = ob_get_contents();
ob_end_clean();
ob_start();
previous_posts_link('Next »');
$next = ob_get_contents();
ob_end_clean();
?> |
Posted in Coding | No Comments »
January 15th, 2008
I’ve just installed on my blogs two plugins which i have found, this are TinyMCEComments and TinyMCE Advanced and I am very please with them.
TinyMCEComments quite simply uses WordPress’ inbuilt TinyMCE editor to provide a nice richtext box for commenter. Is doesn’t add al the feature of TinyMCE but it it make the whole comment entry more visual by providing bold italic strike though and underline and of couse the anchor facility. Very handy but oddly the plugin is only at version 0.4.1 so i can’t wait to see version 1.
TinyMCE Advanced on the other had is only useful to the authors on the site and only if they use in in-built editor. It enable feature that are part of TinyMCE that for some reason have been disabled when it is used in WordPress. Such feature and search and replace, styles , custom characters and even smily faces
make it much nicer when entering a post.
Posted in Recommendation | No Comments »
January 10th, 2008
Now I’m near to completing the new theme I”ve started to run it through the HTML and CSS validation tools provided by W3C on there sight. And after and initial tweak everything is back on standard.
There where a few areas that caused problems.
First I had used a few colour names in the style sheet. These seem work on all the browers I have on my machine but they were non standard and so i ditched them. Here is a handy lookup of the named colours and the colour code.
Second was the fact I’ve used a nice little element to do round corners, This is non standard and only available on Mozilla based browsers , but I’ll keep it as an option that can be enabled, so I can have the best of both world, nice style and compatabilty.
Third and final was totally out of my control and really it won’t stop the themes passing the tests. Testing the theme on my sights I discovered that both Amazon afiliate ads and Google adsense both produce code that is no HTML compliant.
I’ve set my target for the theme so i don’t keep tweaking for ever, so I’m hoping to post the new theme soon.
Posted in css | No Comments »
January 9th, 2008
I’ve recently been resigning my theme for WordPress and its been a little slow going. I’m not a designer but i can work out what looks okay after a few attempt, but the problem is in the subtle differences in the way pages render across browsers. Now all browsers adhere to some version of the w3c standard, but it would appear that there are a few cracks in the standard that allow sightly different interpretations of how things should be done. The one that I have been having problems with is the liststyle.
Here is a useful article that explains the problem and having a little better understanding helped me solve my problem.
Posted in css | No Comments »