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

Date Directory [filter] File(s) [view] Author [filter]
30 Jul 2002 16:40:52postnuke_modules/postboard/pnincludespbacategories.php,1.2,1.3 pbaforums.php,1.2,1.3 pbawords.php,1.2,1.3Burke
 Index: pbacategories.php

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

Modified Files:
	pbacategories.php pbaforums.php pbawords.php 
Log Message:



Index: pbacategories.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pnincludes/pbacategories.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pbacategories.php	3 Jul 2002 14:17:40 -0000	1.2
--- pbacategories.php	30 Jul 2002 16:40:50 -0000	1.3
***************
*** 1,98 ****
  <?php
! 
! /**
!  * add new category
!  * This is a standard function that is called whenever an administrator
!  * wishes to create a new module category
!  */
! function postboard_admin_newcategory()
! {  //this function shows the form to get category information.
! 	
!     // Create output object - this object will store all of our output so that
!     // we can return it easily when required
!     $output = new pnHTML();
! 
!     // Security check - important to do this as early as possible to avoid
!     // potential security holes or just too much wasted processing
!     if (!pnSecAuthAction(0, 'PostBoard::', 'Categories::', ACCESS_ADD)) {
!         $output->Text(_PBNOAUTH);
!         return $output->GetOutput();
!     }
! 
! 	//some layout shortcut variables.
!     $ot = '';
! 	$column1 = '<tr><td width="30%" class="pn-normal">';
! 	$column2 = '</td><td width="70%" class="pn-normal">';
! 	$column3 = '</td></tr>';
! 	
! 	// 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);
! 	
!     // Title - putting a title at the head of each page reminds the user what
!     // they are doing
! 	$ot .= $output->LineBreak(2);
! 
!     // Title - putting a title at the head of each page reminds the user what
!     // they are doing
!     $ot .= $output->Title(_PBNEWCATEGORY);
! 
!     // Start form - note the use of pnModURL() to create the recipient URL of
!     // this form.  All URLs should be generated through pnModURL() to ensure
!     // compatibility with future versions of PostNuke
!     $ot .= $output->FormStart(pnModURL('postboard', 'admin', 'addcategory'));
! 
!     // Add an authorisation ID - this adds a hidden field in the form that
!     // contains an authorisation ID.  The authorisation ID is very important in
!     // preventing certain attacks on the website
!     $ot .= $output->FormHidden('authid', pnSecGenAuthKey());
! 
!     // Start the table that holds the information to be input.  Note how each
!     // item in the form is kept logically separate in the code; this helps to
!     // see which part of the code is responsible for the display of each item,
!     // and helps with future modifications
!     $ot .= $output->TableStart();
! 
!     // Name
!     $ot .= $column1 . $output->Text(pnVarPrepForDisplay(_PBCATNAME));
!     $ot .= $column2 . $output->FormText('cat_title', '', 40, 100);
! 	$ot .= $column3;
! 
!     // order
! 	if (!pnModAPILoad('postboard', 'user')) {
!         pnSessionSetVar('errormsg', _LOADFAILED);
!         return $output->GetOutput();
!     }
! 
!     // The API function is called.
!     $categories = pnModAPIFunc('postboard',
!                         'user',
!                         'getcategories');
! 	
! 	$catarray = array();
! 	$catarray[] = array('id'=>0, 'name'=>pnVarPrepForDisplay(_PBCATTOP));
! 	foreach($categories as $category) {
! 		$catarray[] = array('id'=>$category['cat_order'], 'name'=>pnVarPrepForDisplay(_PBCATAFTER) . " " . $category['cat_title']);
! 	}
! 	$ot .= $column1 . $output->Text(pnVarPrepForDisplay(_PBCATORDER));
! 	$ot .= $column2 . $output->FormSelectMultiple('cat_order', $catarray, 0, 1);
! 	$ot .= $column3;
! 
!     $ot .= $output->TableEnd();
! 
!     // End form
!     $ot .= $output->FormSubmit(_PBNEWCATEGORY);
!     $ot .= $output->FormEnd();
! 	
! 	$output->SetOutputMode(_PNH_KEEPOUTPUT);
! 	$output->SetInputMode(_PNH_VERBATIMINPUT);
! 	$output->Text($ot);
! 	
! 	// Return the output that has been generated by this function
!     return $output->GetOutput();
! }
  
  /**
--- 1,20 ----
  <?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                  */
! /********************************************************/
  
  /**
***************
*** 108,114 ****
      // from other places such as the environment is not allowed, as that makes
      // assumptions that will not hold in future versions of PostNuke
! 	// Added $cat_action to process category modifications (Burke@dimensionquest.com)
!     list($cat_title, $cat_order, $cat_action) = pnVarCleanFromInput('cat_title',
!                                         'cat_order','cat_action');
  
      // Confirm authorisation code.  This checks that the form had a valid
--- 30,34 ----
      // from other places such as the environment is not allowed, as that makes
      // assumptions that will not hold in future versions of PostNuke
!     list($cat_title, $cat_order) = pnVarCleanFromInput('cat_title','cat_order');
  
      // Confirm authorisation code.  This checks that the form had a valid
***************
*** 116,125 ****
      // proceed no further as it is possible that this is an attempt at sending
      // in false data to the system
!     if (!pnSecConfirmAuthKey()) {
!         pnSessionSetVar('errormsg', _BADAUTHKEY);
!         pnRedirect(pnModURL('postboard', 'admin', 'view'));
!         return true;
      }
- 	
  	//translate the order to a new order
  		$cat_order = $cat_order + 1;
--- 36,52 ----
      // proceed no further as it is possible that this is an attempt at sending
      // in false data to the system
!     // Removed by Burke - This presents errors when users are re-directed back to the management
! 	// page by previous operations.  This functions properly in environments where a button is pushed
! 	// then a page is loaded and a confirmation is pushed, then check ConfirmAuthKey..
! 	// Workarounds?? send to: Burke@dimensionquest.com
! 	//if (!pnSecConfirmAuthKey()) {
!     //    pnSessionSetVar('errormsg', _BADAUTHKEY);
!     //    pnRedirect(pnModURL('postboard', 'admin', 'view'));
!     //    return true;
!     //}
! 	if (!pnSecAuthAction(0, 'postboard::categories', '::', ACCESS_ADD)) {
!         $output->Text(_PBNOAUTH);
!         return $output->GetOutput();
      }
  	//translate the order to a new order
  		$cat_order = $cat_order + 1;
***************
*** 130,184 ****
          return $output->GetOutput();
      }
- 	if (!$cat_action=='modify') {
- 		// If the action is not modify, then we're adding a new category
- 		//kick all following categories up one order.
- 		$reorder = pnModAPIFunc('postboard',
- 					'admin',
- 					'updatecatorder',
- 					array('cat_order' => $cat_order));
- 	
- 		if($reorder==false) {
- 			return false;
- 		}
  
!     	// The API function is called
!     	$cat_id = pnModAPIFunc('postboard',
!                         'admin',
!                         'createcategory',
!                         array('cat_title' => $cat_title,
!                               'cat_order' => $cat_order));
  
! 		// The return value of the function is checked here, and if the function
! 		// suceeded then an appropriate message is posted.  Note that if the
! 		// function did not succeed then the API function should have already
! 		// posted a failure message so no action is required
! 		if ($cat_id != false) {
! 			// Success
! 			pnSessionSetVar('statusmsg', _PBCATCREATED);
! 		}
! 	}else{
! 		// If the action IS modify, then just modify an existing category
! 		
  	}
!     // 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', 'main'));
! 	// To see their results, we redirect them to the Edit category page:
! 	pnRedirect(pnModURL('postboard', 'admin', 'editcategory'));
!     // Return
!     return true;
  }
  /**
!  * Edit/View Categories
   */
