By DenRaf , 3 July, 2008

Not only is there a need to get modules ported to Drupal 6, but also themes. Because someone wanted to use the plutado theme on a Drupal 6 environment, I ported this theme. Attached you'll find the patch.

On this link you can find more info when you decide to join the porting-force.

By DenRaf , 19 June, 2008

On my previous post (link) about this, the port was just in a state of "It works for me". But as commented on the post and I heard from others it wasn't working.

But for a new project it was required to work again :)

So after some little changes everything was working. As prove my colleague Dieter ported his blog from wordpress 2.5. Thanks to Dieter for the help.

The module can use a cleanup, but it works.

By DenRaf , 18 June, 2008

For a project I needed user_import for drupal 6, so I made the port myself.

As you can see it's not only a port, but there are also some new features.

- Cron function is expanded to auto-import
- Added fields (language, delete, role)
possible to set Delete field yes / no
- Fixed update profile_values

The patch is against 5.x.2.x-dev.

By DenRaf , 14 June, 2008

Today I was pleasantly surprised when I saw that cats will support open source again. (link)

By doing this they are coming back from a earlier decision of being open source.

By DenRaf , 11 June, 2008

For a project I needed the faceted_search module and that project was screaming for being made in Drupal 6. Since there isn't a drupal 6 version of this module, I decided to just port it myself.

The patch isn't complete yet. I just ported the things we needed directly. When I have some spare time, I will continue the port.

Faceted Search Views and Field Keyword Filter are untested, but the views will not work for sure, since it's not updated yet for views 2.

By DenRaf , 3 June, 2008

For a little project I needed to list all users, but not with the default user information, but with extra profile_values. Since users were not known by username, but by user id, I wanted a filter for a quick search.

In my module I recreated the form:

function messageboard_form_alter($form_id, &$form) {
if ($form_id == 'user_filter_form') {
unset($form['filters']['status']['status']); // remove status filter
unset($form['filters']['status']['permission']); // remove permission filter

$form['filters']['filter'] = array (
'#type' => 'radios',
'#options' => array (
'role' => role, // keep role filter
'uid' => uid // add my uid filter
)
);
$form['filters']['status']['uid'] = array (
'#type' => 'textfield',
'#size' => 18,
);
}
)

At first I also had the code added to fill the user_overview_filter session array with the values of the added filter, but then I got a SQL error.

At the end I saw no other way then editing the user_filters() function in the user.module like this:
$sql = db_query("SELECT uid FROM {users}");
while($row = db_fetch_array($sql)) {
$options[$row['uid']] = $row['uid'];
}
$filters['uid'] = array('title' => t('number'),
'where' => 'u.uid = %d',
'options' => $options,
);

The options are necessary if you want the text of the search displayed correctly.

I would be nice if there was some kind of hook for editing these filters. If so, please let me know. I really don't like to edit core modules.

By DenRaf , 31 May, 2008

How to make a flat jscalendar in drupal.

Download and install the jstools module and activate the jscalendar module.

Then in /path/to/jstools/jscalendar/jscalendar.js change the calendar setup into:

Calendar.setup({
flat : "calendar-container", // ID of the parent element
flatCallback : dateChanged // our callback function
});

And at the flatCallback function:
function dateChanged(calendar) {
// Beware that this function is called even if the end-user only
// changed the month/year. In order to determine if a date was
// clicked you can use the dateClicked property of the calendar:
if (calendar.dateClicked) {
// OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
var y = calendar.date.getFullYear();
var m = calendar.date.getMonth() + 1; // integer, 1..12
var d = calendar.date.getDate(); // integer, 1..31
// redirect...
window.location = "/" + y + "/" + m + "/" + d + "index.php";
}
};

Then in your form:

$form['date'] = array(
'#type' => 'textfield',
'#attributes' => array('class' => 'jscalendar'),
'#jscalendar_showsTime' => 'false',
'#suffix' => ' div id="calendar-container" style="width: 100px;"> / div >',
);

Then I added display:none to nearly all entries in jscalendar.css so that the textbox and the image don't appear anymore.

It is not the cleanest way of doing things, but it works and you still can select the wished theme in your jscalendar settings.

By DenRaf , 27 May, 2008

For a subscribing form I need a dynamic selectbox, which was reloaded when a first selectbox was changed.

I tried activeselect, which worked in my testing environment, but not on the actual site which had a hook_regions (bug: http://drupal.org/node/125451).

Hierarchical select was just not the way to go in case of this site. It required the use of vocabularies, while I was working with database content directly. And so many other solutions I tried, but without the wished result. After some searching I found this: http://f5sitedesign.com/drupalcamp.
After modifying the module, I finally had it working.

Attached you can find a simple module. As you can see in the code it requires the location module and some content in the db. I'll see if I can provide some data for in the location db.

It provides a lillte module for subscriptions. In this case it's for selecting a province which will load the second selectbox with offices in that province. It's not the best example. because for this you can use HS, but atleast you get an idea.

The module provided at the drupalcamp site shows an example with replacing text in a div and the principal for this is just the same. So you can replace anything you want as long as you have an id to hook in to.

By DenRaf , 5 May, 2008

When going to drupal 6 I needed also to upgrade our theme.
I had everything quiet fast, just the menu-tree was a big pain.

The code for the drupal 5 theme was:
print theme('menu_tree',variable_get('menu_primary_menu',0));

And now for drupal 6 it is:
print menu_tree($menu_name = 'primary-links');

By DenRaf , 27 April, 2008

For our company there was a need to do some expansion and we decided to do that with the Dell R200.

Since it was just the new version of the PowerEdge 860 ( an other server we have ) I thought it would be fairly easy to install this machine, since I had the kickstart and all other docs and scripts of the 860 installation. But that turned out otherwise.
After trying and failing several times, it was time for googling.
Went through several pages till I hit this one: http://www.jameslittle.me.uk/installing-centos-5-on-a-dell-r200/

It saved my day.