View geocode_update.module
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 | |
// geocode_update.module | |
/** | |
* Implementation of hook_cron() | |
* | |
* Loads all the locations on the site which have invalid latitude/longitude, | |
* then uses the Google geocoder to update the latitude/longitude, if possible. | |
*/ | |
function geocode_update_cron() { |
View um_common_form-alter.php
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 um_common_form_alter(&$form, $form_state, $form_id) { | |
// hide split teaser on node forms | |
if (isset($form['#node']) && $form_id == $form['#node']->type .'_node_form') { | |
$form['body_field']['teaser_include'] = array( | |
'#type' => 'value', | |
'#value' => TRUE, | |
); | |
} | |
// user login block changes | |
elseif(($form_id == 'user_login_block')) { |
View taxonomy_token.module.php
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 | |
// $Id | |
define(MODULE_DESCRIPTION, 'Provides tokens that will contain text when a taxonomy term is present. For use with taxonomy module.'); | |
/** | |
* Implements hook_help() | |
* | |
*/ | |
function taxonomy_token_help($path, $arg) { |
View email_validate.php
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(). | |
* Does advanced email validation. | |
*/ | |
function revolven_user($op, &$edit, &$account, $category = NULL) { | |
if($op == "validate") { | |
if($error = adv_email_validate($edit['mail'])) { | |
form_set_error('mail', $error); | |
} | |
} |
View find_element()
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 find_element($form, $element_type) { | |
if (isset($form['#type']) && $form['#type'] == $element_type) { | |
return $form; | |
} | |
else { | |
foreach (element_children($form) as $name) { | |
if (is_array($form[$name])) { | |
$element = find_element($form[$name], $element_type); | |
if ($element !== FALSE) { |
View gmap_plugin_style_gmap-with_remote_callback.php
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 | |
// $Id: gmap_plugin_style_gmap.inc,v 1.7 2009/02/05 21:51:53 bdragon Exp $ | |
/** | |
* @file | |
* GMap style plugin. | |
*/ | |
/** | |
* Style plugin to render a map. |
View find_hook_implementations.php
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
<ol> | |
<?php | |
foreach(module_implements("block") as $module) { | |
print "<li>" . $module . "</li>"; | |
} | |
?> | |
</ol> |
View marker-popup_code.php
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 | |
// following is excerpted from um_common.module: | |
// service area vid | |
define("SERVICE_AREA_VID", 32); | |
/** | |
* Implements hook_menu() | |
* Creates Gmap rendering callbacks for popups. |
View url_outbound_alter_example.php
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_url_outbound_alter() - from URL Alter module | |
*/ | |
function YOURMODULE_url_outbound_alter(&$path, &$options, $original_path) { | |
// Rewrite paths for rices4peru.com | |
if ($_SERVER['HTTP_HOST'] == "www.rices4peru.com") { | |
$options['absolute'] = TRUE; |
View taxonomy_node_list_terms_by_vocabulary.php
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 | |
// convenience theming function for taxonomy lists -- ead 6.10.10 | |
function taxonomy_node_list_terms_by_vocabulary($nid, $voc_id, $link = FALSE, $ul = FALSE) { | |
/* loads a "dummy" node in order to use taxonomy_node_get_terms_by_vocabulary() | |
to get an array of taxonomy terms */ | |
$node = new stdClass(); | |
$node->vid = db_result(db_query("SELECT MAX(vid) FROM {node_revisions} WHERE nid = %d", $nid)); | |
$terms = taxonomy_node_get_terms_by_vocabulary($node, $voc_id); | |
if(!isset($terms) || !is_array($terms) || empty($terms)) { return ''; } | |
OlderNewer