/[drupal]/contributions/modules/demexp/demexp.module
ViewVC logotype

Diff of /contributions/modules/demexp/demexp.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.29, Sat Oct 14 12:02:13 2006 UTC revision 1.30, Sat Oct 14 12:57:20 2006 UTC
# Line 1  Line 1 
1  <?php  <?php
2  /*************************************  /*************************************
3   * Demexp module for a Drupal demexp client   * Demexp module for a Drupal demexp client
4   * $Id: demexp.module,v 1.28 2006/10/14 11:15:55 augustin Exp $   * $Id: demexp.module,v 1.29 2006/10/14 12:02:13 augustin Exp $
5   * Copyright Augustin Masquilier, 2006.   * Copyright Augustin Masquilier, 2006.
6   * This module is released under the terms of the GPL.   * This module is released under the terms of the GPL.
7   *************************************/   *************************************/
# Line 945  function _demexp_update_question_node($d Line 945  function _demexp_update_question_node($d
945        $values['title'] = t('Question !id', array('!id' => $question['q_id']));        $values['title'] = t('Question !id', array('!id' => $question['q_id']));
946        $values['body'] = theme('demexp_question_body', $question);        $values['body'] = theme('demexp_question_body', $question);
947        $values['name'] = 'demexp';        $values['name'] = 'demexp';
948          $values['path'] = 'question/'. $question['q_id'];
949        $values['format'] = 3;        $values['format'] = 3;
950        // drupal_execute will return 'node/$nid'        // drupal_execute will return 'node/$nid'
951        $nid = substr(drupal_execute('demexp_question_node_form', $values, $node), 5);        $nid = substr(drupal_execute('demexp_question_node_form', $values, $node), 5);
# Line 972  function _demexp_update_question_node($d Line 973  function _demexp_update_question_node($d
973        $forum_tid = db_result(db_query('SELECT tid FROM {term_data} WHERE vid = 1 AND name = "%s"', $values['name']));        $forum_tid = db_result(db_query('SELECT tid FROM {term_data} WHERE vid = 1 AND name = "%s"', $values['name']));
974        db_query('UPDATE {demexp_questions} SET forum_tid = %d WHERE ds_question_id = %d', $forum_tid, $question['q_id']);        db_query('UPDATE {demexp_questions} SET forum_tid = %d WHERE ds_question_id = %d', $forum_tid, $question['q_id']);
975    
976          // Creating a path alias for the forum.
977          $path = 'forum/'. $forum_tid;
978          $alias = 'question/'.  $question['q_id'] .'/forum';
979          db_query("INSERT INTO {url_alias} (src, dst) VALUES ('%s', '%s')", $path, $alias);
980    
981      }      }
982      else {      else {
983        // update node        // update node

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.2