This file contains 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 | |
/** | |
* Implements hook_user_presave(). | |
*/ | |
function yourmodule_user_presave(&$edit, $account, $category) { | |
// 'n' should equal the role id. | |
if ($account->is_new && isset($edit['fboauth']) && $edit['fboauth']) { | |
$edit['roles'][n] = TRUE; | |
} | |
} |
This file contains 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
; REMOVE THESE DEFAULT STYLESHEETS | |
stylesheets[all][] = ctools.css | |
stylesheets[all][] = field.css | |
stylesheets[all][] = node.css | |
stylesheets[all][] = system.messages.css | |
stylesheets[all][] = system.menus.css | |
stylesheets[all][] = system.base.css | |
stylesheets[all][] = user.css | |
stylesheets[all][] = views.css |
This file contains 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
preferred_syntax = :sass | |
http_path = '/' | |
css_dir = "assets/css" | |
sass_dir = 'assets/sass' | |
images_dir = 'assets/images' |
This file contains 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
In a view | |
<?php print count(views_get_current_view()->result); ?> | |
Not in a view | |
<?php | |
$view = views_get_view('MY_VIEW_NAME'); | |
$view->set_display('MY_DISPLAY'); // like 'block_1' | |
$view->render(); | |
print sizeof($view->result); | |
?> |
This file contains 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 | |
$flag = flag_get_flag('votes') or die('no "votes" flag'); | |
print "The number of people who voted for this proposal:"; | |
print $flag->get_count($node->nid); | |
?> |
This file contains 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 | |
Hello, [node-author]. | |
Your post has been bookmarked [flag-bookmarks-count] times. | |
?> |
This file contains 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
$flag = flag_get_flag('votes') or die('no "votes" flag'); | |
// We assume an $account variable exists in this template. | |
print format_plural($flag->get_user_count($account->uid), | |
'This user has participated in 1 voting.', | |
'This user has participated in @count votings.'); |
This file contains 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
Deregister migrate classes which is not exist: | |
drush migrate-deregister —orphans | |
Other common commands: | |
migrate-audit (ma) View information on problems in a migration. |
This file contains 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
Drupal 6: | |
<?php | |
$block = module_invoke(‘MODULE_NAME’, ‘block’, ‘view’, MODULE_DELTA); | |
print $block[‘content’]; | |
?> |
This file contains 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
Two ways, | |
<?php | |
print ‘$base_path’; | |
print ‘$GLOBALS[base_url]’; | |
?> |
OlderNewer