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
javascript:alert(window.location.pathname.replace("/node/", '') + '-' + document.getElementsByTagName('h1')[0].innerHTML.replace(/'/g, '').replace(/[\s]/g, '-').toLowerCase()); |
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 | |
/** | |
* @file | |
* Sets up a field formatter, which can run custom theming or whatever else for a field. | |
* | |
* Once you have implemented the formatter, choose it on the 'display options' for a 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
<?php | |
// The raw path to the image. | |
$path = $node->field_product_image[0]['filepath']; | |
// Let imagecache generate a different sized image using 'Product_large' | |
$large_path = imagecache_create_url('Product_large', $path); | |
// Render the original image and save the path to the large one in the tag. | |
// Your output will be something like: | |
// <img src="blah.jpg" large_img="large-blah.jpg" class='img-swap' /> | |
theme('imagecache', $path, '', '', array('large_img' => $large_path, 'class' => 'img-swap')); |
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_node_view(). | |
*/ | |
function superpoll_node_view($node, $view_mode, $langcode) { | |
// Provide a link back to the parent poll on superpoll options. | |
if ($node->type == 'superpoll_option' && $view_mode == 'full') { | |
$node->content['linkback_to_poll'] = array( | |
'#theme' => 'superpoll_option_header', | |
'#title' => $node->title, |
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
13emerueuniversal.fr | |
13thstreet.de | |
13thstreet.pl | |
13thstreetuniversal.com.au | |
13thstreetuniversal.nl | |
calle13universal.es | |
divauniversal.asia | |
divauniversal.ro | |
divauniversal.ru | |
scifiuniversal.pl |
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
/** | |
* Imports translations from a .po file into the local database. | |
* | |
* @param string $filepath | |
* Full filepath to a .po translations file. | |
*/ | |
function maya_updates_api_import_translations($filepath, $langcode) { | |
_maya_updates_api_load_locale(); | |
drupal_load('module', 'file'); | |
watchdog(__FUNCTION__, 'Importing @file string translations.', array('@file' => $filepath), WATCHDOG_NOTICE); |
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_menu(). | |
*/ | |
function mymodule_menu() { | |
$items['user/%user/bb_licenses/%'] = array( | |
'title' => 'Saludar', | |
'page callback' => 'gestionar_licencia', | |
'page arguments' => array(1,3), | |
'type' => MENU_CALLBACK, |
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_preprocess_html(). | |
*/ | |
function nes_preprocess_html(&$variables) { | |
// Add some special classes to the HTML tag, so that we can style on a per-view basis. | |
// Get the current function handling the page. | |
$variables['menu_item'] = menu_get_item(); | |
// If it is a views.module provided page, add some classes to the html tag. |
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
try: | |
number=int(raw_input("Enter the number you'd like to check here:")) | |
except ValueError: | |
print "Sorry, that isn't a number." | |
""" | |
multiply the first, third, fifth and seventh digits by 3, and then add the | |
resultants and the original other digits together to get a new number the | |
checksum | |
""" |
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 | |
// Test private/public inheritance. | |
// run with `php -d display_errors test.php`. | |
class GotPrivate { | |
private $property = "Private Property: The dog goes woof.\n"; | |
private function whatsUp() { | |
echo "Private Function: The dog also goes bark.\n"; | |
} |