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 / postboard [ view in CVS ]

Date Directory [filter] File(s) [view] Author [filter]
31 Jul 2002 13:09:25postnuke_modules/postboardindex.php,1.2,1.3 pbamisc.php,1.2,1.3 pnadmin.php,1.2,1.3 pnadminapi.php,1.2,1.3 pninit.php,1.2,1.3 pntables.php,1.2,1.3 pnuser.php,1.2,1.3 pnuserapi.php,1.2,1.3 pnversion.php,1.3,1.4Burke
 Many Updates since first posted to CVS

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

Modified Files:
	index.php pbamisc.php pnadmin.php pnadminapi.php pninit.php 
	pntables.php pnuser.php pnuserapi.php pnversion.php 
Log Message:
Many Updates since first posted to CVS


Index: index.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/index.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** index.php	3 Jul 2002 14:17:01 -0000	1.2
--- index.php	31 Jul 2002 13:09:23 -0000	1.3
***************
*** 1,10 ****
  <?php
  /********************************************************/
! /* PostBoard                                            */
  /* Version .,  see changes.txt for details              */
  /* By Marie Altobelli (Ladyofdragons)                   */
  /* Development continued by                             */
  /*                                                      */
! /*  The PostBoard Team                                  */
  /*	Marie Altobelli (Ladyofdragons)                     */	
  /*  Burke Azbill - burke@dimensionquest.com             */
--- 1,10 ----
  <?php
  /********************************************************/
! /* postboard                                            */
  /* Version .,  see changes.txt for details              */
  /* By Marie Altobelli (Ladyofdragons)                   */
  /* Development continued by                             */
  /*                                                      */
! /*  The postboard Team                                  */
  /*	Marie Altobelli (Ladyofdragons)                     */	
  /*  Burke Azbill - burke@dimensionquest.com             */
***************
*** 21,25 ****
      You can now link the module in a menu using the
      module name enclosed with brackets
!     (ex: [PostBoard])
   *******************************************************/
  
--- 21,25 ----
      You can now link the module in a menu using the
      module name enclosed with brackets
!     (ex: [postboard])
   *******************************************************/
  

Index: pbamisc.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pbamisc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pbamisc.php	3 Jul 2002 14:17:01 -0000	1.2
--- pbamisc.php	31 Jul 2002 13:09:23 -0000	1.3
***************
*** 1,9 ****
  <?php
  //miscellaneous functions for postboard.  these functions
  //are passed through from pnadmin.php
  
! function postboard_admin_levels()
  {
  
  }
! ?>
--- 1,179 ----
  <?php
+ /********************************************************/
+ /* postboard                                            */
+ /* Version .,  see changes.txt for details              */
+ /* By Marie Altobelli                                   */
+ /* Development continued by                             */
+ /*                                                      */
+ /*  The postboard Team                                  */
+ /* 	   Marie Altobelli									*/
+ /*     Burke Azbill - burke@dimensionquest.com          */
+ /*                                                      */
+ /* This program is opensource so you can do whatever    */
+ /* you want with it.                                    */
+ /*                                                      */
+ /* Any new versions can be found at                     */
+ /* http://postnuke.dndresources.com                     */
+ /* http://postboard.dimensionquest.com                  */
+ /********************************************************/
+ 
  //miscellaneous functions for postboard.  these functions
  //are passed through from pnadmin.php
  
! function pba_admin_levels()
  {
  
+     // Create output object - this object will store all of our output so that
+     // we can return it easily when required
+     $output = new pnHTML();
+ 
+     if (!pnSecAuthAction(0, 'postboard::', '::', ACCESS_ADMIN)) {
+         $output->Text(_PBNOAUTH);
+         return $output->GetOutput();
+     }
+ 
+     // Add menu to output - it helps if all of the module pages have a standard
+     // menu at their head to aid in navigation
+     $output->SetInputMode(_PNH_VERBATIMINPUT);
+     $output->Text(postboard_adminmenu());
+     $output->SetInputMode(_PNH_PARSEINPUT);
+ 	
+ 	$output->SetOutputMode(_PNH_RETURNOUTPUT);
+ 	$ot = ''; //this is the holder for output
+ 	$start = '<tr><td align="center">';
+ 	$between = '</td><td  align="center">';
+ 	$start2 = '<tr><td align="center" class="pn-title">';
+ 	$between2 = '</td><td  align="center" class="pn-title">';
+ 	$end = '</td></tr>';
+ 	
+     // Title - putting a title ad the head of each page reminds the user what
+     // they are doing
+ 	$ot .= $output->LineBreak(2);
+     $ot .= $output->Title(_PBEDITLEVELS);
+ 
+     // Load API.  Note that this is loading the user API, that is because the
+     // user API contains the function to obtain item information which is the
+     // first thing that we need to do.  If the API fails to load an appropriate
+     // error message is posted and the function returns
+     if (!pnModAPILoad('postboard', 'user')) {
+         $output->Text(_LOADFAILED);
+         return $output->GetOutput();
+     }
+ 
+     // The user API function is called.  This takes the number of items
+     // required and the first number in the list of all items, which we
+     // obtained from the input and gets us the information on the appropriate
+     // items.
+     $items = pnModAPIFunc('postboard', 'user', 'getlevels');
+     
+     
+     // Start output table
+     $ot .= '<table width="100%" border="1">'
+ 	. $start2
+ 	. $output->Text(_PBLEVELNAME)
+ 	. $between2
+ 	. $output->Text(_PBLEVELMINPOSTS)
+ 	. $between2
+ 	. $output->Text(_PBLEVELMAXPOSTS)
+ 	. $between2
+ 	. $output->Text(_PBLEVELSPECIAL)
+ 	. '<td colspan ="2" align="center" class="pn-title">'
+ 	. $output->Text(_PBLEVELIMAGE)
+ 	. $between2
+ 	. $output->Text(_PBFUNCTIONS)
+ 	. $end;
+ 	
+     $row = array();
+     foreach ($items as $item) {
+             // Options for the item.
+             $options = array();
+             if (pnSecAuthAction(0, 'postboard::', "::", ACCESS_ADMIN)) {
+                     $options[] = $output->FormSubmit('Edit');
+                     $options[] = $output->URL(pnModURL('postboard',
+                                                        'admin',
+                                                        'deletelevel',
+                                                        array('level_id' => $item['level_id'])),
+                                               _DELETE);
+             }
+ 
+             $optionstxt = join(' | ', $options);
+ 	    if ($item['level_image'] <> '' ) {
+ 		    $levelimage = '<img src="'.pnModGetVar('postboard', 'leveldir') . '/' . $item['level_image'].'">';
+ 	    } else {
+ 		    $levelimage = '';
+ 	    }
+ 			$ot .= $start 
+ 				. $output->FormStart(pnModURL('postboard','admin','modifylevel'))
+ 				. $output->FormHidden('authid', pnSecGenAuthKey())
+ 				. $output->FormHidden('level_id', $item['level_id'])
+ 				. $output->FormText('level_title', $item['level_title'], 20, 40)
+ 				. $between . "\n"
+ 				. $output->FormText('level_minposts', $item['level_minposts'], 8, 8)
+ 				. $between . "\n" 
+ 				. $output->FormText('level_minposts', $item['level_maxposts'], 8, 8)
+ 				. $between 
+ 				. $output->FormCheckbox('level_special', $item['level_special']) 
+ 				. $between  . "\n"
+ 				. $levelimage 
+ 				. $between . "\n"
+ 				. $output->FormText('level_image', $item['level_image'], 12,40)
+ 				. $between  . "\n"
+ 				. $optionstxt 
+ 				. $output->FormEnd
+ 				. $end . "\n";
+     }
+     //$ot .= $start . 'title' . $between . 'id' . $between . 'options' . $end;
+     $ot .= $output->TableEnd();
+ 
+ 	$output->SetOutputMode(_PNH_KEEPOUTPUT);
+ 	$output->SetInputMode(_PNH_VERBATIMINPUT);
+ 	$output->Text($ot);
+ 
+     // Return the output that has been generated by this function
+     return $output->GetOutput();
  }
