Nu ook in het Nederlands.
 

clemens's blog

Using ctools modal forms for node edit

For a drupal 6 site I needed a node edit overlay. This is what I did.

Define the urls ajax/node/%node/edit and nojs/node/%node/edit. The idea is to use path similar to the normal drupal paths just prepended with what ctools modal needs. It needs are minor in that the url path must contain a string nojs and in this case a class attribute ctools-use-modal.

<?php
function annotate_ym_menu() {
$items['nojs/node/%node/%'] = array(
'page callback' => 'annotate_ym_ajax_node',
'page arguments' => array(0, 2, 3),

I like Universal Subtitles website.

Logo of Universal Subtitles
I recently discovered the site http://universalsubtitles.org which is a gateway to online video material and allows us to subtitle online videos. In the past I tried to do something similar with http://mycaptions.org (offline) with an arcane editor using BUedit. With that system I managed to add subtitles to this video of which I like the animal.

Who is currently online

I want to run svn up on the site but I need to offline it first. So who is online?

SELECT name, mail, (unix_timestamp()-access)/3600 AS hours
  FROM users
  HAVING hours < 1
  ORDER BY access;

Or for short

drush sql-query "select name, mail, (unix_timestamp()-access)/3600 as hours from users having hours < 1 order by access;"

Temporary Securing Drupal through Basic Auth in settings.php

We needed to protect our production site from prying eyes for a while with a basic authentication. Using apache basic auth settings seemed not enough. Or actually was too much. We wanted the theme to blend in. So these files were not supposed to get protected. Only our Drupal pages should.

The solution came from http://php.net/manual/en/features.http-auth.php. Adding the following to sites/default/settings.php makes the customer happy and drush too.

Dumping all tables with drush

I want a clean database without clicking.

echo "\
SELECT concat('drop table ', table_name, ';') \
  FROM information_schema.tables \
  WHERE table_schema=schema()" \
| `drush sql-connect` \
| grep "^drop table " \
| `drush sql-connect`

This work only for single drupal / single schema installs.

Updating drupal core

I never tried to do an core update on the command line. Today I tried it.

Get the latest drupal version

drush dl

Check your download

ls
drupal-6.x

Checkout svn drupal-6-core

svn --username=build2be chechout http(s)://my-svn/drupal-6-core/trunk/

Step into drupal version to update

cd trunk/www

Apply the patch

Manage your sites with svn externals

After having worked with subversion for a while I finally got time to restructure my repository layouts. What I want is a simple way to update all the sites I maintain and I want those sites under version control.

Steps I took

  1. Make a drupal core repository
  2. Create your project repository
  3. Reference to the drupal core

Directory layout

In order to get a nice update-able project directory tree we choose a layout listed below.
www/
This contains only drupal core code will live.

Blog tools.

Searching on terms 'blog editor linux' I found these somewhat outdated links Five Desktop Blog Editors for GNU/Linux Users and Five More Desktop Blog Editors for GNU/Linux Users

Having a list is better then having zillions google links.

* GNOME Blog Entry Poster

* Drivel Journal Editor

* BloGTK Blog Editor

* ScribeFire Firefox Extension

Modules I have to check

Modules:

* dhtml_menu

* extlink

* pagination

Themes:

* waffles

Pages

Subscribe to RSS - clemens's blog