Xaraya / Postnuke CVS Notices - Message

Note: this list is kept only as a demonstration for CVSNotice. For the latest CVS notices, see the Xaraya and Postnuke sites

View Statistics - Next Notice - Previous Notice

Directory filter : [ all ] / postnuke_modules / articles [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
27 Jul 2002 17:23:14postnuke_modules/articlespninit.php,1.14,1.15 pntables.php,1.5,1.6Mike
 rollback to proposed .80 feature set - nuncanada, please check mail from last week

Update of /home/cvsroot/postnuke_modules/articles
In directory ns7.hostnuke.net:/tmp/cvs-serv23669

Modified Files:
	pninit.php pntables.php 
Log Message:
rollback to proposed .80 feature set - nuncanada, please check mail from last week


Index: pninit.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/articles/pninit.php,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** pninit.php	19 Jul 2002 21:45:59 -0000	1.14
--- pninit.php	27 Jul 2002 17:23:12 -0000	1.15
***************
*** 29,63 ****
  function articles_init()
  {
!     $init_functions = Array (
!         'create_articlestable',
!         'create_notestable',
!         'create_workflowtable',
!         'create_textstable',
!         'create_texreltable',
!         'add_cats'
!     );
  
!     foreach ($init_functions as $function) {
!         $ok = {articles_init_$function} ();
!     }
  
!     // Set up module variables
!     pnModSetVar('articles', 'itemsperpage', 10);
!     pnModSetVar('articles', 'number_of_categories', 2);
!     pnModSetVar('articles', 'SupportShortURLs', 0);
!    // You cant pass an array to pnModSetVar... But you can serialize it
!    // Better right?
!     pnModSetVar('articles', 'presetcids', serialize())
! //	pnModSetVar('articles', 'newscid', );
! //	pnModSetVar('articles', 'sectioncid', );
! //	pnModSetVar('articles', 'reviewcid', );
! //	pnModSetVar('articles', 'faqcid', );
  
!     // Initialisation successful
!     return true;
! }
! // TODO: switch to pnDBCreateTable()
! // AdoDB should take care of that... When will they make it a real abstraction
! // library?
  
  // NOTE: the good thing is, those fields also happen to be mentioned in RFC 1,
--- 29,47 ----
  function articles_init()
  {
!     // Get database information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
  
! // TODO: switch to pnDBCreateTable()
  
! // TODO: add pn_status : e.g. 0 = submitted, 1 = approved, 2 = approved for
! //       homepage (=equivalent of old ihome field) to support Add-Story and
! //       Submit-News queue equivalents in .80
! //       Somewhere in the future, this would be managed by a workflow module.
  
! // TODO: add pn_notes to support equivalent of editor notes in .80
! 
! // TODO: (in interface, queries etc.) allow pn_pubdate to be set at some other
! //       date than the current one for equivalent of Add-Story autonews in .80
  
  // NOTE: the good thing is, those fields also happen to be mentioned in RFC 1,
***************
*** 67,84 ****
  //       for .80, if you ask me...
  
- // TODO: (in interface, queries etc.) allow pn_pubdate to be set at some other
- //       date than the current one for equivalent of Add-Story autonews in .80
- // DONE: pubdate is going to be set as the date after which the article will
- // be avaliable
- // So let�s set in the main page articles SELECT with conditions : wid = 0
- // And pubdate < 'Actual Unix Time'
- 
- // NOTICE: No main text in here! It�s gonna be handled in the text table
- function articles_init_create_articlestable ()
- {
-     // Get database information
-     list($dbconn) = pnDBGetConn();
-     $pntable = pnDBGetTables();
- 
      // Create tables
      $articlestable = $pntable['articles'];
--- 51,54 ----
***************
*** 88,160 ****
              $articlescolumn[title] TEXT NOT NULL DEFAULT '',
              $articlescolumn[summary] TEXT,
              $articlescolumn[authorid] INT(11) NOT NULL,
-             $articlescolumn[authdate] INT UNSIGNED NOT NULL,
              $articlescolumn[pubdate] INT UNSIGNED NOT NULL,
!             $articlescolumn[wid] TINYINT UNSIGNED NOT NULL,
!             PRIMARY KEY($articlescolumn[aid]))";
!     $dbconn->Execute($sql);
! 
!     // Check database result
!     if ($dbconn->ErrorNo() != 0) {
!         // Report failed initialisation attempt
!         pnSessionSetVar('errormsg', _CREATETABLEFAILED . $dbconn->ErrorMsg());
!         return false;
!     }
!     
!     return true;
! }
! 
! // TODO: add pn_notes to support equivalent of editor notes in .80
! // DONE: here
! // Fields names are almost identical to the article�s => take care on join
! // Or change the field names?
! function articles_init_create_notestable ()
! {
!     // Get database information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
! 
!     // Create tables
!     $articlesnotestable = $pntable['articles_notes'];
!     $artnotescolumn = &$pntable['articles_notes_column'];
!     $sql = "CREATE TABLE $articlesnotestable (
!             $artnotescolumn[nid] INT(10) NOT NULL AUTO_INCREMENT,
!             $artnotescolumn[aid] INT(10) NOT NULL,
!             $artnotescolumn[authorid] INT(10) NOT NULL,
!             $artnotescolumn[text] TINYTEXT,
!             $artnotescolumn[pubdate] INT UNSIGNED NOT NULL,
!             PRIMARY KEY($artnotescolumn[nid]))";
!     $dbconn->Execute($sql);
! 
!     // Check database result
!     if ($dbconn->ErrorNo() != 0) {
!         // Report failed initialisation attempt
!         pnSessionSetVar('errormsg', _CREATETABLEFAILED . $dbconn->ErrorMsg());
!         return false;
!     }
! }
! 
! // TODO: add pn_status : e.g. 0 = submitted, 1 = approved, 2 = approved for
! //       homepage (=equivalent of old ihome field) to support Add-Story and
! //       Submit-News queue equivalents in .80
! //       Somewhere in the future, this would be managed by a workflow module.
! // From Nuncanada : Let�s change it to match a simple workflow already.
! // 0= approved for homepage, > 0 means its inside the workflow
! 
! function articles_init_create_workflowtable ()
! {
!     // Get database information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
! 
!     // Workflow table
!     // Table name & Column names
!     $articles_workflow = $pntable['articles_workflow'];
!     $artworkflowcolumn = &$pntable['articles_wrokflow_column'];
!     // Create Table
!     $sql = "CREATE TABLE $articles_workflow (
!             $artworkflowcolumn[wid] INT(4) NOT NULL,
!             $artworkflowcolumn[gid] INT(10) NOT NULL,
!             UNIQUE KEY($artworkflowcolumn[wid]))";
      $dbconn->Execute($sql);
  