! function postboard_admin_editcategory()
  {
- 
      // 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::Categories', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 57,100 ----
          return $output->GetOutput();
      }
  
! 	// If the action is not modify, then we're adding a new category
! 	//kick all following categories up one order.
! 	$reorder = pnModAPIFunc('postboard',
! 				'admin',
! 				'updateorder',
! 				array('item'=>'CATEGORY','cat_order' => $cat_order));
  
! 	if($reorder==false) {
! 		return false;
  	}
! 
! 	// The API function is called
! 	$cat_id = pnModAPIFunc('postboard',
! 					'admin',
! 					'createcategory',
! 					array('cat_title' => $cat_title,
! 						  'cat_order' => $cat_order));
! 
! 	// The return value of the function is checked here, and if the function
! 	// suceeded then an appropriate message is posted.  Note that if the
! 	// function did not succeed then the API function should have already
! 	// posted a failure message so no action is required
! 	if ($cat_id === false) {
! 		return false;
! 	}
! 	return true;
  }
+ 
  /**
!  * Manage categories
!  *
   */
! function postboard_admin_managecategories()
  {
      // 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::categories', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 189,205 ****
      $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">';
! 	$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(_PBEDITCATEGORY);
! 
      // 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
--- 105,113 ----
      $output->SetInputMode(_PNH_VERBATIMINPUT);
      $output->Text(postboard_adminmenu());
!     	
!     // Title - putting a title at the head of each page reminds the user what
      // they are doing
! 	$output->Title(_PBEDITCATEGORY);
! 	
      // 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
***************
*** 218,350 ****
                            'user',
                            'getcategories');
  
      // Start output table
!     $ot .= $output->TableStart('',array(_PBCATNAME, _PBCATID, _PBMOVE, _PBFUNCTIONS),1);
  	
