Skip to content

Instantly share code, notes, and snippets.

@tommy-thomas
tommy-thomas / gist:fb074ef09ac2f1b9d69e
Created August 6, 2015 15:46
Delete nodes by type in /devel/php
ignore_user_abort(true);
ini_set('max_execution_time', 600);
set_time_limit(0);
$node_type = 'story';
//fetch the nodes we want to delete
$result = db_query('SELECT n.nid FROM {node} n WHERE n.type = :node_type', array(':node_type' => $node_type));
foreach( $result as $row ){
node_delete($row->nid);
@tommy-thomas
tommy-thomas / example.module
Created August 4, 2015 20:11
Update D6 layout plugins for D7, create module .inc w/
<?php
/**
* Implementation of hook_ctools_plugin_api().
*
* Inform CTools about version information for various plugins implemented by
* Panels.
*
* @param string $owner
* The system name of the module owning the API about which information is
@tommy-thomas
tommy-thomas / Delete all nodes of a content type in Drupal 6
Last active August 29, 2015 14:14
Delete all nodes of a content type in Drupal 6
<?php
// See this thread for more info: http://drupal.org/node/92861
// Display our form
// Bumping up ex time to 5 minutes
ignore_user_abort(true);
ini_set('max_execution_time', 600);
set_time_limit(0);
print "<p>Note that it may take several minutes if you are deleting a lot of nodes.</p>";
//Useful hack for quick and dirty pseudo-module.
@tommy-thomas
tommy-thomas / RequestTrackerContent.inc.php
Created September 8, 2014 18:03
Minor edit for cnetid check.
<?php
/**
* Class RequestTrackerContent
*/
class RequestTrackerContent
{
private $queue_description;
private $queue_name;
@tommy-thomas
tommy-thomas / rcc_rt_handler.module
Last active August 29, 2015 14:06
RT handler with admin hooks.
<?php
require_once 'RequestTracker/CNetIDChecker.inc.php';
require_once 'RequestTracker/RequestTracker.inc.php';
require_once 'RequestTracker/RequestTrackerContent.inc.php';
/**
* Implements hook_form_alter()
* @param $form
* @param $form_state
* @param $form_id
<?php
/*
* https://gist.github.com/marktheunissen/2596787
*/
function oi_migrate_migrate_api() {
$api = array(
'api' => 2,
'groups' => array(