This blog is a dumping-ground for research, thoughts and developments. dgtlmoon@gmail.com
skype: dgtlmoon
Sometimes you need to use a different drupal view when you're displaying different group types with Drupal's organic groups (OG) module, for example you might have a group thats mostly about files, and a group that's mostly about posting other items or something.
OG doesn't let you have different configurations for each node type (yet) so you can do this with a little hack, simply hit up the global $conf variable and replace it with what you need, and ensure this executes before OG does.
Zend IDE mysteriously stopped debugging, firefox toolbar just would not start the debugger and always said Zend was not detected no matter what i done, turns out, it was listening on ipv6 ports
"Zend Debugger requires Zend Engine API version 220060519."
From what i've gathered, looks like Zend dont fully support the latest php 5.3, so downgrade unfortunately is the answer!
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...
/**
* 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
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 | +-----+--------------+--------------+------+---------+------------
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
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
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)
global $base_root; $data = gzencode($output, 9, FORCE_GZIP); cache_set($base_root . request_uri(), 'cache_page', $data, CACHE_TEMPORARY, drupal_get_headers());