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
Omega 4 Subtheme creation with SAss compile. (Must have ruby / compass / sass installed already) | |
create sub theme using Drush | |
drush help —filter=omega | |
this will show you command owiz (Omega-wizard.) | |
execute: drush owiz | |
And follow the steps. this will create a sub theme. | |
Now, to make 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
<?php | |
function foo_update_path() { | |
$nid = 1; | |
$node = node_load($nid); | |
foo_custom_module($node); | |
exit; | |
} | |
function foo_custom_module($node) { |
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
/** | |
* Implements hook_query_alter(). | |
*/ | |
function evosys_redirect_query_alter($query) { | |
if ($query->hasTag('debug')) { | |
$sql = (string)$query; | |
$connection = Database::getConnection(); | |
foreach ((array) $query->arguments() as $key => $val) { | |
$quoted[$key] = $connection->quote($val); | |
} |
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
/** | |
* Implements hook_user_operations(). | |
*/ | |
function custom_users_user_operations() { | |
$operations['custom_users_salesforce'] = array( | |
'label' => t('Create Salesforce Account'), | |
'callback' => 'custom_users_operations_create_salesforce_callback', | |
); | |
return $operations; | |
} |
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
(function ($) { | |
Drupal.fooModule = Drupal.enrich || {}; | |
Drupal.fooModule.copyToTextarea = function($field, $value, settings) { | |
for (var editor in settings.wysiwyg.configs) break; | |
$("textarea[name^='"+ $field +"']").val($.trim($value)); | |
var editorid = $("textarea[name^='"+ $field +"'].text-full").attr('id'); | |
if (typeof editorid != 'undefined' && editorid.length > 0) { | |
if (editor == 'tinymce') { | |
tinyMCE.execInstanceCommand(editorid, 'mceSetContent', false, $.trim(html)); |
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 | |
// Line - 1811 - under "panels_get_pane_links_alter" | |
// remove the prefix block- to get the name. | |
$name_of_block = ltrim( $prefixed_name, $subtype_prefix_hyphen); | |
// correct Method | |
if (substr($prefixed_name, 0, strlen($subtype_prefix_hyphen)) == $subtype_prefix_hyphen) { | |
$name_of_block = substr($prefixed_name, strlen($subtype_prefix_hyphen)); | |
} |
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_entity_info_alter(). | |
*/ | |
function foo_entity_info_alter(&$entity_info) { | |
$entity_info['node']['view modes']['another_teaser'] = array( | |
'label' => t('Another teaser'), | |
'custom settings' => 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
<?php | |
/** | |
* Implements hook_rules_condition_info() | |
*/ | |
function foo_rules_condition_info() { | |
return array( | |
'foo_check' => array( | |
'label' => t('Check foo condition'), | |
'parameter' => array( |
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
$fb_url = "https://www.facebook.com/sharer.php? | |
&p[url]=http://bit.ly/myelection | |
&p[images][0]=http://election.gv.my/assets/vote.png | |
&p[title]=My customized title | |
&p[summary]=My customized summary"; |
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 | |
function getInfo_of_ip($ip){ | |
$url = "http://api.geoio.com/q.php?key=fC3tzSLwbhXWXnTS&qt=geoip&d=comma&q=".$ip; | |
$timeout = 5; | |
$ch = curl_init(); | |
curl_setopt($ch,CURLOPT_URL,$url); | |
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); | |
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout); | |
$d = curl_exec($ch); |
OlderNewer