272 Part (Web server application) II: Developing Intranet Solutions . displayReorderMenu():

272 Part II: Developing Intranet Solutions . displayReorderMenu(): This method is used to display the category reordering Web form. It works as follows: It creates a template object to display the Web form on the browser. A category object called $catObj is created to get the list of available categories using the getCategories() method. The current order of categories is obtained using getHighestOrder(). Using a loop, the template tags are replaced to populate the Web form to show the categories and allow the user to change the category order. . updateOrders(): This method is used to update the order of the categories. It works as follows: First, it checks to see if the order information passed as a query parameter from the Web form has no duplicates. It uses array_unique() to return a list of unique elements in the query parameter $order, which stores the category order given by the user. The result of array_unique() is passed to count() function to count the number of elements in the array. If the count is smaller than the count of the $order array (with possible duplication), an alert message is shown and the method returns null. If $order is a unique list of category order, a category object called $catObj is created. It calls updateCategoryOrders() to update the category order per user-supplied information. A status message is displayed using showStatusMessage(). Because category ordering has changed, the navigation file needed by home.php (used in Chapter 7 to display intranet home for each user) is updated using generateCategoryNavigator(). . storeCategory(): This method is used to store a category in the database. It works as follows: A new category object called $catObj is created. The new category must have the required information: name, order, list of users who can publish, and list of users who can view documents to be published in the category. If any of this information is missing, an alert message is shown, and the method returns null. A parameter list, $params, is created with all the database fields for the category. addCategory() adds the new category. If the new category is added successfully, addCategoryPublishers() is called to add the publisher user list to the appropriate category database table, and addCategoryViewers() is called to add the viewer user

WordPress database error: [Table 'armadillowebhosting_com_-_jsp.wp_comments' doesn't exist]
SELECT * FROM wp_comments WHERE comment_post_ID = '334' AND comment_approved = '1' ORDER BY comment_date

Leave a Reply