Drupal

Cache Expire: modulo Drupal 7 per cancellare la cache

Cache Expire è un modulo per Drupal 7 per eliminare automaticamente la cache quando un nodo o un commento viene pubblicato o aggiornato, questo modulo cancella la cache senza ricostruire il bootstrap di sistema. Il modulo cancella queste tabelle: cache cache_block cache_filter cache_form cache_menu cache_page cache_path cache_views cache_views_data e si integra con Cloudflare Cache Clear e con APC patchato per APCu . Qui il codice: <?php /** * @file * * Expires caches automatically when certain Drupal actions are taken. */ /** * Implements hook_menu(). */ function cache_expire_menu() { $items['admin/config/system/cache_expire'] = array( 'title' => 'Cache Expire', 'description' => 'Configuration for Cache Expire.', 'page callback' => 'drupal_get_form', 'page arguments' =>...

Publication Date Update: modulo per Drupal 7 per aggiungere la data dell'ultimo aggiornamento ad un nodo

Publication Date Update è un semplice modulo per Drupal 7 che aggiunge la data dell'ultimo aggiornamento ad un nodo, per essere installato esso necessita del modulo Publication Date , perché esso lavora con la variabile published_at. Publication Date Update è semplicemente questa funzione: 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($...

Flush Cache Cron: modulo per Drupal 7 per svuotare la cache

Flush Cache Cron è un modulo per Drupal 7 per svuotare manualmente la cache e per impostare lo svuotamento della cache durante il cron, questo modulo svuota solamente la cache senza ricostruire il bootstrap di sistema. Il modulo svuota le tavole: cache cache_block cache_filter cache_form cache_menu cache_page cache_path cache_views cache_views_data Qui il codice: <?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...

Boost Expire per Drupal 7: una revisione del modulo

Questa è una revisione di Boost Expire per Drupal 7 grazie alla quale la cache di Boost viene svuotata solo quando un nodo o un commento passa da non pubblicato a pubblicato o viceversa e quando si modifica un nodo o un commento che è già pubblicato. Qui il codice: <?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; } /** *...

Easy subscription per Drupal 7: una revisione del modulo

Questa è una piccola revisione di Easy subscription per Drupal 7 grazie alla quale le notifiche vengono inviate solo quando il nodo viene pubblicato e nella email uscenti sono ora presenti il titolo, una piccola anteprima ed il link al nuovo nodo. Qui il codice: <?php /** * @file * This is an easy subscription module */ /** * DB management. */ function easy_subscription_form($form, &$form_state) { $form = array(); // Add a title to help baffled users $form['description'] = array( '#type' => 'item', '#title' => t('Subscribe to receive updates'), ); $form['email'] = array( '#type' => 'textfield', '#title' => t('email'), '#size' => 20, '#required' => TRUE, '#validate' => array('filter_form_validate' => array('email_validation')), ); $form['unsuscribe'] = array...
Abbonamento a RSS - Drupal