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
mysqldump -hhost -uusername -ppassword --no-data --add-drop-table databasename | grep ^DROP | mysql -uusername -ppassword -hhost databasename |
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
// Our field's machine name is field_short_description and it is a text field which originally had a max length of 250 characters. | |
// Now we desire to alter that length so that it will be 450 characters. | |
// If you use Features and you have this field exported as part of a content type, you must update the settings in there too. | |
// However, updating the settings just in a Feature will not do the trick for a field that has already data in it, hence the following code. | |
// You can put this code in a hook_update_N(). | |
// Alter 'field_data_field_short_description' table. | |
db_change_field( | |
'field_data_field_short_description', | |
'field_short_description_value', |
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
mlid int(10) unsigned NO PRI 0 | |
nid int(10) unsigned NO UNI 0 | |
bid int(10) unsigned NO MUL 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
cat yourprofile.info | grep "dependencies\[]" | cut -d "=" -f 2 | while read MODULE; do echo "${MODULE}: $(find /var/www/yoursite -iname ${MODULE}.module | wc -l)"; done | sort | grep ": 0" | cut -d ":" -f 1 |
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 correct($word, $dic) { | |
if (array_key_exists($word, $dic)) { | |
return $word; | |
} | |
$search_result = $dic[soundex($word)]; | |
foreach ($search_result as $key => &$res) { |
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 _example_cck_content_save_cck_node($op = 'install') { | |
module_load_include('inc', 'example_cck_content', 'example_cck_content.def'); | |
$content = _example_cck_content_cck_export(); | |
// we do not want too many modules enabled - the content_copy module is just needed | |
// in order to install the content type, so we just require it here (require_once prevent to | |
// include it more than once in case it is already enabled) | |
require_once './' . drupal_get_path('module', 'content') . '/modules/content_copy/content_copy.module'; |
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 | |
/** | |
* Implementation of hook_requirements() | |
*/ | |
function example_cck_content_requirements($phase) { | |
$requirements = array(); | |
$t = get_t(); | |
// an array of the dependencies |
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
; $Id$ | |
name = Example CCK Content | |
description = Provide an example CCK content type | |
dependencies[] = content | |
dependencies[] = filefield | |
dependencies[] = imagefield | |
dependencies[] = text | |
core = 6.x |
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 | |
/** | |
* Implementation of hook_install | |
*/ | |
function example_cck_content_install() { | |
_example_cck_content_save_cck_node(); | |
} | |
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 _example_cck_content_save_cck_node() { | |
module_load_include('inc', 'example_cck_content', 'example_cck_content.def'); | |
$content = _example_cck_content_cck_export(); | |
// we do not want too many modules enabled - the content_copy and | |
// alternate_content_copy modules are just needed in order to install the | |
// content type, so we just require them here (require_once prevent to | |
// include it more than once in case it is already enabled) |