! 	$row = array();
!     foreach ($items as $item) {
!         if (pnSecAuthAction(0, 'PostBoard::Categories', "$item[cat_title]::$item[cat_id]", ACCESS_READ)) {
! 
!             // Options for the item.  Note that each item has the appropriate
!             // levels of authentication checked to ensure that it is suitable
!             // for display
! 			
! 			$move = array();
! 			if (pnSecAuthAction(0, 'PostBoard::Categories', "$item[cat_title]::$item[cat_id]", ACCESS_EDIT)) {
! 			$move [] = $output->URL(pnModURL('postboard',
! 										'admin',
! 										'movecategory',
! 										array('cat_id' => $item['cat_id'], 'direction' => 'UP', 'cat_order' => $item['cat_order'])),
! 										_MOVEUP);
! 			$move [] = $output->URL(pnModURL('postboard',
! 										'admin',
! 										'movecategory',
! 										array('cat_id' => $item['cat_id'], 'direction' => 'DOWN', 'cat_order' => $item['cat_order'])),
! 										_MOVEDOWN);
! 			$movetxt = join(' | ', $move);
! 			}
! 
!             $options = array();
!             if (pnSecAuthAction(0, 'PostBoard::Categories', "$item[cat_title]::$item[cat_id]", ACCESS_EDIT)) {
!                 $options[] = $output->URL(pnModURL('postboard',
!                                                    'admin',
!                                                    'modifycategory',
!                                                    array('cat_id' => $item['cat_id'])),
!                                           _EDIT);
!                 if (pnSecAuthAction(0, 'PostBoard::Category', "$item[cat_title]::$item[cat_id]", ACCESS_DELETE)) {
!                     $options[] = $output->URL(pnModURL('postboard',
!                                                        'admin',
!                                                        'deletecategory',
!                                                        array('cat_id' => $item['cat_id'])),
!                                               _DELETE);
!                 }
!             }
! 
!             $optionstxt = join(' | ', $options);
! 			$ot .= $start . $item['cat_title'] . $between . $item['cat_id'] . $between . $movetxt . $between . $optionstxt . $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 postboard_admin_modifycategory() {
! 	// modify a category
! 	list($cat_id, $confirmation) = pnVarCleanFromInput('cat_id', 'confirmation');
  	
! 	// Load API.  
!     if (!pnModAPILoad('postboard', 'user')) {
!         $output->Text(_LOADFAILED);
!         return $output->GetOutput();
!     }
! 
!     $item = pnModAPIFunc('postboard',
!                          'user',
!                          'getcategory',
!                          array('cat_id' => $cat_id));
! 
!     if ($item == false) {
!         $output->Text(_PBNOSUCHITEM);
!         return $output->GetOutput();
!     }
! 
!     // Security check - important to do this as early 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
!     if (!pnSecAuthAction(0, 'PostBoard::Categories', "$item[cat_title]::$cat_id", ACCESS_EDIT)) {
!         $output->Text(_PBNOAUTH);
!         return $output->GetOutput();
!     }
! 
!     // Confirm authorisation code.  This checks that the form had a valid
!     // authorisation code attached to it.  If it did not then the function will
!     // proceed no further as it is possible that this is an attempt at sending
!     // in false data to the system
!     if (!pnSecConfirmAuthKey()) {
!         pnSessionSetVar('errormsg', _BADAUTHKEY);
!         pnRedirect(pnModURL('postboard', 'admin', 'view'));
!         return true;
!     }
! 
!     // Load API.  All of the actual work for the deletion of the item is done
!     // within the API, so we need to load that in before before we can do
!     // anything.  If the API fails to load an appropriate error message is
!     // posted and the function returns
!     if (!pnModAPILoad('postboard', 'admin')) {
!         $output->Text(_LOADFAILED);
          return $output->GetOutput();
      }
  
!     // The API function is called.  Note that the name of the API function and
!     // the name of this function are identical, this helps a lot when
!     // programming more complex modules.  The arguments to the function are
!     // passed in as their own arguments array.
!     //
!     // The return value of the function is checked here, and if the function
!     // suceeded then an appropriate message is posted.  Note that if the
!     // function did not succeed then the API function should have already
!     // posted a failure message so no action is required
!     if (pnModAPIFunc('postboard',
!                      'admin',
!                      'deletecategory',
!                      array('cat_id' => $cat_id))) {
!         // Success
!         pnSessionSetVar('statusmsg', _PBCATEGORYDELETED);
!     }
! 
!     // 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', 'view'));
!     
!     // Return
!     return true;
  }
  
--- 126,315 ----
                            'user',
                            'getcategories');
+ 	extract($items);
  
      // Start output table
!     $output->TableStart('',array(_PBCATNAME, _PBMOVE, _PBFUNCTIONS),1);
  	
!       foreach($items as $item) {
!         if (pnSecAuthAction(0, 'postboard::categories', "$item[cat_title]::$item[cat_id]", ACCESS_READ)) {
! 			// Use the pnAPI to build the table Rows:
! 			$output->TableRowStart();
! 				//$output->SetOutputMode(_PNH_RETURNOUTPUT);
! 				$output->FormStart(pnModURL('postboard', 'admin', 'editdelcategory'));
! 				$output->FormHidden('authid', pnSecGenAuthKey());
! 				$output->FormHidden('cat_id', $item['cat_id']);
! 				$output->TableColStart(1,'left');
! 				$output->FormText('cat_title', $item['cat_title'], 30, 100);
! 				$output->TableColEnd();
! 				$output->TableColStart();
! 				$move = array();
! 				if (pnSecAuthAction(0, 'postboard::categories', "$item[cat_title]::$item[cat_id]", ACCESS_EDIT)) {
! 					$movetxt ="<a href='"
! 					.pnModURL('postboard','admin','movecategory',array('cat_id' => $item['cat_id'], 'direction' => 'UP', 'cat_order' => $item['cat_order']))."'>"._MOVEUP."</a>"
! 					." | <a href='"
! 					.pnModURL('postboard','admin','movecategory',array('cat_id' => $item['cat_id'], 'direction' => 'DOWN', 'cat_order' => $item['cat_order']))."'>"._MOVEDOWN."</a>";
! 					
! 					$output->Text($movetxt);
! 				}else{
! 					$output->Text("&nbsp");
! 				}
! 				$output->TableColEnd();
! 				$output->TableColStart();
! 				$output->Text('<input type="submit" name="save" id="save" value="'._PBSAVE.'"> <input type="submit" name="delete" id="delete" value="'._PBDELETE.'">');
! 				$output->TableColEnd();
! 				$output->FormEnd();
! 			$output->TableRowEnd();
! 		}	
      }
  
+ 	// Always have a blank line at bottom of table for additions
+ 	$ordersel_data = pnModAPIFunc('postboard',
+ 								'user',
+ 								'ordercategoryselect',
+ 								array('selectid'=>0));
+ 	$output->TableRowStart();
+ 		$output->FormStart(pnModURL('postboard', 'admin', 'addcategory'));
+ 		$output->FormHidden('authid', pnSecGenAuthKey());
+ 		$output->TableColStart(1,'left');
+ 		$output->FormText('cat_title', '', 30, 100);
+ 		$output->TableColEnd();
+ 		$output->TableColStart();
+ 		$output->FormSelectMultiple('cat_order', $ordersel_data);
+ 		$output->TableColEnd();
+ 		$output->TableColStart();
+ 		$output->Text('<input type="submit" name="submit" value="'._PBSAVE.'">');
+ 		$output->TableColEnd();
+ 		$output->FormEnd();
+ 	$output->TableRowEnd();
+ 	$output->TableRowStart();
+ 	$output->TableColStart(6,'center');
+ 	$output->Text("forum Count: ".pnModAPIFunc('postboard','user','countcats',0)."<br>");
+ 	$output->TableColEnd();
+ 	$output->TableRowEnd();
+ 	$output->TableRowStart();
+ 	$output->TableColStart(6,'left');
+ 	$todo="<strong>To do:</strong><br>"
+ 		."<strong>&middot;</strong> Modify Delete confirmation to include statistics<br>"
+ 		."<strong>&middot;</strong> <br>";
+ 	$output->Text($todo);
+ 	$output->TableColEnd();
+ 	$output->TableRowEnd();
+ 	$output->TableEnd();
      // Return the output that has been generated by this function
      return $output->GetOutput();
  }
  
