/[drupal]/contributions/modules/wghtml/wghtml/implement_node_drupal46.php
ViewVC logotype

Diff of /contributions/modules/wghtml/wghtml/implement_node_drupal46.php

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

revision 1.1, Sun Oct 9 15:59:51 2005 UTC revision 1.1.4.1, Sun Feb 25 02:46:59 2007 UTC
# Line 1  Line 1 
1  <?php // $Id: Exp $  <?php // $Id: implement_node_drupal46.php,v 1.1 2005/10/09 15:59:51 djnz Exp $
2  /*  /*
3   * Implementation of wgHTML as a node for Drupal   * Implementation of wgHTML as a node for Drupal
4   * Tested with Drupal 4.6.3   * Tested with Drupal 4.6.3
# Line 74  class wghtml_implementation extends wght Line 74  class wghtml_implementation extends wght
74    
75        // create a new node        // create a new node
76        $node = $this->make_node();        $node = $this->make_node();
77        $this->pageId = node_save($node);        node_save($node);
78          $this->pageId = $node->nid;
79    
80        // TODO why doesn't this work? db_query('LOCK TABLES {wghtml_versions} WRITE');        // TODO why doesn't this work? db_query('LOCK TABLES {wghtml_versions} WRITE');
81        // TODO should check here that it has still not been created and return if it has        // TODO should check here that it has still not been created and return if it has
# Line 83  class wghtml_implementation extends wght Line 84  class wghtml_implementation extends wght
84        db_query('INSERT INTO {wghtml_pages} (        db_query('INSERT INTO {wghtml_pages} (
85          pageId, identity )          pageId, identity )
86          VALUES (%d, \'%s\')',          VALUES (%d, \'%s\')',
87          $this->pageId, $this->identity, 1);          $this->pageId, $this->identity);
88    
89      } else {      } else {
90    
# Line 100  class wghtml_implementation extends wght Line 101  class wghtml_implementation extends wght
101    
102      // save version      // save version
103      db_query("INSERT INTO {wghtml_versions} (      db_query("INSERT INTO {wghtml_versions} (
104        pageId, version, node, perm_area, raw, title, head, body, bodyattrib, linkto, signature, cachetime)        pageId, version, perm_area, raw, title, head, body, bodyattrib, linkto, signature, cachetime)
105        VALUES ('%s', %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d)",        VALUES (%d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d)",
106        $this->pageId, $this->version, 0, $this->perm_area, $this->raw, $this->title, $this->head, $this->body, $this->bodyattrib, $this->linkto, $this->signature, time());        $this->pageId, $this->version, $this->perm_area, $this->raw, $this->title, $this->head, $this->body, $this->bodyattrib, $this->linkto, $this->signature, time());
107      db_query('UNLOCK TABLES');      db_query('UNLOCK TABLES');
108    
109      // We do NOT need to update the search index as cron will do this automagically      // We do NOT need to update the search index as cron will do this automagically
# Line 129  class wghtml_implementation extends wght Line 130  class wghtml_implementation extends wght
130      $node->type = 'wghtml';      $node->type = 'wghtml';
131      $node->title = $this->title;      $node->title = $this->title;
132      // $node->teaser = TODO      // $node->teaser = TODO
133      $node->body = strip_tags($this->body);      $node->body = $this->body;
134      $node->created = $this->signature;      $node->created = $this->signature;
135      $node->changed = $this->signature;      $node->changed = $this->signature;
136      $node->revisions = '';      $node->revisions = '';
137      $node->comment = 2;      $node->comment = 2;
138      $node->format = 1;      $node->format = $this->config[$this->config['implementation']]['format'];
139      //  'teaser', 'revisions', 'status', 'promote', 'moderate', 'sticky', 'format');      //  'teaser', 'revisions', 'status', 'promote', 'moderate', 'sticky', 'format');
140      return $node;      return $node;
141    }    }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.4.1

  ViewVC Help
Powered by ViewVC 1.1.2