drupal

mysql to list cache and content tables for drupal

select table_name from information_schema.tables where table_schema='DB_NAME' and table_name like 'content%' or table_name like 'cache%';

temporarily redirecting all traffic except images to static page

Here's an .htaccess file that does the trick nicely, even providing a 302 temporary redirect:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !\.(gif|jpe?g|png)$
RewriteRule !^site_maintenance\.html$ /site_maintenance.html [L,R=302]
</IfModule>

drupal: deleting all content via drush

# in drush 3, "generate content" should be "generate-content", hence --allow-spaces-in-commands=true
# 0 0 means create no new nodes /comments
# --kill=true actually does the delete
drush --allow-spaces-in-commands=true generate content 0 0 --kill=true

red5node alpha release

Attached is the first alpha release of red5node, a little present for the holidays for any drupal webcam developer :)

Unlike the pre-alpha released earlier, this one should be as secure as the components it stands upon- Drupal, Flex, Services & AMFPHP. If you see how it isn't please let me know as I'd like to address it.

The major differences from the prior release are behind the scenes but very substantial- namely fixing gaping security holes. Please try this module out now.

no drupal taxonomy support for drag-and-drop admin of free tagging vocabularies

I have a free-tagging vocabulary but can only get table drag hierarchy ability on admin/content/taxonomy/ [[vocab-id]] when the checkbox for "tags" is checked in the settings fieldset of admin/content/taxonomy/edit/vocabulary/ [[vocab-id]]

I posted this question to drupal.org here but no responses.

red5node pre-alpha sources

UPDATE - NEWER RELEASE AVAILABLE - GO HERE

Well, I don't know about you, but I don't like it when Drupal modules are released with closed-source SWF files - especially when the SWF file comprises the core of the module.

Curl your Drupal modules

Why bother to download, unzip, and stick in your modules dir?

Just cd sites/all/modules and do this:

curl http://ftp.drupal.org/files/projects/tinytax-6.x-1.11.tar.gz|tar -xzf -

and replace "tinytax-6.x-1.11" with whatever the module is, obviously...

OR - if you're feeling really slick - use drush, then just run php-cli path/to/drush/drush.php pm install module_name

Drupal taxonomy snippet - get all terms for a vocabulary

I was unable to find this anywhere online, but it's a pretty basic one - get all terms for a vocabulary and create a list with their names...

<?php
/*
* Get all terms for a vocabulary
*
* @author Benjamin Lowenstein, Colingo Labs LLC
*/

// set vocabulary id #
$vid = 1;

$sql = "SELECT * FROM {term_data} WHERE vid = %d";
$result = db_query(db_rewrite_sql($sql), $vid);

$terms = array();

while (
$data = db_fetch_object($result)){
 
$term = $data->name;
 
$terms[] = $term;
}
echo
theme_item_list($terms);
?>

Syndicate content