Created
December 11, 2009 09:10
Revisions
-
investic renamed this gist
Dec 11, 2009 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
investic renamed this gist
Dec 11, 2009 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,7 @@ <? /** * Implementation of hook_nodeapi(). * Drupal Crear dos nodos con un campo en comun */ function sorteo_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { switch ($op) { -
investic revised this gist
Dec 11, 2009 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ <? /** * Implementation of hook_nodeapi(). */ @@ -18,4 +19,5 @@ function sorteo_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { break; } } ?> -
investic created this gist
Dec 11, 2009 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ /** * Implementation of hook_nodeapi(). */ function sorteo_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) { switch ($op) { case 'insert': //crear dos nodos de quiz relacionados por su campo de nid if($node->type == 'quiz' && !$node->field_identificador[0]['value']){ $nid=$node->nid; $quiz = $node; $quiz->field_identificador[]['value']=$nid; unset($quiz->nid); $quiz->language='eu'; db_query("UPDATE {content_type_quiz} SET field_identificador_value = '%s' WHERE nid = %d",$nid,$nid ); node_save($quiz); drupal_goto('admin/sorteos'); } break; } }