--- 58,68 ----
              $articlescolumn[title] TEXT NOT NULL DEFAULT '',
              $articlescolumn[summary] TEXT,
+             $articlescolumn[body] TEXT,
              $articlescolumn[authorid] INT(11) NOT NULL,
              $articlescolumn[pubdate] INT UNSIGNED NOT NULL,
!             $articlescolumn[pubtypeid] INT(4) NOT NULL DEFAULT '1',
!             $articlescolumn[pages] INT UNSIGNED NOT NULL,
!             $articlescolumn[language] VARCHAR(30) NOT NULL DEFAULT '',
!             PRIMARY KEY(pn_aid))";
      $dbconn->Execute($sql);
  
***************
*** 165,192 ****
          return false;
      }
- }
- 
-     // This is where the text are stored
- 	// Language translation should be treated here or thru the translation module???
- 	// I think it should thru the translation module...
- 	// Here is where the versioning will be handled too
- 
- function articles_init_create_textstable ()
- {
-     // Get database information
-     list($dbconn) = pnDBGetConn();
-     $pntable = pnDBGetTables();
  
      // Create tables
!     $articlestextstable = $pntable['articles_texts'];
!     $arttextscolumn = &$pntable['articles_texts_column'];
!     $sql = "CREATE TABLE $articlestextstable (
! 	                       $arttextscolumn[tid] INT(10) NOT NULL AUTO_INCREMENT,
!                            $arttextscolumn[aid] INT(10) NOT NULL,
!                            $arttextscolumn[version] TINYINT(3) NOT NULL UNSIGNED,
!                            $arttextscolumn[authorid] INT(10) NOT NULL,
!                            $arttextscolumn[date] INT UNSIGNED NOT NULL,
!                            $arttextscolumn[text] TEXT
!             PRIMARY KEY($arttextscolumn[tid]))";
      $dbconn->Execute($sql);
  
--- 73,85 ----
          return false;
      }
  
      // Create tables
