January 2016

Publication Date Update: module for Drupal 7 to add last update date to a node

Publication Date Update is a simple module for Drupal 7 that adds the "last update" date to a node, to be installed it needs the module Publication Date , because it works with the published_at variable. Publication Date Update is simply this function: function publication_date_update_preprocess_node(&$vars) { $time_unit = 86400; // number of seconds in 1 day => 24 hours * 60 minutes * 60 seconds $threshold = 10; // --- Create revision data // Check if node was revised if (($vars['status']) && $vars['changed'] && (round(($vars['changed'] - $vars['published_at']) / $time_unit) > $threshold)){ $vars['submitted'] = t('Published: !publishtime | Updated: !updatetime | Author: !username', array( '!publishtime' => format_date($vars['published_at'],'custom','d M Y...

Flush Cache Cron: module for Drupal 7 to flush the cache

Flush Cache Cron is a module for Drupal 7 to manually flush the cache and for set the cache flushing during the cron, this module only flushes the cache without rebuilding the system bootstrap. The module empties the tables: cache cache_block cache_filter cache_form cache_menu cache_page cache_path cache_views cache_views_data Here there is the code: <?php function flush_cache_cron() { try { $core = array('cache', 'cache_block', 'cache_filter', 'cache_form', 'cache_menu', 'cache_page', 'cache_path', 'cache_views', 'cache_views_data'); foreach($core as $table) { cache_clear_all('*', $table, TRUE); } } catch (Exception $e) { return $e; } return NULL; } function flush_cache_cron_cron() { // Interval defaults to 10800s = 3h. $interval = flush_cache_cron_interval(); // Set interval to 0 to...

Boost Expire for Drupal 7: a revision of the module

This is a revision of Boost Expire for Drupal 7 thanks to which the Boost's cache is flushed only when a node or a comments goes from unpublished to published or viceversa and when editing a node or a comment that is already published. Here there is the code: <?php /** * @file * * Expires Boost caches automatically when certain Drupal actions are taken. */ /** * Implements hook_menu(). */ function boost_expire_menu() { $items['admin/config/system/boost_expire'] = array( 'title' => 'Boost Expire', 'description' => 'Configuration for Boost Expire.', 'page callback' => 'drupal_get_form', 'page arguments' => array('boost_expire_admin_settings'), 'access arguments' => array('administer site configuration'), 'type' => MENU_NORMAL_ITEM, ); return $items; } /** * Implements...

Signal lost after selecting USA Band in menu *#*#4636#*#*: how to solve the problem

In some android phone we can access at the advanced menu *#*#4636#*#* in which we can change some baseband settings including the radio band. In some case after selecting the USA Band in this menu the signal goes down, we lose every network connection, and we can't do nothing to restore the network. In this case the only real solution is to re-flash the radio through fastboot, this is the command...