Changeset 229768
- Timestamp:
- 04/16/2010 02:52:44 AM (16 years ago)
- Location:
- wp-category-manager/trunk
- Files:
-
- 4 edited
-
categorymanagerfunctions.php (modified) (3 diffs)
-
manage-category.php (modified) (1 diff)
-
wp-category-manager-settings.php (modified) (1 diff)
-
wp-category-manager.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-category-manager/trunk/categorymanagerfunctions.php
r228737 r229768 1 1 <?php 2 2 /* 3 * To change this template, choose Tools | Templates 4 * and open the template in the editor. 3 * This file defines the set of functions used by the wp-category-manager plugin to perform its actual operations 5 4 */ 6 5 6 /* 7 * This function removes the category identified by $categoryId from the post identified by $postId 8 */ 7 9 function removeCategoryFromPost($postId, $categoryId) 8 10 { … … 15 17 } 16 18 17 function getPostListForCat($category) 19 /* 20 * This function returns a list of posts that belong to a category identified by $category. 21 * The optional Page parameter defines how many pages of posts to return 22 */ 23 function getPostListForCat($category, $page, $postsPerPage) 18 24 { 19 25 global $wpdb; … … 27 33 WHERE wp_term_taxonomy.taxonomy = 'category' 28 34 and wp_terms.name = '" . $category . "' 29 and wposts.post_status='publish'"; 35 and wposts.post_status='publish' 36 ORDER BY wposts.ID limit 3 offset 3"; 30 37 31 38 $postlist = $wpdb->get_results($querystr); -
wp-category-manager/trunk/manage-category.php
r229763 r229768 33 33 { 34 34 //var_dump($_GET['category']); 35 renderPosts(getPostListForCat($_GET['category'] ));35 renderPosts(getPostListForCat($_GET['category'], 0 , 10)); 36 36 } 37 37 -
wp-category-manager/trunk/wp-category-manager-settings.php
r228737 r229768 1 1 <div class="wrap" style="max-width:950px !important;"> 2 2 <h2>Category Manager</h2> 3 3 4 4 <div id="poststuff" style="margin-top:10px;"> 5 5 6 6 <div id="mainblock" style="width:710px"> 7 7 8 8 <div class="dbx-content"> 9 <form name="CatManager" action="<?php echo $action_url ?>" method="post"> 10 <input type="hidden" name="submitted" value="1" /> 11 12 <?php wp_nonce_field('catmanager-nonce'); ?> 13 14 <h3>Usage</h3> 15 <p>This plugin makes category management quicker. Especially if you modify post categories often after posting them </p> 16 <br /> 17 18 <h3>Options</h3> 19 <p>You can choose whether you want the category management widget shows up on the dashboard</p> 20 <input type="checkbox" name="ondashboard" <?php echo $ondash ?> /><label for="posts"> Show On Dashboard</label> <br /> 21 <br /> 22 23 <p>You can choose whether you want the category management widget to diplay a confirmation prompt on category removal</p> 24 <input type="checkbox" name="showConfirm" <?php echo $showConfirm ?> /><label for="posts"> Enable Confirmation dialog</label> <br /> 25 <br /> 9 <form name="CatManager" action="<?php echo $action_url ?>" method="post"> 10 <input type="hidden" name="submitted" value="1" /> 26 11 27 <p>If you want to be able to change the selected default category on the dashboard without coming to this screen enable the option below</p> 28 <input type="checkbox" name="enableDropdown" <?php echo $enableDropdown ?> /><label for="posts"> Enable Category drown down list</label> <br /> 29 <br /> 12 <?php wp_nonce_field('catmanager-nonce'); ?> 13 14 <h3>Usage</h3> 15 <p>This plugin makes category management quicker. Especially if you modify post categories often after posting them </p> 16 <br /> 17 18 <h3>Options</h3> 19 <p>You can choose whether you want the category management widget shows up on the dashboard</p> 20 <input type="checkbox" name="ondashboard" <?php echo $ondash ?> /><label> Show On Dashboard</label> <br /> 21 <br /> 22 23 <p>You can choose whether you want the category management widget to diplay a confirmation prompt on category removal</p> 24 <input type="checkbox" name="showConfirm" <?php echo $showConfirm ?> /><label> Enable Confirmation dialog</label> <br /> 25 <br /> 26 27 <p>If you want to be able to change the selected default category on the dashboard without coming to this screen enable the option below</p> 28 <input type="checkbox" name="enableDropdown" <?php echo $enableDropdown ?> /><label> Enable Category drown down list</label> <br /> 29 <br /> 30 31 <h3> Posts Per Page </h3><label>Show : </label><?php echo $ppplist; ?><br /> 32 <br /> 30 33 31 34 32 <h3>Default Category</h3>33 <p>You can specify the default category you wish to show up on the dashboard widget</p>35 <h3>Default Category</h3> 36 <p>You can specify the default category you wish to show up on the dashboard widget</p> 34 37 35 38 36 <?php echo $selectlist; ?> 37 38 <div class="submit"><input type="submit" name="Submit" value="Update" /></div> 39 <?php echo $selectlist; ?> 40 41 42 43 <div class="submit"><input type="submit" name="Submit" value="Update" /></div> 39 44 </form> 40 45 </div> 41 46 42 47 </div> 43 48 44 49 </div> 45 50 46 51 </div> -
wp-category-manager/trunk/wp-category-manager.php
r229766 r229768 46 46 47 47 $options = get_option($this->db_option); 48 $postlist = getPostListForCat($options['defaultCategory'] );48 $postlist = getPostListForCat($options['defaultCategory'], 0, $options['postsperpage']); 49 49 50 50 if($options['enableDropdown'] == 'on') … … 83 83 'showConfirm' => 'on', 84 84 'defaultCategory' => '', 85 'postsperpage' => 10, 85 86 'enableDropdown' => 'on' 86 87 ); … … 104 105 } 105 106 107 function getPostsPerPageSelectBox() 108 { 109 $options = $this->get_options(); 110 $pageOptions = array(-1,5,10,25,50); 111 $postsPerPage = $options['postsperpage']; 112 113 $selectlist = '<select name="postsperpage">'; 114 115 foreach($pageOptions as $option) 116 { 117 $txt = $option==-1? 'Unlimited' : $option; 118 if($option == $postsPerPage) 119 { 120 $selectlist = $selectlist . '<option value="' . $option . '" selected>' . $txt . '</option>'; 121 } 122 else 123 { 124 $selectlist = $selectlist . '<option value="' . $option . '" >' . $txt . '</option>'; 125 } 126 } 127 $selectlist = $selectlist . '</select>'; 128 129 return $selectlist; 130 131 } 106 132 107 133 … … 146 172 $options['showConfirm'] = $_POST['showConfirm']; 147 173 $options['defaultCategory'] = $_POST['defaultCat']; 174 $options['postsperpage'] = $_POST['postsperpage']; 148 175 $options['enableDropdown'] = $_POST['enableDropdown']; 149 176 … … 156 183 $showConfirm = $options['showConfirm']=='on' ? 'checked' : ''; 157 184 $defaultCat = $options['defaultCategory']; 185 $postsPerPage = $options['postperpage']; 158 186 $enableDropdown = $options['enableDropdown']=='on' ? 'checked' : '';; 159 187 160 188 $action_url = $_SERVER['REQUEST_URI']; 161 189 190 $ppplist = $this->getPostsPerPageSelectBox(); 162 191 $selectlist = $this->getCatSelectBox(); 163 192 193 164 194 include('wp-category-manager-settings.php'); 165 195
Note: See TracChangeset
for help on using the changeset viewer.