!     $pubtypestable = $pntable['publication_types'];
!     $pubtypescolumn = &$pntable['publication_types_column'];
!     $sql = "CREATE TABLE $pubtypestable (
!             $pubtypescolumn[pubtypeid] INT(4) NOT NULL AUTO_INCREMENT,
!             $pubtypescolumn[pubtypename] VARCHAR(30) NOT NULL,
!             $pubtypescolumn[pubtypedescr] VARCHAR(255) NOT NULL DEFAULT '',
!             PRIMARY KEY(pn_pubtypeid))";
      $dbconn->Execute($sql);
  
***************
*** 197,286 ****
          return false;
      }
- }
-     
- // I want to make the versioning relationship able to handle
- // situations as complex as possible, like article�s splitting
- // or grouping
- // So categories wont work... As it is a 1 parent to N children (hierarchical)
- // We need N parents to N children (non-hierarchical)...
  
- function articles_init_create_texreltable ()
- {
-     // Get database information
-     list($dbconn) = pnDBGetConn();
-     $pntable = pnDBGetTables();
- 
-     // Create tables
-     $arttexreltable = $pntable['articles_texrel'];
-     $arttexrelcolumn = &$pntable['articles_texrel_column'];
-     $sql = "CREATE TABLE $arttexreltable (
- 	                       $arttexrelcolumn[pid] INT(10) NOT NULL,
-                            $arttexrelcolumn[tid] INT(10) NOT NULL,
-             INDEX $arttexrelcolumn[tid] ($arttexrelcolumn[tid])
-             INDEX $arttexrelcolumn[pid] ($arttexrelcolumn[pid]))";
-     $dbconn->Execute($sql);
- 
-     // Check database result
-     if ($dbconn->ErrorNo() != 0) {
-         // Report failed initialisation attempt
-         pnSessionSetVar('errormsg', _CREATETABLEFAILED . $dbconn->ErrorMsg());
-         return false;
-     }
- }
-     
  // TODO: refine according to RFC 1
! // I would create them as categories inside something like Documents
! // Or PostNuke�s core category.
! function articles_init_add_cats ()
! {
      $values = array(
!                     array('news', 'News Articles'),
!                     array('section', 'Section Documents'),
!                     array('review', 'Reviews'),
!                     array('faq', 'Frequently Asked Questions')
                );
  
-     // TODO: Add exception handling
-               
-     pnModAPILoad('categories','admin');
- 
-     $pubcid = pnModAPIFunc('categories',
-                            'admin',
-                            'create', 
-                            Array('name' => 'Publication Types',
-                                  'description' => 'Old PHP-Nuke�s modules of content',
-                                  'image' => '',
-                                  'parent_id' => pnConfigGetVar('globalcid')
-                                  ));
- 
-     pnModSetVar('articles', 'pubcid', $pubcid);
- 
-     $cids = Array ();
      foreach ($values as $value) {
!         list($name,$descr) = $value;
! 		$cids[] = pnModAPIFunc('categories',
!                                'admin',
!                                'create', 
!                                Array('name' => $name,
!                                      'description' => $descr,
!                                      'image' => '',
!                                      'parent_id' => $pubcid
!                                      ));
      }
- }
  
! 	// I think Publication Types are an PHP-Nuke artefact
! 	// With the categorization and having a module to change templates
! 	// for each category, they are superfluous
! 	
! 	/*
!     // Create tables
!     $pubtypestable = $pntable['publication_types'];
!     $pubtypescolumn = &$pntable['publication_types_column'];
!     $sql = "CREATE TABLE $pubtypestable (
!             $pubtypescolumn[pubtypeid] INT(4) NOT NULL AUTO_INCREMENT,
!             $pubtypescolumn[pubtypename] VARCHAR(30) NOT NULL,
!             $pubtypescolumn[pubtypedescr] VARCHAR(255) NOT NULL DEFAULT '',
!             PRIMARY KEY(pn_pubtypeid))";
      $dbconn->Execute($sql);
  
--- 90,128 ----
          return false;
      }
  
  // TODO: refine according to RFC 1
! 
      $values = array(
!                     array(1, 'news', 'News Articles'),
!                     array(2, 'section', 'Section Documents'),
!                     array(3, 'review', 'Reviews'),
!                     array(4, 'faq', 'Frequently Asked Questions'),
                );
  
      foreach ($values as $value) {
!         list($id,$name,$descr) = $value;
!         $sql = "INSERT INTO $pubtypestable
!                 (pn_pubtypeid, pn_pubtypename, pn_pubtypedescr)
!                 VALUES ($id, '$name', '$descr')";
!         $dbconn->Execute($sql);
! 
!         // Check database result
!         if ($dbconn->ErrorNo() != 0) {
!             pnSessionSetVar('errormsg', _CREATETABLEFAILED . $dbconn->ErrorMsg());
!            // Report failed initialisation attempt
!             return false;
!         }
      }
  
! // TODO: the following tables are unused (cfr. RFC 1 for more generic approach)
! 
!     $articlespagestable = $pntable['articles_pages'];
!     $articlespagescolumn = &$pntable['articles_pages_column'];
!     $sql = "CREATE TABLE $articlespagestable (
!             $articlespagescolumn[pid] INT(4) NOT NULL AUTO_INCREMENT,
!             $articlespagescolumn[aid] INT(10) NOT NULL,
!             $articlespagescolumn[page] INT(4) NOT NULL,
!             $articlespagescolumn[body] TEXT NOT NULL,
!             PRIMARY KEY(pn_pid))";
      $dbconn->Execute($sql);
  
***************
*** 291,299 ****
          return false;
      }
- 	*/
- // I dont think this is the right place to handle this
- // There should be a 'image' module? 
  
