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_official / html / modules / comments / backend [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
26 Jul 2002 03:01:20postnuke_official/html/modules/comments/backendbackend-mysql.php,1.8,1.9 backend-nonmysql.php,1.8,1.9Carl P. Corliss
 various bugfixes

Update of /home/cvsroot/postnuke_official/html/modules/comments/backend
In directory ns7.hostnuke.net:/tmp/cvs-serv8504/html/modules/Comments/backend

Modified Files:
	backend-mysql.php backend-nonmysql.php 
Log Message:
various bugfixes


Index: backend-mysql.php
===================================================================
RCS file: /home/cvsroot/postnuke_official/html/modules/comments/backend/backend-mysql.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** backend-mysql.php	1 Jul 2002 06:16:06 -0000	1.8
--- backend-mysql.php	26 Jul 2002 03:01:18 -0000	1.9
***************
*** 27,30 ****
--- 27,32 ----
  /******************************************************************************/
  
+     include_once('modules/comments/common/CommonFunctions.php');
+ 
      //
      //  Acquires comments based on the module/hook and the comment id. The depth
***************
*** 36,44 ****
      //  comment the call would be:  pnComments_Get(1, 5) 1 telling the function to
      //  only return that one comment and 5 telling the function which comment to get.
!     //
! 
!     function pnComments_Get($modid, $itemid, $cid=_COM_RETRIEVE_ALL, $depth=_COM_FULL_TREE, $sort=_COM_SORT_ASC) {
          extract($args);
!     
          if ( !isset($modid) && !isset($itemid) ) {
              $msg = pnML('Missing required arguments to function pncomments_get()');
--- 38,50 ----
      //  comment the call would be:  pnComments_Get(1, 5) 1 telling the function to
      //  only return that one comment and 5 telling the function which comment to get.
!     //  @param modid integer id of the module
!     //  @param itemid string id of the page or specific item comments are attached to
!     //  @param depth integer maximum levels of depth to draw out
!     //  @param sortby integer what to sort comments by
!     //  @param direction string which direction to sort in (asc/desc)
!    
!     function pnComments_Get($args) {
          extract($args);
! 
          if ( !isset($modid) && !isset($itemid) ) {
              $msg = pnML('Missing required arguments to function pncomments_get()');
***************
*** 49,53 ****
          }
  
!         if (!pnModAvailable($modid)) {
              $msg = pnML('The module you specified is not available.');
              pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE',
--- 55,71 ----
          }
  
!         if (!isset($depth) || $depth < 0) {
!             $depth = _COM_MAX_DEPTH;
!         }
!         
!         if (!isset($sortby) || empty($sortby)) {
!             $sortby = _COM_SORTBY_LINEAGE;
!         }
!         
!         if (!isset($direction)) {
!             $direction = _COM_SORT_ASC;
!         }
! 
!         if (!pnModAvailable(pnModGetName())) {
              $msg = pnML('The module you specified is not available.');
              pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE',
***************
*** 55,59 ****
              return;
          }
! 
          list($dbconn) = pnDBGetConn();
          // Checkthe cid to makes sure it is numeric and not negative.
--- 73,77 ----
              return;
          }
!         
          list($dbconn) = pnDBGetConn();
          // Checkthe cid to makes sure it is numeric and not negative.
***************
*** 87,98 ****
          // to return.
          if ($depth < 0) {  // if depth is less then zero grab all levels of depth
!             $sql .= ' AND '.$column['lineage'].' REGEXP "^([0-9]+:?){'.$basedepth.',}$"';
          } elseif (0 == $depth) { // if depth is zero, grab only that one comment
              $sql .= '';
          } elseif ($depth >= 1) { // if depth is greater than zero, grab $depth levels only
              $depth += $basedepth;
!             $sql .= ' AND '.$column['lineage'].' REGEXP "^([0-9]+:?){'.$basedepth.','.$depth.'}$"';
          } else { // in case depth is something else, set depth to grab all levels
!             $sql .= ' AND '.$column['lineage'].' REGEXP "^([0-9]+:?){'.$basedepth.',}$"';
          }
  
--- 105,116 ----
          // to return.
          if ($depth < 0) {  // if depth is less then zero grab all levels of depth
!             $sql .= ' AND '.$column['lineage'].' REGEXP "^([0-9A-F]+:?){'.$basedepth.',}$"';
          } elseif (0 == $depth) { // if depth is zero, grab only that one comment
              $sql .= '';
          } elseif ($depth >= 1) { // if depth is greater than zero, grab $depth levels only
              $depth += $basedepth;
!             $sql .= ' AND '.$column['lineage'].' REGEXP "^([0-9A-F]+:?){'.$basedepth.','.$depth.'}$"';
          } else { // in case depth is something else, set depth to grab all levels
!             $sql .= ' AND '.$column['lineage'].' REGEXP "^([0-9A-F]+:?){'.$basedepth.',}$"';
          }
  
***************
*** 140,147 ****
              $row['comdate'] = $resultID->UnixTimeStamp($row['comdate']);
              $row['author'] = pnComments_GetUname($row['author']);
- 
              // move the result pointer to the next row
              $resultID->MoveNext();
!             
              // Add the current comment to the end of the commentlist
              $commentlist[] = $row;
--- 158,164 ----
              $row['comdate'] = $resultID->UnixTimeStamp($row['comdate']);
              $row['author'] = pnComments_GetUname($row['author']);
              // move the result pointer to the next row
              $resultID->MoveNext();
! 
              // Add the current comment to the end of the commentlist
              $commentlist[] = $row;
***************
*** 152,156 ****
              $commentlist = pnComments_SortBy($commentlist, $sortby, $direction);
          }
- 
          return $commentlist;
      }  // end of function pnComments_Get(...)
--- 169,172 ----

Index: backend-nonmysql.php
===================================================================
RCS file: /home/cvsroot/postnuke_official/html/modules/comments/backend/backend-nonmysql.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** backend-nonmysql.php	1 Jul 2002 06:16:06 -0000	1.8
--- backend-nonmysql.php	26 Jul 2002 03:01:18 -0000	1.9
***************
*** 27,30 ****
--- 27,32 ----
  /******************************************************************************/
  
+     include_once('modules/comments/common/CommonFunctions.php');
+     
  	//  Acquires comments based on the module/hook and the comment id. The depth
  	//  parameter allows us to only acquire comments to (n) levels deep. A value of 0
***************
*** 37,41 ****
  	//
  
!     function pnComments_Get($modname, $hookid, $cid=_COM_RETRIEVE_ALL, $depth=_COM_FULL_TREE, $sort=_COM_SORT_ASC) {
  
          if ( !isset($modid) && !isset($itemid) ) {
--- 39,45 ----
  	//
  
!     
!     function pnComments_Get($args) {
!         extract($args);
  
          if ( !isset($modid) && !isset($itemid) ) {
***************
*** 47,51 ****
          }
  
!         if (!pnModAvailable($modid)) {
              $msg = pnML('The module you specified is not available.');
              pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE',
--- 51,63 ----
          }
  
!         if (!isset($depth) || $depth < 0) {
!             $depth = _COM_FULL_TREE;
!         }
!         
!         if (!isset($sort)) {
!             $sort = _COM_SORT_ASC;
!         }
! 
!         if (!pnModAvailable(pnModGetName())) {
              $msg = pnML('The module you specified is not available.');
              pnExceptionSet(PN_SYSTEM_EXCEPTION, 'DATABASE',
***************
*** 53,61 ****
              return;
          }
! 
          list($dbconn) = pnDBGetConn();
          // Checkthe cid to makes sure it is numeric and not negative.
          // If it's not numeric or it's a negative number, switch it to zero.
!         if (!is_numeric($cid) || 0 > $cid) {
              $cid = _COM_RETRIEVE_ALL;
          }
--- 65,73 ----
              return;
          }
!         
          list($dbconn) = pnDBGetConn();
          // Checkthe cid to makes sure it is numeric and not negative.
          // If it's not numeric or it's a negative number, switch it to zero.
!         if (!is_numeric($cid) || $cid < 0) {
              $cid = _COM_RETRIEVE_ALL;
          }
***************
*** 63,67 ****
          // If we are specifying a cid (ie., cid != 0) then
          // find out what it's depth is, if we aren't then set basedepth = 0
!         if (0 < $cid) {
              $lineage = pnComments_GetLineage($cid);
              $basedepth = pnComments_GetDepth($lineage);
--- 75,79 ----
          // If we are specifying a cid (ie., cid != 0) then
          // find out what it's depth is, if we aren't then set basedepth = 0
!         if ($cid > 0) {
              $lineage = pnComments_GetLineage($cid);
              $basedepth = pnComments_GetDepth($lineage);


Directory filter : [ all ] / postnuke_official / html / modules / comments / backend [ 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