Archive for February, 2007

Accessing Files in a WordPress Theme Directory

When developing or modifying themes in WordPress, you may want to reference a file in the theme, such as a graphic, or an additional style sheet.

The php function bloginfo(’template_directory’) outputs the path to the template to the template. In other words, this function has an echo statement built right into it. You can not assign a variable to the path using this method.

Continue reading

Improved WordPress Template

When I first set up this blog, I used a template adapted from my travel information website. That template isn’t perfect, actually it has some major problems that need to be adjusted, but hey, you’ve got to start somewhere! There are things I like about that template too.

Sooner or later though, the template for this site had to change, and that time turned out to be yesterday.

Continue reading

How to Remove Login Information From Drupal Site

Several times lately, I have been asked this question, by way of visitors arriving by search results for “How to Remove Login Information From Drupal Site”.

Normally, I write about problems I have experienced and solved. I assume others may benefit if I share my solutions.

In this case, I don’t know exactly what the question means. Could you clarify please? Just leave a comment explaining the problem. Is it related to the Drupal installation and database, or the browser?

The Google AdSense preview tool

Google has a tool for previewing ads that might appear on a particular web page. This sounds like a good idea, but it does not go nearly far enough.

Firstly, it shows what might appear on a specific webpage, not what does appear if you actually have Google AdSense ads appearing on that page. Unless you don’t mind skewing your statistics by visiting your own website, this isn’t a great way of going about it. What I really want to know is what ads are appearing on my website, without visiting the website. And without being tempted to click on your real ads - definitely don’t do that!

I would like a list of ads and their URLs that have been served up on my website by past visitors, so I can determine if the ads are appropriate. I should be able to click on the link (without gaining income or charging the advertiser) and see what their website is about.

There is something else missing from Google’s ad previewing tool: it is limited to working only for Internet Explorer! This is very strange, as Google actively sponsors and promotes FireFox, and Microsoft is one of (if not the only) enemy of Google!

Even Good Intentions Can Lead to Being Banned from Google AdSense

I came across an article (thanks to Web Tools Collection) about how a well-intentioned effort to remove trash ads from a website lead to the website owner being banned from Google AdSense.

Andreas Viklund, explains how he clicked on his own ads to discover which ones were legitimate. He first logged into his Google AdSense account* so that the clicks would link to him, and not be counted.

*NOTE: I was going to link “Google AdSense account” to a Google referral link, but there is no way to do this without using Google’s script, which is not what I want here. Sometimes they go overboard on the scrips. Sometimes I wish they would use plain links as Amazon and PayPal allow you to do.

Google suspended Andrea’s account for clicking on his own ads, much to his frustration. He was able to resolve the Google issue, and learned not to click his own ads in the process.

While I understand Google’s desire to avoid click fraud, there are a couple of other legitimate issues to consider here. As Andreas explains in his post, some of the ads on his site were really interesting, and he even signed up for some of the offers. This stands to reason.

If you are interested enough in a subject to write about it, chances are you are one of the best prospects for the ads that appear on your own site.

When I registered some new domain names recently, I was curious to see what ads the aggregator operated by my domain registrar, before I configured the domains for my own website. Sure enough, some of the links pointed to very interesting websites, which I book marked for future reference.

It seems to me that there is a gaping hole in the Google Adsense system. I should have a list of ads and their URLs served up on my website, so I can determine if they are appropriate. I should be able to click on the link (without gaining income or charging the advertiser) and see what their website is about.

Google does have a preview tool , but it is very limited in what it can do.

I will be looking at some of Google’s competitors, just to see if they can offer a more interesting deal. For example,, and Note that I am not hyperlinking these references, because I don’t have personal experience with them (yet).


Extending The Use Of BlogDesk

blogdesk-logoIn a separate post, I have complained about the shortcomings of the editors available for WordPress, Drupal and other content management systems.

