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 | |
$count = 50000; | |
if(module_exists("devel")) | |
dpm("The count before increment:" . $count); | |
if ($node = menu_get_object('node')) { | |
if ($node->type == 'webform') { | |
$count = db_result(db_query('SELECT count(*) FROM {webform_submissions} WHERE nid = %d', $node->nid)); |
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
<p><wysiwyg_field wf_field="field_page_image" wf_deltas="1" wf_formatter="uom_image_floater" contenteditable="false" wf_settings-image_style="thumbnail" wf_settings-image_link="" wf_settings-image_float="right"><img class="image-float-right" title="Babel" src="http://languages.dev/sites/default/files/styles/thumbnail/public/about-us_1.jpg" alt="Babel" width="100" height="73" align="right" />Globally engage an expanded array of bandwidth for interdependent results. Phosfluorescently deliver maintainable channels through value-added data. Professionally drive synergistic infrastructures without high-quality quality vectors... |
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
<div id="blurb" style="clear: both; margin: 0px 100px 0px 100px;"> | |
<div id="portuguese" class="text" style=" | |
float: left; | |
width: 30%; | |
margin-right: 5%; | |
padding-bottom: 5%; | |
"> | |
<p>Drupal é uma plataforma open source de gerenciamento de conteúdo alimentar milhões de sites e aplicações. Ele é construído, usado, e apoiado por uma comunidade ativa e diversificada de pessoas ao redor do mundo. | |
</p> |
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
wibble_node_presave($node) { | |
if (node->type == 'whatever') { | |
static $edit_flag; | |
if (reference_has_changed && empty($edit_flag)) { | |
$edit_flag = TRUE; | |
$reference = node_load($node->reference_field[0]['nid']); | |
$reference->reference_field[0]['nid'] = node->nid; | |
node_save($reference); | |
} | |
} |
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 | |
/** | |
* Implements hook_preprocess_views_view_grid(). | |
* | |
* Our own implementation removes the complete.css grid class names from | |
* the views grid and uses different ones instead. | |
* | |
* Specifically: col-N => view-col-N | |
*/ | |
function phptemplate_preprocess_views_view_grid(&$vars) { |
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
// Better yet, sue the language as defined in the entity. $entity->language? | |
foreach ($GLOBALS['user']->field_product_brand[LANGUAGE_NONE] as $term) { | |
if ($entity->field_product_brand[LANGUAGE_NONE][0]['tid'] == $term['tid']) | |
return $term['tid']; | |
} | |
} | |
return NULL; |
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
-- Query 1: Use sensiblised day and time, also check if rollover is required. | |
SET @TIME=DATE_FORMAT(CONVERT_TZ(NOW(), 'UTC', 'Australia/Melbourne'), '%T'), @DOW=DAYOFWEEK(CONVERT_TZ(NOW(), 'UTC', 'Australia/Melbourne')), @FIRST=(SELECT programstarttime FROM wp_programgrid_programs WHERE dayofweek=DAYNAME(CONVERT_TZ(NOW(), 'UTC', 'Australia/Melbourne')) AND IsFirstProgramForDay=1), @LAST=(SELECT programstarttime FROM wp_programgrid_programs WHERE dayofweek=DAYNAME(CONVERT_TZ(NOW(), 'UTC', 'Australia/Melbourne')) ORDER BY programstarttime DESC LIMIT 1); | |
-- Query 2: Query the shit out of the data using our vars. | |
(select *, case dayofweek | |
when 'Sunday' then 1 | |
when 'Monday' then 2 | |
when 'Tuesday' then 3 | |
when 'Wednesday' then 4 | |
when 'Thursday' then 5 |
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
#!/usr/bin/php | |
<?php | |
// define('FORMAT', 'jS F Y'); | |
// define('FORMAT', 'YYYY/mm/dd MMM M m mmm ddd j S EEEE'); | |
define('FORMAT', 'dd'); | |
define('LOCALE', 'nl_NL.UTF-8'); | |
$alpha = array('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z'); | |
/** |
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 | |
$text = "Whatever stuff with URLs in it."; | |
$protocols = array('http', 'https', 'ftp'); | |
$protocols = implode(':(?://)?|', $protocols) . ':(?://)?'; | |
// Prepare domain name pattern. | |
// The ICANN seems to be on track towards accepting more diverse top level | |
// domains, so this pattern has been "future-proofed" to allow for TLDs | |
// of length 2-64. |
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 | |
// Add yer string! | |
$data = ''; | |
define('PATTERN', '/s:(\d+):"(.*?)";([Obis]):((\d+):)?([^;]+);/'); | |
// Care not for arrays. | |
$blob = preg_replace('/a:\d+:{/', "\n", $data); | |
// Can't cope with objects. |
OlderNewer