! 
! function pba_admin_modifylevel() {
! 
!     //confirm authorization
!     if (!pnSecConfirmAuthKey()) {
!         pnSessionSetVar('errormsg', _BADAUTHKEY);
!         pnRedirect(pnModURL('postboard', 'admin', 'view'));
!         return true;
!     }
! 	list($level_id, $level_title, $level_minposts, $level_maxposts, $level_special, $level_image) = pnVarCleanFromInput('level_id'
! 	,'level_title' ,'level_minposts', 'level_maxposts', 'level_special', 'level_image');
! 	
!     // Load API
!     if (!pnModAPILoad('postboard', 'admin')) {
!         pnSessionSetVar('errormsg', _LOADFAILED);
!         return $output->GetOutput();
!     }
!     
!     // The API function is called
!     	$level_id = pnModAPIFunc('postboard',
!                         'admin',
!                         'modifylevel',
!                         array('level_id' => $level_id,
! 				'level_title' => $level_title,
! 				'level_minposts' => $level_minposts,
! 				'level_maxposts' => $level_maxposts,
! 				'level_special' => $level_special,
! 				'level_image' => $level_image));
! 
! 	// The return value of the function is checked here, and if the function
! 	// suceeded then an appropriate message is posted.
! 	if ($level_id != false) {
! 		// Success
! 		pnSessionSetVar('statusmsg', _PBLEVELMODIFIED);
! 	} else {
! 		return false;
! 	}
!     // This function generated no output, and so now it is complete we redirect
!     // the user to an appropriate page for them to carry on their work
! 
! 	pnRedirect(pnModURL('postboard', 'admin', 'levels'));
!     // Return
!     return true; 
! }
! ?>
\ No newline at end of file

Index: pnadmin.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pnadmin.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pnadmin.php	3 Jul 2002 14:17:01 -0000	1.2
--- pnadmin.php	31 Jul 2002 13:09:23 -0000	1.3
***************
*** 31,47 ****
  $modinfo    = pnModGetInfo($modid);
  
! // *******************   Begin Categories Management *******************
  include 'modules/'.$modinfo['directory'].'/pnincludes/pbacategories.php';
! // *******************   End Categories Management *******************
! 
  
! // *******************   Begin Forums Management *******************
  include 'modules/'.$modinfo['directory'].'/pnincludes/pbaforums.php';
! // *******************   End Forums Management *******************
  
! // *******************   End Postboard Configuration *******************
  include 'modules/'.$modinfo['directory'].'/pnincludes/pbawords.php';
