drupal
Drupal: how to clear the filter cache
A filter is a Drupal feature, usually implemented by some contributed modules, which substitutes parts of a node text with some other text.
Eg: if you use the Path filter module you can insert links like:
<a href="internal:node/25">hello!</a>
and the string internal:node/25 will be substituted by something like http://www.example.com/node/25 where www.example.com is your website url.
- fabio's blog
- Add new comment
- Read more
- 229 reads
Drupal 6: get parent nid of a book child page
I had to get the parent nid of a book child page for a website which already uses Drupal 6.
Seems that the book module logic has changed deeply between version 5. The new stack implementation of the parent-child relationships is pretty complex, at least for me. I have to say that I did not studied it a lot thought.
So.. this is the code to do that:
<?php
if(isset($node->book)) { // book page
$parent = book_link_load($node->book['plid']);
$pid = $parent['nid'];
}
?>
Hope this helps.
- fabio's blog
- Add new comment
- 221 reads
A firefox search plugin for Drupal 6 apis at api.drupal.org
Some time ago I created a api.drupal.org firefox search plugin for Drupal 5.x and submitted it to the Mycroft Project for indexing.
Well, I've been requested to do the same for Drupal 6 Apis.
So.. I did it. There is now a Drupal 6 Apis search plugin available at Mycroft.
You can get it from the list of search plugins I created.
- fabio's blog
- 3 comments
- Read more
- 396 reads
Disable related videos on a embedded Youtube player
Youtube recently added a new feature to the video player used to embed Youtube videos on other website.
The new default player, once the video completes playing, will display a list of related videos.
While this feature could be useful for some users it is probably not wanted on Youtube video aggregation websites.
Fortunately it's possible to disable related videos.
Let's see how.
- fabio's blog
- 15 comments
- Read more
- 8782 reads
Video module rewrite: update
The work on the new version of the video module continue.
I'm at a good point in the development and I think I will be ready to release the new version soon.
I attach here the current development version.
The code is still really unstable so.. do not use this on production. The update from previous versions still does not work.. so use this on a clean drupal install.
- fabio's blog
- Add new comment
- 576 reads
Go PHP 5! Go! Go! Go!
PHP is a very good programming language for creating web application. As an example Drupal is written using PHP.
Unfortunately, while already 3 years ago the PHP version 5 has been released, this version is still not yet supported by most of web hosts.
This is really bad because web developers have to stuck with PHP 4 witch is now 7 years old and obviously has few and ugly features compared to PHP 5.
- fabio's blog
- Add new comment
- Read more
- 791 reads
Understanding drupal hook_nodeapi execution order
To solve a really ugly bug of the video module I had to track down, in a very detailed way, what was the hook execution order in the Drupal 5.x hook_nodeapi. Unfortunately I didn't found any detailed documentation of this neither on the handbooks nor in the developer documentation (on CVS).
This is why, armed with a lot of patience, I wrote down what happens at every content submission/previewing/loading.
Those are my results:
node submit (validation successfull):
prepare form validate submit insert
- fabio's blog
- 3 comments
- Read more
- 2092 reads
Video module: major rewrite status
I'm currently working on a major rewrite of the video module. It was absolutely needed as the code was pretty ugly and buggy.
The rewrite tries to simplify the UI and the content submission process.
Attached you can find my latest version, is super development code but it's there only to let you have an idea of the path I'm following.
The only modules which I tested are: video, video_ffmpeg_helper, google video, weblink video, upload_video, url video, youtube video. Any other will not work.
The last version (at the time of this post) is attached below.
- fabio's blog
- Add new comment
- 710 reads
Flash Support for Drupal Advertisement module
I just completed the development of a flash plugin for the Advertisement module. The plugin is available here.
With this plugin you can add flash ads to you Drupal website and track different stats for it.
It is also able to override hardcoded urls in the swf files. Then is it possible to track clicks on those files. This feature uses some swf url convertion code from the Openads project.
- fabio's blog
- 5 comments
- Read more
- 2079 reads
Fighting spam comments with Drupal
During the past weeks this site has been targeted by some bots which posted spam comments.
As soon as the spam comments appeared I started deleting them using Drupal comments administration however, as a spam comment was received every 2-3 hours, this was not an affordable way to keep my website spam free.
- fabio's blog
- 7 comments
- Read more
- 3896 reads

Recent comments
1 day 2 hours ago
1 day 2 hours ago
1 day 13 hours ago
1 day 21 hours ago
3 days 12 hours ago
3 days 22 hours ago
4 days 13 hours ago
5 days 11 hours ago
5 days 23 hours ago
5 days 23 hours ago