- /*
      $articlesimagestable = $pntable['articles_images'];
      $articlesimagescolumn = &$pntable['articles_images_column'];
--- 133,137 ----
***************
*** 311,316 ****
          return false;
      }
- */
  
  
  /**
--- 149,161 ----
          return false;
      }
  
+     // Set up module variables
+     pnModSetVar('articles', 'itemsperpage', 10);
+     pnModSetVar('articles', 'number_of_categories', 2);
+     pnModSetVar('articles', 'SupportShortURLs', 0);
+ 
+     // Initialisation successful
+     return true;
+ }
  
  /**
***************
*** 383,389 ****
  
              break;
!         case 1.1:
              // Code to upgrade from version 2.0 goes here
- 			
              break;
          case 2.5:
--- 228,233 ----
  
              break;
!         case 2.0:
              // Code to upgrade from version 2.0 goes here
              break;
          case 2.5:

Index: pntables.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/articles/pntables.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pntables.php	19 Jul 2002 21:45:59 -0000	1.5
--- pntables.php	27 Jul 2002 17:23:12 -0000	1.6
***************
*** 36,132 ****
  
      // Column names
!     // Not text column here...
!     // Let text have it�s own specialized table, where we can
!     // have better versioning/workflow
!     $pntable['articles_column'] = array('aid'          => $articles . '.pn_aid',
!                                         'title'        => $articles . '.pn_title',
!                                         'summary'      => $articles . '.pn_summary',
!                                         'authorid'     => $articles . '.pn_authorid',
!                                         // Date the article was created
!                                         'date' => $articles . '.pn_date',
!                                         // Where in the workflow tree
!                                         // this article is stuck at.
!                                         // 0 => published
!                                         // Higher means inside the hierarchy
!                                         'wid'       => $articles . '.pn_wid'
!                                        );
! 
! 
!     // Add flexible notes...
!     // Everyone with right perms can add a note...
! 
!     // Name for articles database entities
!     $articles_notes = pnConfigGetVar('prefix') . '_articles_notes';
!     // Table name
!     $pntable['articles_notes'] = $articles_notes;
!     // Column names
!     $pntable['articles_notes_column'] = array('nid'      => $articles_notes . '.pn_nid',
!                                               'aid'      => $articles_notes . '.pn_aid',
!                                               'authorid' => $articles_notes . '.pn_authorid',
!                                               'date'     => $articles_notes . '.pn_date',
!                                               'text'     => $articles_notes . '.pn_text'
!                                              );
! 
!     // Workflow table
!     
!     // Name for articles database entities
!     $articles_workflow = pnConfigGetVar('prefix') . '_articles_workflow';
!     // Table name
!     $pntable['articles_workflow'] = $articles_workflow;
!     // Column names
!     $pntable['articles_workflow_column'] = array(
!                                                  // Workflow ID will be reverse
!                                                  // 1 => the latest before publishing
!                                                  // How higher the nearer to the
!                                                  // start in the workflow tree
!                                                  'wid'      => $articles_notes . '.pn_tid',
!                                                  // Group ID feeded from the groups_module
!                                                  'gid'      => $articles_notes . '.pn_gid'
!                                                  );
! 
!     
!     // Flexible queue... We need a workflow builder
!     // Translation queue ... A special queue as option in the workflow builder
!     
!     // Area to introduce the actual text should be handled
!     // by an editor mechanism... (An standard one, that should
!     // be used to translate the text too)
!     // Name for articles database entities
!     $articles_notes = pnConfigGetVar('prefix') . '_articles_texts';
!     // Table name
!     $pntable['articles_texts'] = $articles_notes;
!     // Column names
!     $pntable['articles_texts_column'] = array('tid'      => $articles_texts . '.pn_tid',
!                                               // The article�s ID
!                                               'aid'      => $articles_texts . '.pn_aid',
!                                               // Automatic Versioning
!                                               'version'  => $articles_texts . '.pn_version',
!                                               // Foreign User ID
!                                               'authorid' => $articles_texts . '.pn_authorid',
!                                               // date of insertion in the database
!                                               'date'     => $articles_texts . '.pn_date',
!                                               // The article�s text
!                                               'text'     => $articles_texts . '.pn_text'
!                                              );
! 
!     // Name for articles database entities
!     $articles_texrel = pnConfigGetVar('prefix') . '_articles_texrel';
!     // Table name
!     $pntable['articles_texrel'] = $articles_texrel;
!     // Column names for Texts Relationships
!     $pntable['articles_texrel_column'] = array('tid' => $articles_texrel . '.pn_tid',
!                                               'pid' => $articles_texrel . '.pn_pid'
!                                              );
!                                              
!     //Note to mikespub:
!     // Are these pubtypes really necessary or superfluous?
!     // I think they are just PHPNuke�s scheme heritage,
!     // They dont add any actual useful information about
!     // the articles/news or review�s article or section�s article
  
-     // Now we can categorize these the way we want, and we will be able to
-     // chage the template depending on category -> Different templates
-     // for Reviews/Articles/News/Section
-   
      // Name for publication types table
      $publicationtypes = pnConfigGetVar('prefix') . '_publication_types';
--- 36,49 ----
  
      // Column names
!     $pntable['articles_column'] = array('aid'      => $articles . '.pn_aid',
!                                         'title'    => $articles . '.pn_title',
!                                         'summary'  => $articles . '.pn_summary',
!                                         'authorid' => $articles . '.pn_authorid',
!                                         'pubdate'  => $articles . '.pn_pubdate',
!                                         'pubtypeid'  => $articles . '.pn_pubtypeid',
!                                         'pages'    => $articles . '.pn_pages',
!                                         'body'     => $articles . '.pn_body',
!                                         'language' => $articles . '.pn_language');
  
      // Name for publication types table
      $publicationtypes = pnConfigGetVar('prefix') . '_publication_types';
***************
*** 142,151 ****
  
  // TODO: the following tables are unused (cfr. RFC 1 for more generic approach)
! // People still want a paging mechanism!
! // Let�s redo all of it but keep the feature...
! // Probably having in the editing mechanism a <page> tag?
! // Now that we are going to have a versioning of the text, having 
! // pages separated in the database will lead to a big mess/bad useability
! /*
      // Name for articles database pages
      $articlespages = pnConfigGetVar('prefix') . '_articles_pages';
--- 59,63 ----
  
  // TODO: the following tables are unused (cfr. RFC 1 for more generic approach)
! 
      // Name for articles database pages
      $articlespages = pnConfigGetVar('prefix') . '_articles_pages';
***************
*** 160,168 ****
                                                'body' => $articlespages . '.pn_body');
  
! */
! // This shouldn�t be handled this way...
! // RFC-1 suggests having metatypes which can be refered to, and
! // having some nice way to implement them into a template.
! /*                                              
      // Name for articles database images
      $articlesimages = pnConfigGetVar('prefix') . '_articles_images';
--- 72,76 ----
                                                'body' => $articlespages . '.pn_body');
  
! 
      // Name for articles database images
      $articlesimages = pnConfigGetVar('prefix') . '_articles_images';
***************
*** 176,180 ****
                                                 'image'      => $articlesimages . '.pn_image');
  
! */
      // Return table information
      return $pntable;
--- 84,88 ----
                                                 'image'      => $articlesimages . '.pn_image');
  
! 
      // Return table information
      return $pntable;


Directory filter : [ all ] / postnuke_modules / articles [ view in CVS ]

View Statistics - Next Notice - Previous Notice


Visit Developer Site - Browse CVS Repository Syndicate via backend.rss
(max. once per hour please)
Powered by CVSNotice 0.1.3