! // *******************  Begin Words List Configuration *****************
! 
  
  /**
--- 31,45 ----
  $modinfo    = pnModGetInfo($modid);
  
! // *******************   Begin categories Management *******************
  include 'modules/'.$modinfo['directory'].'/pnincludes/pbacategories.php';
! // *******************   End categories Management *******************
  
! // *******************   Begin forums Management *******************
  include 'modules/'.$modinfo['directory'].'/pnincludes/pbaforums.php';
! // *******************   End forums Management *******************
  
! // *******************   End postboard Configuration *******************
  include 'modules/'.$modinfo['directory'].'/pnincludes/pbawords.php';
! // *******************  Begin words List Configuration *****************
  
  /**
***************
*** 67,71 ****
      // for administration depends on the particular module, but it is generally
      // either 'edit' or 'delete'
!     if (!pnSecAuthAction(0, 'PostBoard::Item', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 65,69 ----
      // for administration depends on the particular module, but it is generally
      // either 'edit' or 'delete'
!     if (!pnSecAuthAction(0, 'postboard::item', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 99,103 ****
  	$ot = '';
      // Start options menu
!     //$output->TableStart(_POSTBOARD);
      $output->SetOutputMode(_PNH_RETURNOUTPUT);
  
--- 97,101 ----
  	$ot = '';
      // Start options menu
!     //$output->TableStart(_postboard);
      $output->SetOutputMode(_PNH_RETURNOUTPUT);
  
***************
*** 106,112 ****
      $ot .= $output->URL(pnModURL('postboard', 'admin', 'modifyconfig'), _PBCONFIG); 
  	$ot .= $output->Linebreak(1);
! 	$ot .= $output->URL(pnModURL('postboard', 'admin', 'newcategory'), _PBNEWCATEGORY); 
! 	$ot .= $output->Linebreak(1);
!     $ot .= $output->URL(pnModURL('postboard', 'admin', 'editcategory'), _PBEDITCATEGORY); 
  	$ot .= $output->Linebreak(1);
      $ot .= $output->URL(pnModURL('postboard', 'admin', 'manageforums'), _PBMANAGEFORUMS); 
--- 104,108 ----
      $ot .= $output->URL(pnModURL('postboard', 'admin', 'modifyconfig'), _PBCONFIG); 
  	$ot .= $output->Linebreak(1);
! 	$ot .= $output->URL(pnModURL('postboard', 'admin', 'managecategories'), _PBMANAGECATEGORIES); 
  	$ot .= $output->Linebreak(1);
      $ot .= $output->URL(pnModURL('postboard', 'admin', 'manageforums'), _PBMANAGEFORUMS); 
***************
*** 128,133 ****
  }
  
! 
! // *******************   Begin Postboard Configuration *******************
  /**
   * This is a standard function to modify the configuration parameters of the
--- 124,128 ----
  }
  
! // *******************   Begin postboard Configuration *******************
  /**
   * This is a standard function to modify the configuration parameters of the
***************
*** 143,147 ****
      // potential security holes or just too much wasted processing
  
!     if (!pnSecAuthAction(0, 'PostBoard::', '::', ACCESS_ADMIN)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 138,142 ----
      // potential security holes or just too much wasted processing
  
!     if (!pnSecAuthAction(0, 'postboard::', '::', ACCESS_ADMIN)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 190,193 ****
--- 185,192 ----
  	$ot .= $column3;
  	
+ 	$ot .= $column1 . $output->Text(pnVarPrepForDisplay(_PBLEVELDIR));
+     $ot .= $column2 . $output->FormText('leveldir', pnModGetVar('postboard', 'leveldir'),40,254);
+     $ot .= $column3;
+ 	
  	$ot .= $column1 . $output->Text(pnVarPrepForDisplay(_PBALLOWAVATARS));
      $ot .= $column2 . $output->FormCheckbox('allow_avatar', pnModGetVar('postboard', 'allow_avatar'),1, 'checkbox');
***************
*** 279,282 ****
--- 278,282 ----
      // assumptions that will not hold in future versions of PostNuke
      $smilydir = pnVarCleanFromInput('smilydir');
+     $leveldir = pnVarCleanFromInput('leveldir');
      $forumname =  pnVarCleanFromInput('forumname');
      $allowavatars =  pnVarCleanFromInput('allow_avatar');
***************
*** 295,303 ****
      // might be unset, so it is important to check them all and assign them
      // default values if required
      if (!isset($smilydir)) {
!         $smilydir = '/modules/postboard/pnimages/smilies';
      }
  	if (!isset($forumname)) {
!         $forumname = 'PostBoard Forum';
      }
  	if (!isset($allowavatars)) {
--- 295,308 ----
      // might be unset, so it is important to check them all and assign them
      // default values if required
+     $modid      = pnModGetIDFromName('postboard');
+ 	$modinfo    = pnModGetInfo($modid);
      if (!isset($smilydir)) {
!         $smilydir = 'modules/'.$modinfo['directory'].'/smilies';
!     }
!     if (!isset($leveldir)) {
!         $leveldir = 'modules/'.$modinfo['directory'].'/levels';
      }
  	if (!isset($forumname)) {
!         $forumname = 'postboard forum';
      }
  	if (!isset($allowavatars)) {
***************
*** 336,339 ****
--- 341,345 ----
  	
      pnModSetVar('postboard', 'smilydir', $smilydir);
+     pnModSetVar('postboard', 'leveldir', $leveldir);
  	pnModSetVar('postboard', 'forumname', $forumname);
  	pnModSetVar('postboard', 'allow_avatar', $allowavatars);
***************
*** 357,361 ****
  }
  
! // ********************* End Words List Configuration ******************
  
! ?>
--- 363,374 ----
  }
  
! function postboard_admin_levels()
! {
! 	$modid      = pnModGetIDFromName('postboard');
! 	$modinfo    = pnModGetInfo($modid);
! 	include 'modules/'.$modinfo['directory'].'/pbamisc.php';
! 	return pba_admin_levels();
! }
  
! // ********************* End postboard Configuration ******************
! ?>
\ No newline at end of file

Index: pnadminapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pnadminapi.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pnadminapi.php	3 Jul 2002 14:17:01 -0000	1.2
--- pnadminapi.php	31 Jul 2002 13:09:23 -0000	1.3
***************
*** 1,31 ****
  <?php
! // $Id$
! // ----------------------------------------------------------------------
! // POST-NUKE Content Management System
! // Copyright (C) 2002 by the PostNuke Development Team.
! // http://www.postnuke.com/
! // ----------------------------------------------------------------------
! // Based on:
! // PHP-NUKE Web Portal System - http://phpnuke.org/
! // Thatware - http://thatware.org/
! // ----------------------------------------------------------------------
! // LICENSE
! //
! // This program is free software; you can redistribute it and/or
! // modify it under the terms of the GNU General Public License (GPL)
! // as published by the Free Software Foundation; either version 2
! // of the License, or (at your option) any later version.
! //
! // This program is distributed in the hope that it will be useful,
! // but WIthOUT ANY WARRANTY; without even the implied warranty of
! // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! // GNU General Public License for more details.
! //
! // To read the license please visit http://www.gnu.org/copyleft/gpl.html
! // ----------------------------------------------------------------------
! // Original Author of file: Jim McDonald
! // Purpose of file:  Template administration API
! // ----------------------------------------------------------------------
! // *************** Begin Censored Word Functions ************************
  function postboard_adminapi_deleteword($args) {
  	// Delete a forum
--- 1,170 ----
  <?php
! /********************************************************/
! /* postboard                                            */
! /* Version .,  see changes.txt for details              */
! /* By Marie Altobelli                                   */
! /* Development continued by                             */
! /*                                                      */
! /*  The postboard Team                                  */
! /* 	   Marie Altobelli									*/
! /*     Burke Azbill - burke@dimensionquest.com          */
! /*                                                      */
! /* This program is opensource so you can do whatever    */
! /* you want with it.                                    */
! /*                                                      */
! /* Any new versions can be found at                     */
! /* http://postnuke.dndresources.com                     */
! /* http://postboard.dimensionquest.com                  */
! /********************************************************/
! 
! // *************** Begin Common Functions *******************************
! function postboard_adminapi_updateorder($args) {
! 	extract($args);
! 	
! 	// $item needs to be set to either FORUM or CATEGORY
! 	if (!isset($item) || !$item=="CATEGORY" || !item=="FORUM") {
! 		pnSessionSetVar('errormsg', _MODARGSERROR);
! 		return false;
! 	}
! 	
! 	// security access
! 	if ($item=="CATEGORY"){
! 		if (!pnSecAuthAction(0, 'postboard::categories', "::", ACCESS_EDIT)) {
! 			pnSessionSetVar('errormsg', _PBNOAUTH);
! 			return false;
! 		}
! 		if (!isset($cat_order)) {
! 			pnSessionSetVar('errormsg', _MODARGSERROR);
! 			return false;
!     	}
! 		if (!isset($cat_id)) {
! 			$cat_id = 0;
! 		}
! 		$itemorderfield="cat_order";
! 		$itemidfield="cat_id";
! 		$itemorder=$cat_order;
! 		$itemid=$cat_id;
! 		list($dbconn) = pnDBGetConn();
! 		$pntable = pnDBGetTables();
! 		$postboardtable = $pntable['postboard_categories'];
! 		$postboardcolumn = &$pntable['postboard_categories_column'];
! 		
! 	}
! 	if ($item=="FORUM"){
! 		if (!pnSecAuthAction(0, 'postboard::forums', "::", ACCESS_EDIT)) {
! 			pnSessionSetVar('errormsg', _PBNOAUTH);
! 			return false;
! 		}
! 		if (!isset($forum_order)) {
! 			pnSessionSetVar('errormsg', _MODARGSERROR);
! 			return false;
!     	}
! 		if (!isset($forum_id)) {
! 			$forum_id = 0;
! 		}
! 		$itemorderfield="forum_order";
! 		$itemidfield="forum_id";
! 		$itemorder=$forum_order;
! 		$itemid=$forum_id;
! 		list($dbconn) = pnDBGetConn();
! 		$pntable = pnDBGetTables();
! 		$postboardtable = $pntable['postboard_forums'];
! 		$postboardcolumn = &$pntable['postboard_forums_column'];
! 		
! 	}
! 	
!     // Argument check - make sure that all required arguments are present,
!     // if not then set an appropriate error message and return
!     if (!isset($direction)) {
! 		//direction has 3 types: UP, DOWN, and INSERT.  each does different things.
! 	    $direction = 'INSERT';
! 	}
! 	
!     // rearrange categories
! 	switch($direction) {
! 		case 'UP':
! 			//trade places with previous item
! 			
! 			if ($itemid == 0) { //must have an id to perform this action.
! 				pnSessionSetVar('errormsg', _MODARGSERROR);
! 				return false;
! 			}
! 			//only do this if it isn't the first.
! 			if ($itemorder <> 1) {
! 				$sql = "UPDATE $postboardtable
! 				SET $postboardcolumn[$itemorderfield] = " . pnVarPrepForStore($itemorder) . "
! 				WHERE $postboardcolumn[$itemorderfield] = " . (pnVarPrepForStore($itemorder) - 1);
! 				$dbconn->Execute($sql);
! 
! 				if ($dbconn->ErrorNo() != 0) {
! 					pnSessionSetVar('errormsg', $dbconn->ErrorMsg());
! 					return false;
! 				}
! 			
! 				$sql = "UPDATE $postboardtable
! 					SET $postboardcolumn[$itemorderfield] = " . (pnVarPrepForStore($itemorder)-1 ). "
! 				WHERE $postboardcolumn[$itemidfield] = " . pnVarPrepForStore($itemid);
! 				$dbconn->Execute($sql);
! 				
! 				if ($dbconn->ErrorNo() != 0) {
! 					pnSessionSetVar('errormsg', $dbconn->ErrorMsg().$sql);
! 					return false;
! 				}
! 			}
! 		break;
! 		
! 		case 'DOWN':
! 			//trade places with next item
! 			if ($itemid == 0) { //must have an id to perform this action.
! 				pnSessionSetVar('errormsg', _MODARGSERROR);
! 				return false;
! 			}
! 			//only do this if it isn't the last.
! 				$sql = "SELECT MAX($postboardcolumn[$itemorderfield]) FROM $postboardtable";
! 				$result = $dbconn->Execute($sql);
! 				list($maxcat) = $result->fields;
! 				
! 				if ($maxcat <> $itemorder) {
! 					$sql = "UPDATE $postboardtable
! 					SET $postboardcolumn[$itemorderfield] = " . (pnVarPrepForStore($itemorder)). "
! 					WHERE $postboardcolumn[$itemorderfield] = " . (pnVarPrepForStore($itemorder) + 1);
! 					$dbconn->Execute($sql);
! 				
! 					if ($dbconn->ErrorNo() != 0) {
! 						pnSessionSetVar('errormsg', $dbconn->ErrorMsg());
! 						return false;
! 					}
! 					$rowschanged = $dbconn->Affected_Rows();
! 				
! 					$sql = "UPDATE $postboardtable
! 						SET $postboardcolumn[$itemorderfield] = " . (pnVarPrepForStore($itemorder)+1) . "
! 						WHERE $postboardcolumn[$itemidfield] = " . pnVarPrepForStore($itemid);
! 					$dbconn->Execute($sql);
! 					if ($dbconn->ErrorNo() != 0) {
! 						pnSessionSetVar('errormsg', $dbconn->ErrorMsg().$sql);
! 						return false;
! 					}
! 				}
! 		break;
! 		
! 		case 'INSERT':
! 			$sql = "UPDATE $postboardtable
! 				SET $postboardcolumn[$itemorderfield] = ($postboardcolumn[$itemorderfield] + 1)
! 				WHERE $postboardcolumn[$itemorderfield] >= " . pnVarPrepForStore($itemorder);
! 			$dbconn->Execute($sql);
! 			if ($dbconn->ErrorNo() != 0) {
! 				pnSessionSetVar('errormsg', $dbconn->ErrorMsg().$sql);
! 				return false;
! 			}
! 		break;
! 	}
!     // Let the calling process know that we have finished successfully
!     return true;
! 	
! }
! 
! // *************** End Common Functions *********************************
! 
! // *************** Begin Censored word Functions ************************
  function postboard_adminapi_deleteword($args) {
  	// Delete a forum
***************
*** 42,46 ****
      // avoid potential security holes or just too much wasted processing.
  
!     if (!pnSecAuthAction(0, 'PostBoard::Words', "::", ACCESS_DELETE)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
--- 181,185 ----
      // avoid potential security holes or just too much wasted processing.
  
!     if (!pnSecAuthAction(0, 'postboard::words', "::", ACCESS_DELETE)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
***************
*** 74,78 ****
  
  function postboard_adminapi_editword($args) {
! 	if (!pnSecAuthAction(0, 'PostBoard::Words', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 213,217 ----
  
  function postboard_adminapi_editword($args) {
! 	if (!pnSecAuthAction(0, 'postboard::words', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 105,109 ****
  
  function postboard_adminapi_addword($args) {
! 	if (!pnSecAuthAction(0, 'PostBoard::Words', '::', ACCESS_ADD)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 244,248 ----
  
  function postboard_adminapi_addword($args) {
! 	if (!pnSecAuthAction(0, 'postboard::words', '::', ACCESS_ADD)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 132,138 ****
  	pnRedirect(pnModURL('postboard','admin','managewords'));
  }
! // *************** End Cencsored Word Functions *************************
  
! // *************** Begin Forum Functions ********************************
  function postboard_adminapi_deleteforum($args) {
  	// Delete a forum
--- 271,277 ----
  	pnRedirect(pnModURL('postboard','admin','managewords'));
  }
! // *************** End Cencsored word Functions *************************
  
! // *************** Begin forum Functions ********************************
  function postboard_adminapi_deleteforum($args) {
  	// Delete a forum
***************
*** 149,153 ****
      // avoid potential security holes or just too much wasted processing.
  
!     if (!pnSecAuthAction(0, 'PostBoard::Forums', "::", ACCESS_DELETE)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
--- 288,292 ----
      // avoid potential security holes or just too much wasted processing.
  
!     if (!pnSecAuthAction(0, 'postboard::forums', "::", ACCESS_DELETE)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
***************
*** 181,185 ****
  
  function postboard_adminapi_editforum($args) {
! 	if (!pnSecAuthAction(0, 'PostBoard::Forums', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 320,324 ----
  
  function postboard_adminapi_editforum($args) {
! 	if (!pnSecAuthAction(0, 'postboard::forums', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 215,219 ****
  
  function postboard_adminapi_addforum($args) {
! 	if (!pnSecAuthAction(0, 'PostBoard::Forums', '::', ACCESS_ADD)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 354,358 ----
  
  function postboard_adminapi_addforum($args) {
! 	if (!pnSecAuthAction(0, 'postboard::forums', '::', ACCESS_ADD)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 222,227 ****
  	extract($args);
  	// Prepare data for insert:
! 	list($pforum_name,$pforum_desc,$pforum_parent,$pforum_cat_id) = 
! 		pnVarPrepForStore($forum_name,$forum_desc,$forum_parent,$forum_cat_id);
  	// get DB information
      list($dbconn) = pnDBGetConn();
--- 361,366 ----
  	extract($args);
  	// Prepare data for insert:
! 	list($pforum_name,$pforum_desc,$pforum_parent,$pforum_cat_id,$pforum_order) = 
! 		pnVarPrepForStore($forum_name,$forum_desc,$forum_parent,$forum_cat_id,$forum_order);
  	// get DB information
      list($dbconn) = pnDBGetConn();
***************
*** 231,236 ****
  	
  	$sql="INSERT INTO $postboardtable ($postboardcolumn[forum_name],$postboardcolumn[forum_desc],
! 									$postboardcolumn[forum_parent],$postboardcolumn[forum_cat_id])
! 								VALUES ('$pforum_name','$pforum_desc','$pforum_parent','$pforum_cat_id')";
  				
  	$dbconn->Execute($sql);
--- 370,377 ----
  	
  	$sql="INSERT INTO $postboardtable ($postboardcolumn[forum_name],$postboardcolumn[forum_desc],
! 									$postboardcolumn[forum_parent],$postboardcolumn[forum_cat_id],
! 									$postboardcolumn[forum_topics],$postboardcolumn[forum_posts],
! 									$postboardcolumn[forum_order])
! 								VALUES ('$pforum_name','$pforum_desc','$pforum_parent','$pforum_cat_id',0,0,'$pforum_order')";
  				
  	$dbconn->Execute($sql);
***************
*** 243,254 ****
  	pnRedirect(pnModURL('postboard','admin','manageforums'));
  }
! // ***************** End Forum Functions ********************************
  
! // *************** Begin Category Functions *****************************
! function postboard_adminapi_updatecatorder($args) {
  	extract($args);
  	
  	// security access
!     if (!pnSecAuthAction(0, 'PostBoard::Categories', "::", ACCESS_EDIT)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
--- 384,398 ----
  	pnRedirect(pnModURL('postboard','admin','manageforums'));
  }
! // ***************** End forum Functions ********************************
  
! // *************** Begin category Functions *****************************
! //
! // Modify this function to handle any orders, not just categories
! //
! function postboard_adminapi_updatecatorder123($args) {
  	extract($args);
  	
  	// security access
!     if (!pnSecAuthAction(0, 'postboard::categories', "::", ACCESS_EDIT)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
***************
*** 371,386 ****
      }
  
!     // Security check - important to do this as early on as possible to 
!     // avoid potential security holes or just too much wasted processing.
!     // However, in this case we had to wait until we could obtain the item
!     // name to complete the instance information so this is the first
!     // chance we get to do the check
! 
!     // Note that at this stage we have two sets of item information, the
!     // pre-modification and the post-modification.  We need to check against
!     // both of these to ensure that whoever is doing the modification has
!     // suitable permissions to edit the item otherwise people can potentially
!     // edit areas to which they do not have suitable access
!     if (!pnSecAuthAction(0, 'PostBoard::Categories', "::", ACCESS_ADD)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
--- 515,519 ----
      }
  
!     if (!pnSecAuthAction(0, 'postboard::categories', "::", ACCESS_ADD)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
***************
*** 397,404 ****
      $nextID = $dbconn->GenId($postboardtable);
  
-     // Update the item - the formatting here is not mandatory, but it does
-     // make the SQL statement relatively easy to read.  Also, separating
-     // out the sql statement from the Execute() command allows for simpler
-     // debug operation if it is ever needed
  	$sql = "INSERT INTO $postboardtable (
  	    $postboardcolumn[cat_id],
--- 530,533 ----
***************
*** 418,429 ****
          return false;
      }
  
!     // Let the calling process know that we have finished successfully
!     return true;
  	
! }
  
- function postboard_adminapi_modifycategory($args) {
- 	// Modify a category
  }
  
--- 547,588 ----
          return false;
      }
+ 	// To see their results, we redirect them to the Manage category page:
+ 	pnRedirect(pnModURL('postboard', 'admin', 'managecategories'));
+ 	return true;
+ }
  
! function postboard_adminapi_editcategory($args) {
! 	extract($args);
! 	if (!isset($cat_title)){
! 		pnSessionSetVar('errormsg', _MODARGSERROR);
!         return false;
! 	}
! 	if (!pnSecAuthAction(0, 'postboard::categories', '$cat_title::', ACCESS_EDIT)) {
!         $output->Text(_PBNOAUTH);
!         return $output->GetOutput();
!     }
  	
! 	// Prepare data for insert:
! 	list($pcat_id,$pcat_title) = 
! 		pnVarPrepForStore($cat_id,$cat_title);
! 	// get DB information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
!     $postboardtable = $pntable['postboard_categories'];
!     $postboardcolumn = &$pntable['postboard_categories_column'];
! 	
! 	$sql = "UPDATE $postboardtable SET
!                     $postboardcolumn[cat_title]	= '$pcat_title'
! 					WHERE $postboardcolumn[cat_id]= '$pcat_id'";
! 			
! 	$dbconn->Execute($sql);
! 	if ($dbconn->ErrorNo() != 0) {
!         pnSessionSetVar('errormsg', _PBEDITCATFAILED."<br>SQL: ".$sql);
!         return false;
!     }
! 	// Addition was successful, redirect back to the manage forums
! 	// page so the new forum can be seen
! 	pnRedirect(pnModURL('postboard','admin','managecategories'));
  
  }
  
***************
*** 450,454 ****
      // suitable permissions to edit the item otherwise people can potentially
      // edit areas to which they do not have suitable access
!     if (!pnSecAuthAction(0, 'PostBoard::Categories', "::", ACCESS_DELETE)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
--- 609,613 ----
      // suitable permissions to edit the item otherwise people can potentially
      // edit areas to which they do not have suitable access
!     if (!pnSecAuthAction(0, 'postboard::categories', "::", ACCESS_DELETE)) {
          pnSessionSetVar('errormsg', _PBNOAUTH);
          return false;
***************
*** 460,466 ****
      $postboardcolumn = &$pntable['postboard_categories_column'];
  	
- 	
- 	
- 
      // Delete the category - the formatting here is not mandatory, but it does
      // make the SQL statement relatively easy to read.  Also, separating
--- 619,622 ----
***************
*** 479,486 ****
          return false;
      }
  
!     // Let the calling process know that we have finished successfully
!     return true;
  }
! // *************** End Category Functions *****************************
  ?>
--- 635,751 ----
          return false;
      }
+ 	// Deletion was successful, redirect back to the manage forums
+ 	// page so the new forum can be seen
+ 	pnRedirect(pnModURL('postboard','admin','managecategories'));
+ }
+ // *************** End category Functions *****************************
+ // *************** Begin Level Functions *****************************
+ function postboard_adminapi_deletelevel($args) {
+ 	// Delete a forum
+ 	extract($args);
+     // Argument check - make sure that all required arguments are present,
+     // if not then set an appropriate error message and return
  
!     if (!isset($level_id)) {
!         pnSessionSetVar('errormsg', _MODARGSERROR);
!         return false;
!     }
! 
!     // Security check - important to do this as early on as possible to 
!     // avoid potential security holes or just too much wasted processing.
! 
!     if (!pnSecAuthAction(0, 'postboard::levels', "::", ACCESS_DELETE)) {
!         pnSessionSetVar('errormsg', _PBNOAUTH);
!         return false;
!     }
!     
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
!     $postboardtable = $pntable['postboard_levels'];
!     $postboardcolumn = &$pntable['postboard_levels_column'];
! 
!     // Delete the forum - the formatting here is not mandatory, but it does
!     // make the SQL statement relatively easy to read.  Also, separating
!     // out the sql statement from the Execute() command allows for simpler
!     // debug operation if it is ever needed
! 	$sql = "DELETE FROM $postboardtable
! 			WHERE 
! 			$postboardcolumn[level_id] = " . pnVarPrepForStore($level_id);
! 
!     $dbconn->Execute($sql);
! 
!     // Check for an error with the database code, and if so set an
!     // appropriate error message and return
!     if ($dbconn->ErrorNo() != 0) {
!         pnSessionSetVar('errormsg', _PBDELETELEVELFAILED);
!         return false;
!     }
! 	// Addition was successful, redirect back to the manage forums
! 	// page so the new forum can be seen
! 	pnRedirect(pnModURL('postboard','admin','levels'));
  }
! 
! function postboard_adminapi_editlevel($args) {
! 	if (!pnSecAuthAction(0, 'postboard::levels', '::', ACCESS_EDIT)) {
!         $output->Text(_PBNOAUTH);
!         return $output->GetOutput();
!     }
! 
! 	extract($args);
! 	// Prepare data for insert:
! 	list($level_id,$level_title, $level_minposts, $level_maxposts, $level_special, $level_image) = 
! 		pnVarPrepForStore($level_id,$level_title, $level_minposts, $level_maxposts, $level_special, $level_image);
! 	// get DB information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
!     $postboardtable = $pntable['postboard_levels'];
!     $postboardcolumn = &$pntable['postboard_levels_column'];
! 	
! 	$sql = "UPDATE $postboardtable SET
!                     $postboardcolumn[level_title]	= '$level_title',
! 		    $postboardcolumn[level_minposts]	= '$level_minposts',
! 		    $postboardcolumn[level_maxposts]	= '$level_maxposts',
! 		    $postboardcolumn[level_special]	= '$level_special',
! 		    $postboardcolumn[level_image]	= '$level_image'
! 		    WHERE $postboardcolumn[level_id]= '$level_id'";
! 			
! 	$dbconn->Execute($sql);
! 	if ($dbconn->ErrorNo() != 0) {
!         pnSessionSetVar('errormsg', _PBEDITLEVELFAILED . $dbconn->ErrorMsg());
!         return false;
!     }
! 	// Addition was successful, redirect back to the manage forums
! 	// page so the new forum can be seen
! 	pnRedirect(pnModURL('postboard','admin','levels'));
! }
! 
! function postboard_adminapi_addlevel($args) {
! 	if (!pnSecAuthAction(0, 'postboard::words', '::', ACCESS_ADD)) {
!         $output->Text(_PBNOAUTH);
!         return $output->GetOutput();
!     }
! 
! 	extract($args);
! 	// Prepare data for insert:
! 	list($pword,$preplacement) = 
! 		pnVarPrepForStore($word,$replacement);
! 	// get DB information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
!     $postboardtable = $pntable['postboard_words'];
!     $postboardcolumn = &$pntable['postboard_words_column'];
! 	
! 	$sql="INSERT INTO $postboardtable ($postboardcolumn[word],$postboardcolumn[replacement])
! 								VALUES ('$pword','$preplacement')";
! 				
! 	$dbconn->Execute($sql);
! 	if ($dbconn->ErrorNo() != 0) {
!         pnSessionSetVar('errormsg', _PBADDWORDFAILED."<br>SQL: ".$sql);
!         return false;
!     }
! 	// Addition was successful, redirect back to the manage forums
! 	// page so the new forum can be seen
! 	pnRedirect(pnModURL('postboard','admin','managewords'));
! }
! // *************** End Level Functions *****************************
  ?>

Index: pninit.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pninit.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pninit.php	3 Jul 2002 14:17:01 -0000	1.2
--- pninit.php	31 Jul 2002 13:09:23 -0000	1.3
***************
*** 1,10 ****
  <?php
  /********************************************************/
! /* PostBoard                                            */
  /* Version .,  see changes.txt for details              */
  /* By Marie Altobelli                                   */
  /* Development continued by                             */
  /*                                                      */
! /*  The PostBoard Team                                  */
  /* 	   Marie Altobelli									*/
  /*     Burke Azbill - burke@dimensionquest.com          */
--- 1,10 ----
  <?php
  /********************************************************/
! /* postboard                                            */
  /* Version .,  see changes.txt for details              */
  /* By Marie Altobelli                                   */
  /* Development continued by                             */
  /*                                                      */
! /*  The postboard Team                                  */
  /* 	   Marie Altobelli									*/
  /*     Burke Azbill - burke@dimensionquest.com          */
***************
*** 19,23 ****
  
  /**
!  * initialise the PostBoard module
   */
  function postboard_init()
--- 19,23 ----
  
  /**
!  * initialise the postboard module
   */
  function postboard_init()
***************
*** 188,193 ****
  		
      // Set up module variables
!     pnModSetVar('postboard', 'smilydir', '/modules/postboard/pnimages/smilies');
!     pnModSetVar('postboard', 'forumname', 'PostBoard Forum');
  	pnModSetVar('postboard', 'allow_avatar', 1);
  	pnModSetVar('postboard', 'use smilies', 1);
--- 188,193 ----
  		
      // Set up module variables
!     pnModSetVar('postboard', 'smilydir', '/modules/postboard/smilies');
!     pnModSetVar('postboard', 'forumname', 'postboard forum');
  	pnModSetVar('postboard', 'allow_avatar', 1);
  	pnModSetVar('postboard', 'use smilies', 1);
***************
*** 202,206 ****
  
  /**
!  * upgrade the PostBoard module from an old version
   */
  function postboard_upgrade($oldversion)
--- 202,206 ----
  
  /**
!  * upgrade the postboard module from an old version
   */
  function postboard_upgrade($oldversion)
***************
*** 221,225 ****
  
  /**
!  * delete the PostBoard module
   */
  function postboard_delete()
--- 221,225 ----
  
  /**
!  * delete the postboard module
   */
  function postboard_delete()
***************
*** 263,265 ****
      return true;
  }
! ?>
--- 263,265 ----
      return true;
  }
! ?>
\ No newline at end of file

Index: pntables.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pntables.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pntables.php	3 Jul 2002 14:17:01 -0000	1.2
--- pntables.php	31 Jul 2002 13:09:23 -0000	1.3
***************
*** 1,5 ****
  <?php
  /********************************************************/
! /* PostBoard                                            */
  /* Version .,  see changes.txt for details              */
  /* By Marie Altobelli                                   */
--- 1,5 ----
  <?php
  /********************************************************/
! /* postboard                                            */
  /* Version .,  see changes.txt for details              */
  /* By Marie Altobelli                                   */
***************
*** 36,40 ****
      // Set the column names.  Note that the array has been formatted
      // on-screen to be very easy to read by a user.
! 	// Name for PostBoard database entities
  	$pbprefix = pnConfigGetVar('prefix') . '_postboard';
  	
--- 36,40 ----
      // Set the column names.  Note that the array has been formatted
      // on-screen to be very easy to read by a user.
! 	// Name for postboard database entities
  	$pbprefix = pnConfigGetVar('prefix') . '_postboard';
  	

Index: pnuser.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pnuser.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pnuser.php	3 Jul 2002 14:17:01 -0000	1.2
--- pnuser.php	31 Jul 2002 13:09:23 -0000	1.3
***************
*** 45,49 ****
  
      // Security check
!     if (!pnSecAuthAction(0, 'PostBoard::', '::', ACCESS_READ)) {
          $output->Text(_POSTBOARDNOAUTH);
          return $output->GetText();
--- 45,49 ----
  
      // Security check
!     if (!pnSecAuthAction(0, 'postboard::', '::', ACCESS_READ)) {
          $output->Text(_POSTBOARDNOAUTH);
          return $output->GetText();
***************
*** 75,169 ****
      return $output->GetOutput();
  }
! 
! /**
!  * view items
!  */
! function template_user_view()
! {
!     // Create output object
!     $output = new pnHTML();
! 
!     // Add menu to output
!     $output->VerbatimInput();
!     $output->Text(template_usermenu());
!     $output->ParseInput();
! 
!     // Security check
!     if (!pnSecAuthAction(0, 'Templates::', '::', ACCESS_READ)) {
!         $output->Text(_TEMPLATENOAUTH);
!         return $output->GetText();
!     }
! 
!     // Load API
!     if (!pnModAPILoad('Template', 'user')) {
!         $output->Text(_LOADFAILED);
!         return $output->GetText();
!     }
! 
!     // Get items
!     $items = pnModAPIFunc('Template', 'user', 'getitems');
! 
!     if ($items == false) {
!         $output->Text(_TEMPLATEITEMFAILED);
!     }
! 
!     // Print items
!     foreach ($items as $item) {
!         
!         if (pnSecAuthAction(0, 'Templates::', "$item[name]::$item[tid]", ACCESS_READ)) {
!             $output->Link(pnModURL('Template',
!                                    'user',
!                                    'viewdetail',
!                                    array('tid' => $item['tid'])),
!                           pnVarPrepForDisplay($item['name']));
!             $output->Linebreak();
!         }
!     }
! 
!     return $output->GetText();
! }
! 
! /**
!  * view detailed item
!  */
! function template_user_viewdetail()
! {
!     // Get parameters
!     list($tid) = pnVarCleanFromInput('tid');
! 
!     // Create output object
!     $output = new pnHTML();
! 
!     // Add menu to output
!     $output->VerbatimInput();
!     $output->Text(template_usermenu());
!     $output->ParseInput();
! 
!     // Load API
!     if (!pnModAPILoad('Template', 'user')) {
!         $output->Text(_LOADFAILED);
!         return $output->GetText();
!     }
! 
!     // Get item
!     $item = pnModAPIFunc('Template',
!                           'user',
!                           'getitem',
!                           array('tid' => $tid));
! 
!     if ($item == false) {
!         $output->Text(_TEMPLATEITEMFAILED);
!     }
! 
!     // Display item
!     $output->Text(_TEMPLATENAME . ': ');
!     $output->Text(pnVarPrepForDisplay($item['name']));
!     $output->Linebreak(2);
!     $output->Text(_TEMPLATENUMBER . ': ');
!     $output->Text(pnVarPrepForDisplay($item['number']));
!     $output->Linebreak(2);
! 
!     return $output->GetText();
! }
! 
! ?>
\ No newline at end of file
--- 75,77 ----
      return $output->GetOutput();
  }
! ?>

Index: pnuserapi.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pnuserapi.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pnuserapi.php	3 Jul 2002 14:17:01 -0000	1.2
--- pnuserapi.php	31 Jul 2002 13:09:23 -0000	1.3
***************
*** 25,32 ****
  // ----------------------------------------------------------------------
  // Original Author of file: 
! // Purpose of file:  PostBoard user API
  // ----------------------------------------------------------------------
  
! // ****************** Begin Censor Words Functions *******************
  //******************************************
  // Get all forums for cat_id
--- 25,32 ----
  // ----------------------------------------------------------------------
  // Original Author of file: 
! // Purpose of file:  postboard user API
  // ----------------------------------------------------------------------
  
! // ****************** Begin Censor words Functions *******************
  //******************************************
  // Get all forums for cat_id
***************
*** 38,42 ****
  	
      // Security check
!     if (!pnSecAuthAction(0, 'PostBoard::', 'Words::', ACCESS_READ)) {
          return $items;
      }
--- 38,42 ----
  	
      // Security check
!     if (!pnSecAuthAction(0, 'postboard::', 'words::', ACCESS_READ)) {
          return $items;
      }
***************
*** 71,80 ****
  }
  
! // ****************** End Censor Words Functions *********************
  
! // ******************  Begin Forum Functions *************************
  /**
   *  Returns an array of form data for FormSelectMultiple
!  * Input $selectid to determine which Item Type to build
   * Possible Types: website, phone, address, email, contact
   */
--- 71,168 ----
  }
  
! function postboard_userapi_countwords() {
! // Database information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
!     $postboardtable = $pntable['postboard_words'];
!     $postboardcolumn = &$pntable['postboard_words_column'];
  
!     // Get items
!     $sql = "SELECT $postboardcolumn[word_id]
!             FROM $postboardtable";
! 			
!     $result = $dbconn->Execute($sql);
!     
!     if ($dbconn->ErrorNo() != 0) {
!         return false;
!     }
!     $countwords = $result->PO_RecordCount();
! 	$result->Close();
!     return $countwords;
! }
! 
! // ****************** End Censor words Functions *********************
! 
! // ******************  Begin forum Functions *************************
  /**
   *  Returns an array of form data for FormSelectMultiple
!  * Input $selectid to determine which item Type to build
!  */
! function postboard_userapi_orderforumselect($args) 
! {
! 	// create the return object to be inserted into the form
!     $output = array();
!    
!     // Security check
!     if (!pnSecAuthAction(0, 'postboard::', 'forums::', ACCESS_READ)) {
!         return $items;
!     }
! 	extract($args);
! 	if(!isset($selectid)){
! 		$selectid=0;
! 	}
! 
!     // Database information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
!     $postboardtable = $pntable['postboard_forums'];
!     $postboardcolumn = &$pntable['postboard_forums_column'];
! 
!     // Get items
!     $sql = "SELECT $postboardcolumn[forum_order],
!                    $postboardcolumn[forum_name],
! 				   $postboardcolumn[forum_id]
!             FROM $postboardtable";
! 
!     $result = $dbconn->Execute($sql);
! 
! 	if ($result === false) {
! 		PN_DBMsgError($dbconn, __FILE__, __LINE__, "Error accesing the database");
! 	//	return false;
! 	}
! 	
! 	// $selected determies the 'selected' value for the drop box
! 	$selected=0;
! 	// If a value is not sent via $selectid, then set 'selected' to 1
! 	// for the "TOP" to be default drop box value
! 	if(!isset($selectid)){
! 		$selected=1;
! 	}
! 	// Set the TOP header for the drop box
! 	$output[]=array('id'=>0,'selected'=>$selected,'name'=>pnVarPrepForDisplay(_PBCATTOP));
! 	for (; !$result->EOF; $result->MoveNext()) {
!      	list($forum_order, $forum_name, $forum_id) = $result->fields;
! 		if (pnSecAuthAction(0, 'postboard::', ":$forum_name:$forum_id", ACCESS_READ)) {
! 			$selected=0;
! 			if ($selectid==$forum_order){
! 				$selected=1;
! 			}
! 			$output[] = array('id' 		=> $forum_order,
!                              'selected' => $selected,
!                              'name' 	=> pnVarPrepForDisplay(_PBCATAFTER) . " " . $forum_name);
! 		}
! 	}
! 
!     // All successful database queries produce a result set, and that result
!     // set should be closed when it has been finished with
!     $result->Close();
! 	
!     // Return the items
!     return $output;
! }
! 
! /**
!  *  Returns an array of form data for FormSelectMultiple
!  * Input $selectid to determine which item Type to build
   * Possible Types: website, phone, address, email, contact
   */
***************
*** 85,89 ****
      extract($args);
      // Security check
!     if (!pnSecAuthAction(0, 'PostBoard::', 'Forums::', ACCESS_READ)) {
          return $items;
      }
--- 173,177 ----
      extract($args);
      // Security check
!     if (!pnSecAuthAction(0, 'postboard::', 'forums::', ACCESS_READ)) {
          return $items;
      }
***************
*** 120,124 ****
  			continue;
  		}
! 		if (pnSecAuthAction(0, 'PostBoard::', ":$forum_name:$forum_id", ACCESS_READ)) {
  			$selected=0;
  			if ($selectid==$forum_id){
--- 208,212 ----
  			continue;
  		}
! 		if (pnSecAuthAction(0, 'postboard::', ":$forum_name:$forum_id", ACCESS_READ)) {
  			$selected=0;
  			if ($selectid==$forum_id){
***************
*** 149,153 ****
  
      // Security check
!     if (!pnSecAuthAction(0, 'PostBoard::', 'Forums::', ACCESS_READ)) {
          return $items;
      }
--- 237,241 ----
  
      // Security check
!     if (!pnSecAuthAction(0, 'postboard::', 'forums::', ACCESS_READ)) {
          return $items;
      }
***************
*** 176,180 ****
      for (; !$result->EOF; $result->MoveNext()) {
          list($forum_id, $forum_name, $forum_order, $forum_cat_id, $forum_parent) = $result->fields;
!         if (pnSecAuthAction(0, 'PostBoard::', ":$forum_name:$forum_id", ACCESS_READ)) {
              $items[] = array('forum_id' => $forum_id,
                               'forum_name' => $forum_name,
--- 264,268 ----
      for (; !$result->EOF; $result->MoveNext()) {
          list($forum_id, $forum_name, $forum_order, $forum_cat_id, $forum_parent) = $result->fields;
!         if (pnSecAuthAction(0, 'postboard::', ":$forum_name:$forum_id", ACCESS_READ)) {
              $items[] = array('forum_id' => $forum_id,
                               'forum_name' => $forum_name,
***************
*** 198,202 ****
  	
      // Security check
!     if (!pnSecAuthAction(0, 'PostBoard::', 'Forums::', ACCESS_READ)) {
          return $items;
      }
--- 286,290 ----
  	
      // Security check
!     if (!pnSecAuthAction(0, 'postboard::', 'forums::', ACCESS_READ)) {
          return $items;
      }
***************
*** 209,214 ****
  		}
  	}
! 
!     // Database information
      list($dbconn) = pnDBGetConn();
      $pntable = pnDBGetTables();
--- 297,302 ----
  		}
  	}
! 	
! 	// Database information
      list($dbconn) = pnDBGetConn();
      $pntable = pnDBGetTables();
***************
*** 216,251 ****
      $postboardcolumn = &$pntable['postboard_forums_column'];
  
!     // Get items
!     $sql = "SELECT $postboardcolumn[forum_id],
!                    $postboardcolumn[forum_name],
! 				   $postboardcolumn[forum_desc],
!                    $postboardcolumn[forum_order],
! 				   $postboardcolumn[forum_cat_id],
! 				   $postboardcolumn[forum_parent]
!             FROM $postboardtable ";
! 			if ($cat_id>0){
! 				$sql=$sql." WHERE $postboardcolumn[forum_cat_id]='".$cat_id."' ";
  			}
!             $sql=$sql." ORDER BY $postboardcolumn[forum_order]";
! 						
!     $result = $dbconn->Execute($sql);
! 
!     if ($dbconn->ErrorNo() != 0) {
!         return "ERROR<br>".$sql;
!     }
  
!     // Put items into result array
!     for (; !$result->EOF; $result->MoveNext()) {
!         list($forum_id, $forum_name, $forum_desc, $forum_order, $forum_cat_id, $forum_parent) = $result->fields;
!         if (pnSecAuthAction(0, 'PostBoard::', ":$forum_name:$forum_id", ACCESS_READ)) {
!             $items[] = array('forum_id' => $forum_id,
!                              'forum_name' => $forum_name,
! 							 'forum_desc' => $forum_desc,
!                              'forum_order' => $forum_order,
! 							 'forum_cat_id' => $forum_cat_id,
! 							 'forum_parent' => $forum_parent);
!         }
!     }
!     //$result->Close();
  
      return $items;
--- 304,342 ----
      $postboardcolumn = &$pntable['postboard_forums_column'];
  
! 		// Get items
! 		$sql = "SELECT $postboardcolumn[forum_id],
! 					   $postboardcolumn[forum_name],
! 					   $postboardcolumn[forum_desc],
! 					   $postboardcolumn[forum_topics],
! 					   $postboardcolumn[forum_posts],
! 					   $postboardcolumn[forum_order],
! 					   $postboardcolumn[forum_cat_id],
! 					   $postboardcolumn[forum_parent] 
! 				 FROM  $postboardtable 
! 				 WHERE $postboardcolumn[forum_cat_id]=".$cat_id." 
! 				 ORDER BY $postboardcolumn[forum_order]";
! 		
! 		$result = $dbconn->Execute($sql);
! 		
! 		if ($dbconn->ErrorNo() != 0) {
! 			return "ERROR:<br>".$sql;
! 		}
! 	
! 		// Put items into result array
! 		for (; !$result->EOF; $result->MoveNext()) {
! 			list($forum_id, $forum_name, $forum_desc, $forum_topics, $forum_posts, $forum_order, $forum_cat_id, $forum_parent) = $result->fields;
! 			if (pnSecAuthAction(0, 'postboard::', ":$forum_name:$forum_id", ACCESS_READ)) {
! 				$items[] = array('forum_id' 	=> $forum_id,
! 								 'forum_name' 	=> $forum_name,
! 								 'forum_desc' 	=> $forum_desc,
! 								 'forum_topics' => $forum_topics,
! 								 'forum_posts' 	=> $forum_posts,
! 								 'forum_order' 	=> $forum_order,
! 								 'forum_cat_id' => $forum_cat_id,
! 								 'forum_parent' => $forum_parent);
  			}
! 		}
  
!     $result->Close();
  
      return $items;
***************
*** 264,268 ****
  	}
  
- 
  // Database information
      list($dbconn) = pnDBGetConn();
--- 355,358 ----
***************
*** 284,301 ****
      }
      $countforums = $result->PO_RecordCount();
      return $countforums;
  }
! // ********************  End Forum Functions ****************************
  
  
  
! // ******************  Begin Category Functions *************************
  
  /**
   *  Returns an array of form data for FormSelectMultiple
!  * Input $selectid to determine which Item Type to build
!  * Possible Types: website, phone, address, email, contact
   */
! function postboard_userapi_buildcategoryselect($selectid=0) 
  {
  	// create the return object to be inserted into the form
--- 374,391 ----
      }
      $countforums = $result->PO_RecordCount();
+ 	$result->Close();
      return $countforums;
  }
! // ********************  End forum Functions ****************************
  
  
  
! // ******************  Begin category Functions *************************
  
  /**
   *  Returns an array of form data for FormSelectMultiple
!  * Input $selectid to determine which item Type to build
   */
! function postboard_userapi_ordercategoryselect($args) 
  {
  	// create the return object to be inserted into the form
***************
*** 303,310 ****
     
      // Security check
!     if (!pnSecAuthAction(0, 'PostBoard::', 'Categories::', ACCESS_READ)) {
          return $items;
      }
! 	
      // Database information
      list($dbconn) = pnDBGetConn();
--- 393,404 ----
     
      // Security check
!     if (!pnSecAuthAction(0, 'postboard::', 'categories::', ACCESS_READ)) {
          return $items;
      }
! 	extract($args);
! 	if(!isset($selectid)){
! 		$selectid=0;
! 	}
! 
      // Database information
      list($dbconn) = pnDBGetConn();
***************
*** 314,318 ****
  
      // Get items
!     $sql = "SELECT $postboardcolumn[cat_id],
                     $postboardcolumn[cat_title]
              FROM $postboardtable";
--- 408,412 ----
  
      // Get items
!     $sql = "SELECT $postboardcolumn[cat_order],
                     $postboardcolumn[cat_title]
              FROM $postboardtable";
***************
*** 326,339 ****
  	
  	// $selected determies the 'selected' value for the drop box
! 	//$selected=0;
  	// If a value is not sent via $selectid, then set 'selected' to 1
! 	// for the "Choose Type" to be default drop box value
! 	//if(!isset($selectid)){
! 	//	$selected=1;
! 	//}
! 	//$output[]=array('id'=>0,'selected'=>$selected,'name'=>_PBCATEGORIES);
  	for (; !$result->EOF; $result->MoveNext()) {
       	list($cat_id, $cat_title) = $result->fields;
! 		//if (pnSecAuthAction(0, 'PostBoard::', ":$cat_title:$cat_id", ACCESS_READ)) {
  			$selected=0;
  			if ($selectid==$cat_id){
--- 420,491 ----
  	
  	// $selected determies the 'selected' value for the drop box
! 	$selected=0;
  	// If a value is not sent via $selectid, then set 'selected' to 1
! 	// for the "TOP" to be default drop box value
! 	if(!isset($selectid)){
! 		$selected=1;
! 	}
! 	// Set the TOP header for the drop box
! 	$output[]=array('id'=>0,'selected'=>$selected,'name'=>pnVarPrepForDisplay(_PBCATTOP));
! 	for (; !$result->EOF; $result->MoveNext()) {
!      	list($cat_order, $cat_title) = $result->fields;
! 		if (pnSecAuthAction(0, 'postboard::', ":$cat_title:$cat_id", ACCESS_READ)) {
! 			$selected=0;
! 			if ($selectid==$cat_order){
! 				$selected=1;
! 			}
! 			$output[] = array('id' 		=> $cat_order,
!                              'selected' => $selected,
!                              'name' 	=> pnVarPrepForDisplay(_PBCATAFTER) . " " . $cat_title);
! 		}
! 	}
! 
!     // All successful database queries produce a result set, and that result
!     // set should be closed when it has been finished with
!     $result->Close();
! 	
!     // Return the items
!     return $output;
! }
! 
! /**
!  *  Returns an array of form data for FormSelectMultiple
!  * Input $selectid to determine which item Type to build
!  */
! function postboard_userapi_buildcategoryselect($args) 
! {
! 	// create the return object to be inserted into the form
!     $output = array();
!    
!     // Security check
!     if (!pnSecAuthAction(0, 'postboard::', 'categories::', ACCESS_READ)) {
!         return $items;
!     }
! 	extract($args);
! 	if(!isset($selectid)){
! 		$selectid=0;
! 	}
! 
!     // Database information
!     list($dbconn) = pnDBGetConn();
!     $pntable = pnDBGetTables();
!     $postboardtable = $pntable['postboard_categories'];
!     $postboardcolumn = &$pntable['postboard_categories_column'];
! 
!     // Get items
!     $sql = "SELECT $postboardcolumn[cat_id],
!                    $postboardcolumn[cat_title]
!             FROM $postboardtable";
! 
!     $result = $dbconn->Execute($sql);
! 
! 	if ($result === false) {
! 		PN_DBMsgError($dbconn, __FILE__, __LINE__, "Error accesing the database");
! 		return false;
! 	}
! 	
  	for (; !$result->EOF; $result->MoveNext()) {
       	list($cat_id, $cat_title) = $result->fields;
! 		if (pnSecAuthAction(0, 'postboard::', ":$cat_title:$cat_id", ACCESS_READ)) {
  			$selected=0;
  			if ($selectid==$cat_id){
***************
*** 343,347 ****
                               'selected' => $selected,
                               'name' 	=> $cat_title);
! 		//}
  	}
  
--- 495,499 ----
                               'selected' => $selected,
                               'name' 	=> $cat_title);
! 		}
  	}
  
***************
*** 354,359 ****
  }
  
! function postboard_userapi_getcategory($args) {
! extract($args);
  	if (!isset($cat_id)){
  		return false;
--- 506,514 ----
  }
  
! /*
!  *
!  */
! function postboard_userapi_getcategory($cat_id) {
! //extract($args);
  	if (!isset($cat_id)){
  		return false;
***************
*** 363,367 ****
  
      // Security check
!     if (!pnSecAuthAction(0, 'PostBoard::', 'Categories::', ACCESS_READ)) {
          return $items;
      }
--- 518,522 ----
  
      // Security check
!     if (!pnSecAuthAction(0, 'postboard::', 'categories::', ACCESS_READ)) {
          return $items;
      }
***************
*** 388,392 ****
      for (; !$result->EOF; $result->MoveNext()) {
          list($cat_id, $cat_title, $cat_order) = $result->fields;
!         if (pnSecAuthAction(0, 'PostBoard::', ":$cat_title:$cat_id", ACCESS_READ)) {
              $items[] = array('cat_id' => $cat_id,
                               'cat_title' => $cat_title,
--- 543,547 ----
      for (; !$result->EOF; $result->MoveNext()) {
          list($cat_id, $cat_title, $cat_order) = $result->fields;
!         if (pnSecAuthAction(0, 'postboard::', ":$cat_title:$cat_id", ACCESS_READ)) {
          

Directory filter : [ all ] / postnuke_modules / postboard [ 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