! /**
!  * Edit/Delete a category
!  */
! function postboard_admin_editdelcategory($args)
! {
! 	// Don't forget to notify about the number of topics and posts that will also be deleted
!     $output = new pnHTML();
! 	$output->SetInputMode(_PNH_VERBATIMINPUT);
  	
! 	extract($args);
! 	list($save,$delete,$confirmation)=pnVarCleanFromInput('save','delete','confirmation');
! 	// Check security settings to be sure user is authorised to perform requested action:
! 	if(!empty($save)){
! 		$action="SAVE";
! 		if (!pnSecAuthAction(0, 'postboard::categories', '::', ACCESS_EDIT)) {
! 			$output->Text(_PBNOAUTH);
! 			return $output->GetOutput();
!     	}
! 	}else{
! 		$action="DELETE";
! 		if (!pnSecAuthAction(0, 'postboard::categories', '::', ACCESS_DELETE)) {
! 			$output->Text(_PBNOAUTH);
! 			return $output->GetOutput();
! 		}
! 		
! 	}
! 	if(empty($action)){
! 		$output->Text("action didn't get set!");
! 		return $output->GetOutput();
! 	}
! 	
! 	// We've checked security up above so let's get the admin API loaded now:	
! 	if (!pnModAPILoad('postboard', 'admin')) {
!         pnSessionSetVar('errormsg', _LOADFAILED);
          return $output->GetOutput();
      }
  
! 	// Cleanup the input
! 	list($cat_id,$cat_title) = 
! 	pnVarCleanFromInput('cat_id','cat_title');
! 	
! 	if($action=="SAVE"){ 
! 		if (strlen($cat_title)==0){
! 			$output->Text(_PBCATNAME." "._ISREQUIREDFIELD);
! 			return $output->GetOutput();
! 		}
! 		$result=pnModAPIFunc('postboard',
! 							'admin',
! 							'editcategory',
! 							array('cat_id'=>$cat_id,'cat_title'=>$cat_title));
! 			
! 		if ($result==false){
! 			// Something went wrong, notify the user
! 			$output->Text(_PBEDITCATFAILED.": ".$cat_title);
! 			return $output->GetOutput();
! 		}else{
! 			pnRedirect(pnModURL('postboard', 'admin', 'managecategories'));
! 		}
! 	}elseif($action=="DELETE"){
! 		if(empty($confirmation)){
! 			// No confirmation yet - display a suitable form to obtain confirmation
! 			// of this action from the user
! 	
! 			// 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);
! 	
! 			// Title - putting a title ad the head of each page reminds the user
! 			// what they are doing
! 			$output->Title(_PBDELETECAT.": ".$cat_title);
! 			
! 			// Insert code to show how much data will be deleted & ask for confirmation:
! 			$warntext=_PBCONFIRMWARNING.$cat_title."?";
! 			
! 			// Add confirmation to output.  Note that this uses a pnHTML helper
! 			// function to produce the requested confirmation in a standard
! 			// fashion.  This not only cuts down on code within the module but
! 			// allows it to be altered in future without the module developer
! 			// having to worry about it
! 			$output->Text('<center>');
! 			$output->TableStart('','',0,'50%');
! 			$output->TableRowStart();
! 			$output->TableColStart(1,'left');
! 			$output->ConfirmAction($warntext,
! 								   pnModURL('postboard','admin','editdelcategory'),
! 								   _CANCELDELETE,
! 								   pnModURL('postboard','admin','managecategories'),
! 								   array('cat_id' => $cat_id,'confirmation'=>true));
! 			$output->TableColEnd();
! 			$output->TableRowEnd();
! 			$output->TableEnd();
! 			$output->Text('</center>');
! 			// Return the output that has been generated by this function
! 			return $output->GetOutput();	
! 		}
! 		// Make very sure that the user has a valid authkey:
! 		if (!pnSecConfirmAuthKey()) {
! 			pnSessionSetVar('errormsg', _BADAUTHKEY);
! 			pnRedirect(pnModURL('postboard', 'admin', 'view'));
! 			return true;
! 		}
! 		// Since confirmation is not empty, go ahead with the requested action:
! 		$result=pnModAPIFunc('postboard','admin','deletecategory',array('cat_id'=>$cat_id));
! 			
! 		if ($result==false){
! 			// Something went wrong, notify the user
! 			$output->Text(_PBDELCATFAILED.": ".$cat_title);
! 			return $output->GetOutput();
! 		}
! 	}
  }
  
***************
*** 378,382 ****
      // complete the instance information so this is the first chance we get to
      // do the check
