drupal

Fivestar voting.. Do you even need it? Or is it just a cool idea

I came across this article about youtube ditching its fivestar rating basically because users treat it as a binary thing, either they love it (5 stars) or hate it (0 stars) or simply dont bother voting, there are some edge cases where users DO bother voting however.

more here... http://youtube-global.blogspot.com/2009/09/five-stars-dominate-ratings.h...

beat.com.au now running Drupal

http://beat.com.au/ now running drupal http://drupal.org , a great choice for this kind of website! not huge amounts of data, but definate content structure, gig guides etc, nice theming too! seems to be based on the zen theme

Drupal buddylist2 to friendlist importer

A quick and dirty way to import buddylist (from d5) to friendlist (d6)
/**
 * Brute force import buddylist into friendlist
 * the friendlist import sucks pretty bad and emails everyone when they import
 */
function buddylist_import_to_friendlist() {
  $ret=array();
  $result = db_query("SELECT * FROM {buddylist} where received=1;");
  while($row = db_fetch_array($result)) {
    // friendlist can be two way so we need to insert twice with opposing uids so they handshake
    db    
  

Drupal friendlist module, every relationship is 4 DB rows

ouch!

mysql> select * from friendlist_statuses;
+-----+--------------+--------------+------+---------+------------+------+------------------+
| sid | requester_id | requestee_id | rtid | status  | rid_origin | rid  | last_update_time |
+-----+--------------+--------------+------+---------+------------+------+------------------+
|   7 |            1 |         5484 |    1 | TW_BOTH |        232 |  232 |       1259898195 |
|   8 |         5484 |            1 |    1 | TW_BOTH |        233 |  233 |       1259898195 |
+-----+--------------+--------------+------+---------+------------    
  

Backup your LAMP DB externally

Simple script you could drop into /etc/cron.daily/backup_db , handy for testing the exit level of mysqldump and rsync, and then rsyncing to your external server, keeps a rolling month's worth of backups.

error checked from mysqldump by testing for info in the STDERR output, and rsync tested by examining the return code ($?)


#!/bin/bash

# keeps a rolling 30 days of DB snapshots

mysqldump -uroot -pxxx mydrupal 2> /tmp/mysql-dump-fail.log |grep -v "INSERT INTO .cache"| bzip2 > /root/db_drupal-`date +%d`.sql.bz2
if [ -s /tmp/mysql-dump-fail.log ]
then

Added facebook connect widget to tshirtslayer

Added facebook connect widget to tshirtslayer, although it's not the actual integration just the javascript widget, more interesting to see if it has any impact on traffic. time will tell!

Saving Drupal CCK node, drupal_execute is a dog, use node_save instead

Interesting benchmark, saving 100 CCK nodes in a loop, nearly 5 seconds difference between drupal_execute method and going straight for node_save, i guess this indicates how much overhead is in the form handling (which is not a bad thing!)

heres the output!

time node object based insert: 0.00971524078067 each average, total 0.981767416
time node drupal_execute based insert: 0.0454754971042 each average, total 5    
  

BitCache distributed storage - distributed it is NOT!!

Thought i'de give the Drupal BitCache module a spin for a new project as it offers all the promises of Content Addressable Storage (CAS).

Yes, OK, so you can use the FileFramework that uses the BitCache module to present CCk fields, but there is still nothing distributed about the BitCache project.

There is no support for memcached for Drupal BitCache (And, more so, why would you want to store blobs in memcached? it does not handle object persistance so well)

Dynamic hook_menu results in Drupal, was 5, not in 6!

So you thought, I'll build a set of menu items depending on some database results (Say a menu link for every node of a certain type the user owns).

Dreamhost improve Drupal support a little...

Ok, so basically, they're saying they've added a few modules for the 'one click' install stuff.
From: 	DreamHost January Newslettery 
Subject: 	DreamHost Newsletter v11.1 January 2009
Date: 	Mon,  9 Feb 2009 20:46:06 -0800 (PST) (Tue, 15:46 EST)
*snip*snip*snip*snip*

########################################################################
5.    
  
Syndicate content