node

node suggestions

  1. function _phptemplate_variables($hook, $vars) {    
  2.   if ($hook == 'node') {
  3.           // Here is the way to switch to a different node-<something> template based on node properties.

Node suggestions

  1.  if ($hook == 'node') {
  2.           $vars['template_files'] = array('node-'. $vars['node']->nid);
  3.                 return $vars;
  4.   }  

Change tag based on date

  1. UPDATE {term_node} SET tid = 30 WHERE tid = 29 AND nid IN (SELECT nid FROM {node} WHERE changed > 0 AND DATE_SUB(NOW(), INTERVAL 30 DAY) > changed)

not able to make custom node entry page

  1. function cckwizards_perm() {
  2.   return array('access wizdeadlines', 'access wizevents');
  3. }
  4.  
  5.  
  6. function cckwizards_menu($may_cache) {
  7.   $items = array();
  8.  
  9.   if ($may_cache) {

Fix for save to ftp

  1. /**
  2.  * Implementation of hook_nodeapi().
  3.  */
  4. function savetoftp_nodeapi(&$node, $op, $teaser, $page) {
  5.  switch ($op) {
  6.         case 'insert':
  7.         case 'update':
  8.         $html_title = $node->title;

Fix for module for saving a node to ftp

  1. /**
  2. * Implementation of hook_form_alter. Define the form for saving to ftp.
  3. */     
  4.  
  5. function savetoftp_form_alter($form_id, &$form) {
  6.  if ($form_id == 'regpage_node_form') { 

module for saving a node to ftp

  1. /**
  2. * Implementation of hook_form_alter. Define the form for saving to ftp.
  3. */     
  4.  
  5. function savetoftp_form_alter($form_id, &$form) {
  6.  if ($form_id == 'regpage_node_form') { 

Example of avoiding $content and themeing $node sectins directly

  1. <div class="node<?php print ($sticky) ? " sticky" : ""; ?> blog">
  2.   <?php if ($page == 0): ?>
  3.   <h1 class="title"><a href="<?php print $node_url ?>" title="<?php print $title

Add next link to node

  1. <?php
  2. function next_node_link($type, $object, $teaser = FALSE) {
  3.   $links = array();
  4.  
  5.   if ($type == 'node' && isset($object->nid)) {
  6.     if (!$teaser) {
Syndicate content