The solution I have been using lately is BlogDesk. I have been using it for months to post on my blogs (I’m using it now). Lately I have extended its use for other projects such as my new allergy information website. That one uses Drupal, and has many types of content (blog, page, story, book …). Some of these need more configuration than BlogDesk can manage, so uploading from my desk top does not work for everything.

What does work well is to use BlogDesk to type text, embed images, format, add links etc. The built-in spell checker is pretty good to. Use only the Post section, not the More section. Add page breaks manually.

You can then view the HTML, where you can make further changes if necessary, such as adding floating DIV blocks etc.

When you are done editing, switch the view to HTML, then copy the entire post.

Disable the editor in the editor in your content management system. Paste the HTML into the body of your post body.

WARNING: Do not attempt to edit your post with a built-in editor at a later time if you use the above method to add additional HTML tags. The editor may remove or alter your carefully constructed HTML code. FCKeditor (for Drupal) seems to alter the HTML less than most.

Is Any Web-Based Built-In Editor Good?

I just disabled the built-in editor for WordPress. After trying several editors for Drupal, I’ve given up on them all. For now, I’ll stick to HTML, thanks.

I love the idea of WYSIWYG (what you see is what you get) editors, but I don’t like what any of these editors do to my posts.

I’ve had problems with TinyMCE, for example, I lost a lot of work when I tried to edit a link, and ended up jumping to the link instead.

Most on-line editors filter the HTML, which is just plain nasty if you are trying to embed elements in floating DIV statements for example (for an example, see this article on how to install TinyMCE in Drupal).

Although the idea of WYSIWYG is great, in practice the available options are wanting.

Typing HTML has problems as well. At first there is a lot to learn, but you get used to it. The problem is typos. Most of the links in my posts open a new window - it would be too easy to mistype “_blank” or leave out a quote somewhere.

The solution I have been using lately is BlogDesk. You can read more about extending the use of BlogDesk on a separate post.

Review of Editor for Drupal: WidgetEditor

Widgteditor is a simple replacement for a Drupal text area, with a WYSIWYG style editor.

It’s simplicity makes it interesting, and it is perfect for comments.

It has problems though, and for me it is a non-starter.

Firstly, there is no way (no easy way that I am aware of) for configuring where it appears. For example, I would like to be able to enable it for comments, but not for composing nodes (stories, pages etc.).

Secondly, I do not find it suitable for the article that I post. It is too simplistic. For example, when you want to insert a link, it provides for the link location only. There is no control over where the new URL will appear (same window, or new window for example).

As of this writing, it has a bug in Drupal 5, causing it to appear twice per text area.

If your needs are minimalist, and you don’t want to see any HTML, this editor may be the one for you. If you have slightly more demanding needs, consider TinyMCE or FCKeditor .

How Good is TinyMCE?

I am seriously frustrated with the TinyMCE editor, which I had installed on my allergy information site.

I came across a few short-comings, and I don’t think I can live with either of them.

Firstly, it messes up the HTML. I had painstakingly formatted some content, so that there was a list of items on one side, and a Google ad on the other. In order to prevent content above and below from wrapping around the arrangement, I needed to insert a couple of <DIV style=”clear: both;”></DIV> statements. TinyMCE stripped out both tags. I was kind of expecting that, so I did a preview before committing some other changes I had made. I didn’t save the changes due to the loss of the tags.

Much worse happened some time later. After spending quite a while on typing up some content, I clicked on a link in the content to edit the link. Instead of selecting the link, TinyMCE sent me to the link. When I pressed the back button, my changes were lost! That’s when I removed TinyMCE from my system. It won’t be coming back. I’d rather type out raw HTML then have that happen again!

A third shortcoming is that I can’t have a full-featured version of the editor for stories, and a stripped-down version for comments. This is likely the fault of how it is implemented in Drupal, than the editor itself. What I want though, is a way for visitors to do a little formatting of comments, and for me to do a lot of formatting of articles.

I will be investigating other editors when I have time. I will post again when I have had a chance to check out a few.

What editor do you use? If you want to share, do leave a comment!