!     if (!pnSecAuthAction(0, 'PostBoard::Categories', "$item[cat_title]::$cat_id", ACCESS_DELETE)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 343,347 ----
      // complete the instance information so this is the first chance we get to
      // do the check
!     if (!pnSecAuthAction(0, 'postboard::categories', "$item[cat_title]::$cat_id", ACCESS_DELETE)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 398,402 ****
          $output->Title(_DELETECATEGORY);
  		
! 		// Determine the Forums, # of topics, and # of posts that will be affected
  		// Issue warning, detailing effects of Deletion
  		// IE: Deleting this catory will also delete #forums, #Topics, and #Posts
--- 363,367 ----
          $output->Title(_DELETECATEGORY);
  		
! 		// Determine the forums, # of topics, and # of posts that will be affected
  		// Issue warning, detailing effects of Deletion
  		// IE: Deleting this catory will also delete #forums, #Topics, and #Posts
***************
*** 485,490 ****
  	$reorder = pnModAPIFunc('postboard',
  					'admin',
! 					'updatecatorder',
! 					array('cat_order' => $cat_order, 'cat_id' => $cat_id, 'direction'=>$direction));
  	
  	if($reorder==false) {
--- 450,455 ----
  	$reorder = pnModAPIFunc('postboard',
  					'admin',
! 					'updateorder',
! 					array('item'=>'CATEGORY','cat_order' => $cat_order, 'cat_id' => $cat_id, 'direction'=>$direction));
  	
  	if($reorder==false) {
***************
*** 494,498 ****
  	// 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', 'editcategory'));
  
      // Return
--- 459,463 ----
  	// 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', 'managecategories'));
  
      // Return

Index: pbaforums.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pnincludes/pbaforums.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pbaforums.php	3 Jul 2002 14:17:40 -0000	1.2
--- pbaforums.php	30 Jul 2002 16:40:50 -0000	1.3
***************
*** 1,5 ****
  <?php
  /**
!  * Delete a Forum
   */
  function postboard_admin_editdelforum($args)
--- 1,23 ----
  <?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                  */
+ /********************************************************/
+ 
  /**
!  * Edit/Delete a forum
   */
  function postboard_admin_editdelforum($args)
***************
*** 13,17 ****
  	if(!empty($save)){
  		$action="SAVE";
! 		if (!pnSecAuthAction(0, 'PostBoard::Forums', '::', ACCESS_EDIT)) {
  			$output->Text(_PBNOAUTH);
  			return $output->GetOutput();
--- 31,35 ----
  	if(!empty($save)){
  		$action="SAVE";
! 		if (!pnSecAuthAction(0, 'postboard::forums', '::', ACCESS_EDIT)) {
  			$output->Text(_PBNOAUTH);
  			return $output->GetOutput();
***************
*** 19,23 ****
  	}else{
  		$action="DELETE";
! 		if (!pnSecAuthAction(0, 'PostBoard::Forums', '::', ACCESS_DELETE)) {
  			$output->Text(_PBNOAUTH);
  			return $output->GetOutput();
--- 37,41 ----
  	}else{
  		$action="DELETE";
! 		if (!pnSecAuthAction(0, 'postboard::forums', '::', ACCESS_DELETE)) {
  			$output->Text(_PBNOAUTH);
  			return $output->GetOutput();
***************
*** 37,41 ****
  
  	// Cleanup the input
! 	list($forum_id,$forum_name,$forum_desc,$forum_parent,$forum_cat_id) = pnVarCleanFromInput('forum_id','forumname','forumdesc','forumparent','forumcategory');
  	
  	if($action=="SAVE"){ 
--- 55,60 ----
  
  	// Cleanup the input
! 	list($forum_id,$forum_name,$forum_desc,$forum_parent,$forum_cat_id,$forum_topics,$forum_posts) = 
! 	pnVarCleanFromInput('forum_id','forumname','forumdesc','forumparent','forumcategory','forum_topics','forum_posts');
  	
  	if($action=="SAVE"){ 
***************
*** 66,73 ****
  			// Title - putting a title ad the head of each page reminds the user
  			// what they are doing
! 			$output->Title(_DELETEFORUM.": ".$forum_name);
  			
  			// Insert code to show how much data will be deleted & ask for confirmation:
! 			
  			
  			// Add confirmation to output.  Note that this uses a pnHTML helper
--- 85,92 ----
  			// Title - putting a title ad the head of each page reminds the user
  			// what they are doing
! 			$output->Title(_PBDELETEFORUM.": ".$forum_name);
  			
  			// Insert code to show how much data will be deleted & ask for confirmation:
! 			$warntext=_PBCONFIRMWARNING.$forum_name."?";
  			
  			// Add confirmation to output.  Note that this uses a pnHTML helper
***************
*** 80,84 ****
  			$output->TableRowStart();
  			$output->TableColStart(1,'left');
! 			$output->ConfirmAction(_CONFIRMDELETE.$forum_name,
  								   pnModURL('postboard','admin','editdelforum'),
  								   _CANCELDELETE,
--- 99,104 ----
  			$output->TableRowStart();
  			$output->TableColStart(1,'left');
! 			$output->Text(_PBDELETEWARNING."<br>".$forum_topics." Topics and ".$forum_posts." Posts.<br>");
! 			$output->ConfirmAction($warntext,
  								   pnModURL('postboard','admin','editdelforum'),
  								   _CANCELDELETE,
***************
*** 104,108 ****
  
  /**
!  * Add a Forum
   */
  function postboard_admin_addforum($args)
--- 124,128 ----
  
  /**
!  * Add a forum
   */
  function postboard_admin_addforum($args)
***************
*** 114,118 ****
  	$output->SetInputMode(_PNH_VERBATIMINPUT);
  	
! 	if (!pnSecAuthAction(0, 'PostBoard::Forums', '::', ACCESS_ADD)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 134,138 ----
  	$output->SetInputMode(_PNH_VERBATIMINPUT);
  	
! 	if (!pnSecAuthAction(0, 'postboard::forums', '::', ACCESS_ADD)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 124,128 ****
  	extract($args);
  	// Cleanup the input
! 	list($forum_name,$forum_desc,$forum_parent,$forum_cat_id) = pnVarCleanFromInput('newforumname','newforumdesc','newforumparent','newforumcategory');
  	
  	if (strlen($forum_name)==0){
--- 144,148 ----
  	extract($args);
  	// Cleanup the input
! 	list($forum_name,$forum_desc,$forum_parent,$forum_cat_id,$forum_order) = pnVarCleanFromInput('newforumname','newforumdesc','newforumparent','newforumcategory','newforumorder');
  	
  	if (strlen($forum_name)==0){
***************
*** 130,135 ****
  		return $output->GetOutput();
  	}
  	// We now have a forum name Let's 
! 	$result=pnModAPIFunc('postboard','admin','addforum',array('forum_name'=>$forum_name,'forum_desc'=>$forum_desc,'forum_parent'=>$forum_parent,'forum_cat_id'=>$forum_cat_id));
  		
  	if ($result==false){
--- 150,170 ----
  		return $output->GetOutput();
  	}
+ 	
+ 	//translate the order to a new order
+ 		$forum_order = $forum_order + 1;
+ 	
+ 	// If the action is not modify, then we're adding a new category
+ 	//kick all following categories up one order.
+ 	$reorder = pnModAPIFunc('postboard',
+ 				'admin',
+ 				'updateorder',
+ 				array('item'=>'FORUM','forum_order' => $forum_order));
+ 
+ 	if($reorder==false) {
+ 		return false;
+ 	}
+ 	
  	// We now have a forum name Let's 
! 	$result=pnModAPIFunc('postboard','admin','addforum',array('forum_name'=>$forum_name,'forum_desc'=>$forum_desc,'forum_parent'=>$forum_parent,'forum_cat_id'=>$forum_cat_id,'forum_order'=>$forum_order));
  		
  	if ($result==false){
***************
*** 142,146 ****
  
  /**
!  * Manage Forums
   */
  function postboard_admin_manageforums()
--- 177,181 ----
  
  /**
!  * Manage forums
   */
  function postboard_admin_manageforums()
***************
*** 150,154 ****
      $output = new pnHTML();
  
!     if (!pnSecAuthAction(0, 'PostBoard::Forums', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 185,189 ----
      $output = new pnHTML();
  
!     if (!pnSecAuthAction(0, 'postboard::forums', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 177,235 ****
      // obtained from the input and gets us the information on the appropriate
      // items.
!     $forums = pnModAPIFunc('postboard','user','getforums',0);	
! 	//extract($forums);
! 	//$output->Text($forums[0]);
! 	//foreach($forums as $forum){
! 	//	echo $forum[forum_name];
! 	//}
!     // Start output table
!     $output->TableStart('',array(_PBFORUMNAME, _PBFORUMDESC, _PBCATNAME, _PBMOVE, _PBFORUMPARENT, _PBFUNCTIONS),1);
  	
!       foreach($forums as $forum) {
!         if (pnSecAuthAction(0, 'PostBoard::Forums', "$forum[forum_name]::$forum[forum_id]", ACCESS_READ)) {
! 			//First off, let's build the category list with the correct category marked as selected:
! 			$categorysel_data = pnModAPIFunc('postboard','user','buildcategoryselect',$forum[forum_cat_id]);
! 			$forumparentsel_data = pnModAPIFunc('postboard','user','buildforumselect',
! 								array('selectid'=>$forum[forum_parent],'current_forum'=>$forum[forum_id]));		
! 			// Use the pnAPI to build the table Rows:
! 			$output->TableRowStart();
! 				//$output->SetOutputMode(_PNH_RETURNOUTPUT);
! 				$output->FormStart(pnModURL('postboard', 'admin', 'editdelforum'));
! 				$output->FormHidden('authid', pnSecGenAuthKey());
! 				$output->FormHidden('forum_id', $forum[forum_id]);
! 				$output->TableColStart(1,'left');
! 				$output->FormText('forumname', $forum[forum_name], 20, 50);
! 				$output->TableColEnd();
! 				$output->TableColStart();
! 				$output->FormTextArea('forumdesc', $forum[forum_desc], 2, 30);
! 				$output->TableColEnd();
! 				$output->TableColStart();
! 				$output->FormSelectMultiple('forumcategory', $categorysel_data);
! 				$output->TableColEnd();
! 				$output->TableColStart();
! 				$output->Text('<a href="#">Up</a>/<a href="#">Down</a>');
! 				$output->TableColEnd();
! 				$output->TableColStart();
! 				$output->FormSelectMultiple('forumparent', $forumparentsel_data);
! 				$output->TableColEnd();
! 				$output->TableColStart();
! 				$output->Text('<input type="submit" name="save" id="save" value="'._PBSAVE.'"> <input type="submit" name="delete" id="delete" value="'._PBDELETE.'">');
! 				$output->TableColEnd();
! 				$output->FormEnd();
! 			$output->TableRowEnd();
! 		}	
!     }
  
  	// Always have a blank line at bottom of table for additions
  	$forumsel_data = pnModAPIFunc('postboard','user','buildforumselect',array('selectid'=>0));
! 	$catsel_data = pnModAPIFunc('postboard','user','buildcategoryselect',0);
  	$output->TableRowStart();
  		$output->FormStart(pnModURL('postboard', 'admin', 'addforum'));
  		$output->FormHidden('authid', pnSecGenAuthKey());
! 		$output->TableColStart(1,'left');
! 		$output->FormText('newforumname', '', 20, 50);
  		$output->TableColEnd();
  		$output->TableColStart();
! 		$output->FormTextArea('newforumdesc', '', 2, 30);
  		$output->TableColEnd();
  		$output->TableColStart();
--- 212,290 ----
      // obtained from the input and gets us the information on the appropriate
      // items.
! 	$categories = pnModAPIFunc('postboard','user','getcategories');
! 	extract($categories);
! 	// Start output table
! 	$output->TableStart('',array(_PBFORUMNAME, _PBFORUMDESC, _PBCATNAME, _PBMOVE, _PBFORUMPARENT, _PBFUNCTIONS),1);	
  	
! 	foreach($categories as $category){	
! 		$forums = array();
  
+ 		$forums = pnModAPIFunc('postboard','user','getforums',$category[cat_id]);	
+ 		if(!is_array($forums)){
+ 			echo $forums;
+ 			return false;
+ 		}
+ 		
+ 		extract($forums);
+ 		
+ 		foreach($forums as $forum) {
+ 			if (pnSecAuthAction(0, 'postboard::forums', "$forum[forum_name]::$forum[forum_id]", ACCESS_READ)) {
+ 				//First off, let's build the category list with the correct category marked as selected:
+ 				$categorysel_data = pnModAPIFunc('postboard','user','buildcategoryselect',array('selectid'=>$forum[forum_cat_id]));
+ 				$forumparentsel_data = pnModAPIFunc('postboard','user','buildforumselect',
+ 									array('selectid'=>$forum[forum_parent],'current_forum'=>$forum[forum_id]));
+ 				$forumorder=$forum['forum_order'];		
+ 				// Use the pnAPI to build the table Rows:
+ 				$output->TableRowStart();
+ 					//$output->SetOutputMode(_PNH_RETURNOUTPUT);
+ 					$output->FormStart(pnModURL('postboard', 'admin', 'editdelforum'));
+ 					$output->FormHidden('authid', pnSecGenAuthKey());
+ 					$output->FormHidden('forum_id', $forum[forum_id]);
+ 					$output->FormHidden('forum_topics', $forum[forum_topics]);
+ 					$output->FormHidden('forum_posts', $forum[forum_posts]);
+ 					$output->TableColStart(1,'center');
+ 					$output->FormText('forumname', $forum[forum_name], 15, 50);
+ 					$output->TableColEnd();
+ 					$output->TableColStart();
+ 					$output->FormTextArea('forumdesc', $forum[forum_desc], 2, 20);
+ 					$output->TableColEnd();
+ 					$output->TableColStart();
+ 					$output->FormSelectMultiple('forumcategory', $categorysel_data);
+ 					$output->TableColEnd();
+ 					$output->TableColStart();
+ 					if (pnSecAuthAction(0, 'postboard::forums', "$forum[forum_name]::$forum[forum_id]", ACCESS_EDIT)) {
+ 						$movetxt ="<a href='".pnModURL('postboard','admin','moveforum',array('forum_id' => $forum['forum_id'], 'direction' => 'UP', 'forum_order' => $forumorder))
+ 						."'>"._MOVEUP."</a>"." | <a href='"
+ 						.pnModURL('postboard','admin','moveforum',array('forum_id' => $forum['forum_id'],'direction' => 'DOWN','forum_order' => $forumorder))
+ 						."'>"._MOVEDOWN."</a>";
+ 						
+ 						$output->Text($movetxt);
+ 					}else{
+ 						$output->Text("&nbsp");
+ 					}
+ 					$output->TableColEnd();
+ 					$output->TableColStart();
+ 					$output->FormSelectMultiple('forumparent', $forumparentsel_data);
+ 					$output->TableColEnd();
+ 					$output->TableColStart();
+ 					$output->Text('<input type="submit" name="save" id="save" value="'._PBSAVE.'"> <input type="submit" name="delete" id="delete" value="'._PBDELETE.'">');
+ 					$output->TableColEnd();
+ 					$output->FormEnd();
+ 				$output->TableRowEnd();
+ 			}	
+ 		}
+ 	} 
  	// Always have a blank line at bottom of table for additions
  	$forumsel_data = pnModAPIFunc('postboard','user','buildforumselect',array('selectid'=>0));
! 	$catsel_data = pnModAPIFunc('postboard','user','buildcategoryselect',array('selectid'=>0));
! 	$ordersel_data = pnModAPIFunc('postboard','user','orderforumselect',array('selectid'=>0));
  	$output->TableRowStart();
  		$output->FormStart(pnModURL('postboard', 'admin', 'addforum'));
  		$output->FormHidden('authid', pnSecGenAuthKey());
! 		$output->TableColStart(1,'center');
! 		$output->FormText('newforumname', '', 15, 50);
  		$output->TableColEnd();
  		$output->TableColStart();
! 		$output->FormTextArea('newforumdesc', '', 2, 20);
  		$output->TableColEnd();
  		$output->TableColStart();
***************
*** 237,241 ****
  		$output->TableColEnd();
  		$output->TableColStart();
! 		$output->Text("&nbsp;");
  		$output->TableColEnd();
  		$output->TableColStart();
--- 292,296 ----
  		$output->TableColEnd();
  		$output->TableColStart();
! 		$output->FormSelectMultiple('newforumorder', $ordersel_data);
  		$output->TableColEnd();
  		$output->TableColStart();
***************
*** 249,253 ****
  	$output->TableRowStart();
  	$output->TableColStart(6,'center');
! 	$output->Text("Forum Count: ".pnModAPIFunc('postboard','user','countforums',0)."<br>");
  	$output->TableColEnd();
  	$output->TableRowEnd();
--- 304,308 ----
  	$output->TableRowStart();
  	$output->TableColStart(6,'center');
! 	$output->Text("forum Count: ".pnModAPIFunc('postboard','user','countforums',0)."<br>");
  	$output->TableColEnd();
  	$output->TableRowEnd();
***************
*** 255,261 ****
  	$output->TableColStart(6,'left');
  	$todo="<strong>To do:</strong><br>"
- 		."<strong>&middot;</strong> Modify Delete confirmation to include statistics<br>"
- 		."<strong>&middot;</strong> Code the positioning links<br>"
- 		."<strong>&middot;</strong> Code the positioning dropdown for new forum<br>"
  		."<strong>&middot;</strong> <br>";
  	$output->Text($todo);
--- 310,313 ----
***************
*** 264,268 ****
--- 316,350 ----
  	$output->TableEnd();
      // Return the output that has been generated by this function
+ 	
      return $output->GetOutput();
+ }
+ function postboard_admin_moveforum() {
+ 	//extract($args);
+ 	$forum_id = pnVarCleanFromInput('forum_id');
+ 	$direction = pnVarCleanFromInput('direction');
+ 	$forum_order = pnVarCleanFromInput('forum_order');
+ 	
+ 	// Load API
+     if (!pnModAPILoad('postboard', 'admin')) {
+         pnSessionSetVar('errormsg', _LOADFAILED);
+         return $output->GetOutput();
+     }
+ 
+ 	//trade places with the previous category
+ 	$reorder = pnModAPIFunc('postboard',
+ 					'admin',
+ 					'updateorder',
+ 					array('item'=>'FORUM','forum_order' => $forum_order, 'forum_id' => $forum_id, 'direction'=>$direction));
+ 	
+ 	if($reorder==false) {
+ 		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', 'manageforums'));
+ 
+     // Return
+     return true;
  }
  ?>

Index: pbawords.php
===================================================================
RCS file: /home/cvsroot/postnuke_modules/postboard/pnincludes/pbawords.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** pbawords.php	3 Jul 2002 14:17:40 -0000	1.2
--- pbawords.php	30 Jul 2002 16:40:50 -0000	1.3
***************
*** 1,3 ****
--- 1,21 ----
  <?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                  */
+ /********************************************************/
+ 
  /**
   * Delete a word
***************
*** 13,17 ****
  	if(!empty($save)){
  		$action="SAVE";
! 		if (!pnSecAuthAction(0, 'PostBoard::Forums', '::', ACCESS_EDIT)) {
  			$output->Text(_PBNOAUTH);
  			return $output->GetOutput();
--- 31,35 ----
  	if(!empty($save)){
  		$action="SAVE";
! 		if (!pnSecAuthAction(0, 'postboard::words', '::', ACCESS_EDIT)) {
  			$output->Text(_PBNOAUTH);
  			return $output->GetOutput();
***************
*** 19,23 ****
  	}else{
  		$action="DELETE";
! 		if (!pnSecAuthAction(0, 'PostBoard::Forums', '::', ACCESS_DELETE)) {
  			$output->Text(_PBNOAUTH);
  			return $output->GetOutput();
--- 37,41 ----
  	}else{
  		$action="DELETE";
! 		if (!pnSecAuthAction(0, 'postboard::words', '::', ACCESS_DELETE)) {
  			$output->Text(_PBNOAUTH);
  			return $output->GetOutput();
***************
*** 37,55 ****
  
  	// Cleanup the input
! 	list($forum_id,$forum_name,$forum_desc,$forum_parent,$forum_cat_id) = pnVarCleanFromInput('forum_id','forumname','forumdesc','forumparent','forumcategory');
  	
  	if($action=="SAVE"){ 
  		if (strlen($forum_name)==0){
! 			$output->Text(_PBFORUMNAME." "._ISREQUIREDFIELD);
  			return $output->GetOutput();
  		}
! 		$result=pnModAPIFunc('postboard','admin','editforum',array('forum_id'=>$forum_id,'forum_name'=>$forum_name,'forum_desc'=>$forum_desc,'forum_parent'=>$forum_parent,'forum_cat_id'=>$forum_cat_id));
  			
  		if ($result==false){
  			// Something went wrong, notify the user
! 			$output->Text(_PBEDITFORUMFAILED.": ".$forum_name);
  			return $output->GetOutput();
  		}else{
! 			pnRedirect(pnModURL('postboard', 'admin', 'manageforums'));
  		}
  	}elseif($action=="DELETE"){
--- 55,73 ----
  
  	// Cleanup the input
! 	list($word_id,$word,$replacement) = pnVarCleanFromInput('word_id','word','replacement');
  	
  	if($action=="SAVE"){ 
  		if (strlen($forum_name)==0){
! 			$output->Text(_PBCENSORWORD." "._ISREQUIREDFIELD);
  			return $output->GetOutput();
  		}
! 		$result=pnModAPIFunc('postboard','admin','editword',array('word_id'=>$word_id,'word'=>$word,'replacement'=>$replacement));
  			
  		if ($result==false){
  			// Something went wrong, notify the user
! 			$output->Text(_PBEDITWORDFAILED.": ".$word);
  			return $output->GetOutput();
  		}else{
! 			pnRedirect(pnModURL('postboard', 'admin', 'managewords'));
  		}
  	}elseif($action=="DELETE"){
***************
*** 66,70 ****
  			// Title - putting a title ad the head of each page reminds the user
  			// what they are doing
! 			$output->Title(_DELETEFORUM.": ".$forum_name);
  			
  			// Insert code to show how much data will be deleted & ask for confirmation:
--- 84,88 ----
  			// Title - putting a title ad the head of each page reminds the user
  			// what they are doing
! 			$output->Title(_PBDELETECENSORWORD.": ".$word);
  			
  			// Insert code to show how much data will be deleted & ask for confirmation:
***************
*** 80,88 ****
  			$output->TableRowStart();
  			$output->TableColStart(1,'left');
! 			$output->ConfirmAction(_CONFIRMDELETE.$forum_name,
! 								   pnModURL('postboard','admin','editdelforum'),
  								   _CANCELDELETE,
! 								   pnModURL('postboard','admin','manageforums'),
! 								   array('forum_id' => $forum_id,'confirmation'=>true));
  			$output->TableColEnd();
  			$output->TableRowEnd();
--- 98,106 ----
  			$output->TableRowStart();
  			$output->TableColStart(1,'left');
! 			$output->ConfirmAction(_CONFIRMDELETE.$word,
! 								   pnModURL('postboard','admin','editdelword'),
  								   _CANCELDELETE,
! 								   pnModURL('postboard','admin','managewords'),
! 								   array('word_id' => $word_id,'confirmation'=>true));
  			$output->TableColEnd();
  			$output->TableRowEnd();
***************
*** 93,101 ****
  		}
  		// Since confirmation is not empty, go ahead with the requested action:
! 		$result=pnModAPIFunc('postboard','admin','deleteforum',array('forum_id'=>$forum_id));
  			
  		if ($result==false){
  			// Something went wrong, notify the user
! 			$output->Text(_PBDELFORUMFAILED.": ".$forum_name);
  			return $output->GetOutput();
  		}
--- 111,119 ----
  		}
  		// Since confirmation is not empty, go ahead with the requested action:
! 		$result=pnModAPIFunc('postboard','admin','deleteword',array('word_id'=>$word_id));
  			
  		if ($result==false){
  			// Something went wrong, notify the user
! 			$output->Text(_PBDELWORDFAILED.": ".$word);
  			return $output->GetOutput();
  		}
***************
*** 104,108 ****
  
  /**
!  * Add a Word
   */
  function postboard_admin_addword($args)
--- 122,126 ----
  
  /**
!  * Add a word
   */
  function postboard_admin_addword($args)
***************
*** 114,118 ****
  	$output->SetInputMode(_PNH_VERBATIMINPUT);
  	
! 	if (!pnSecAuthAction(0, 'PostBoard::Words', '::', ACCESS_ADD)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 132,136 ----
  	$output->SetInputMode(_PNH_VERBATIMINPUT);
  	
! 	if (!pnSecAuthAction(0, 'postboard::words', '::', ACCESS_ADD)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 142,146 ****
  
  /**
!  * Manage Words
   */
  function postboard_admin_managewords()
--- 160,164 ----
  
  /**
!  * Manage words
   */
  function postboard_admin_managewords()
***************
*** 150,154 ****
      $output = new pnHTML();
  
!     if (!pnSecAuthAction(0, 'PostBoard::Words', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
--- 168,172 ----
      $output = new pnHTML();
  
!     if (!pnSecAuthAction(0, 'postboard::words', '::', ACCESS_EDIT)) {
          $output->Text(_PBNOAUTH);
          return $output->GetOutput();
***************
*** 189,193 ****
  			$output->FormHidden('authid', pnSecGenAuthKey());
  			$output->FormHidden('word_id', $word[word_id]);
! 			$output->TableColStart(1,'left');
  			$output->FormText('word', $word[word], 20, 50);
  			$output->TableColEnd();
--- 207,211 ----
  			$output->FormHidden('authid', pnSecGenAuthKey());
  			$output->FormHidden('word_id', $word[word_id]);
! 			$output->TableColStart(1,'center');
  			$output->FormText('word', $word[word], 20, 50);
  			$output->TableColEnd();
***************
*** 206,210 ****
  		$output->FormStart(pnModURL('postboard', 'admin', 'addword'));
  		$output->FormHidden('authid', pnSecGenAuthKey());
! 		$output->TableColStart(1,'left');
  		$output->FormText('newword', '', 20, 50);
  		$output->TableColEnd();
--- 224,228 ----
  		$output->FormStart(pnModURL('postboard', 'admin', 'addword'));
  		$output->FormHidden('authid', pnSecGenAuthKey());
! 		$output->TableColStart(1,'center');
  		$output->FormText('newword', '', 20, 50);
  		$output->TableColEnd();
***************
*** 218,234 ****
  	$output->TableRowEnd();
  	$output->TableRowStart();
! 	$output->TableColStart(6,'center');
! 	$output->Text("Word Count: ".pnModAPIFunc('postboard','user','countwords',0)."<br>");
! 	$output->TableColEnd();
! 	$output->TableRowEnd();
! 	$output->TableRowStart();
! 	$output->TableColStart(6,'left');
! 	$todo="<strong>To do:</strong><br>"
! 		."<strong>&middot;</strong> <br>"
! 		."<strong>&middot;</strong> <br>"
! 		."<strong>&middot;</strong> <br>"
! 		."<strong>&middot;</strong> <br>";
! 	$output->Text($todo);
! 	$output->TableColEnd();
  	$output->TableRowEnd();
  	$output->TableEnd();
--- 236,242 ----
  	$output->TableRowEnd();
  	$output->TableRowStart();
! 		$output->TableColStart(6,'center');
! 		$output->Text(_PBWORDCOUNT.pnModAPIFunc('postboard','user','countwords',0)."<br>");
! 		$output->TableColEnd();
  	$output->TableRowEnd();
  	$output->TableEnd();


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