Changeset 799
- Timestamp:
- 01/27/2004 08:31:17 AM (22 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
wp-admin/admin-header.php (modified) (1 diff)
-
wp-admin/categories.php (modified) (3 diffs)
-
wp-includes/template-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r798 r799 3 3 require_once('../wp-config.php'); 4 4 require_once(ABSPATH.'/wp-admin/auth.php'); 5 require(ABSPATH.'/wp-admin/admin-functions.php'); 5 6 6 7 function gethelp_link($this_file, $helptag) { -
trunk/wp-admin/categories.php
r798 r799 93 93 <input type="text" name="cat_name" value="<?php echo $cat_name; ?>" /></p> 94 94 <p>Category parent:<br /> 95 <?php dropdown_cats(FALSE, '', 'name', 'asc', FALSE, FALSE, FALSE, TRUE, $category->category_parent, $HTTP_GET_VARS['cat_ID']); ?></p> 95 <select name='cat' class='postform'> 96 <?php wp_dropdown_cats($category->cat_ID, $category->category_parent); ?></p> 97 </select> 98 </p> 96 99 <p>Description:<br /> 97 100 <textarea name="category_description" rows="5" cols="50" style="width: 97%;"><?php echo htmlentities($category->category_description); ?></textarea></p> … … 133 136 134 137 <div class="wrap"> 135 <h2>Current Categories</h2> 136 <table width="100%" cellpadding="3" cellspacing="3"> 137 <tr> 138 <th scope="col">Name</th> 139 <th scope="col">Parent</th> 140 <th scope="col">Description</th> 141 <th scope="col"># Posts</th> 142 <th colspan="2">Action</th> 143 </tr> 144 <?php 145 $categories = $wpdb->get_results("SELECT * FROM $tablecategories ORDER BY cat_name"); 146 foreach ($categories as $category) { 147 $parent = "None"; 148 if ($category->category_parent) $parent = $wpdb->get_var("SELECT cat_name FROM $tablecategories WHERE cat_ID = $category->category_parent"); 149 $count = $wpdb->get_var("SELECT COUNT(post_id) FROM $tablepost2cat WHERE category_id = $category->cat_ID"); 150 $bgcolor = ('#eee' == $bgcolor) ? 'none' : '#eee'; 151 echo "<tr style='background-color: $bgcolor'><td>$category->cat_name</td> 152 <td>$parent</td> 153 <td>$category->category_description</td> 154 <td>$count</td> 155 <td><a href='categories.php?action=edit&cat_ID=$category->cat_ID' class='edit'>Edit</a></td><td><a href='categories.php?action=Delete&cat_ID=$category->cat_ID' onclick=\"return confirm('You are about to delete the category \'". addslashes($category->cat_name) ."\' and all its posts will go to the default category.\\n \'OK\' to delete, \'Cancel\' to stop.')\" class='delete'>Delete</a></td> 156 </tr>"; 157 } 158 ?> 138 <h2>Current Categories</h2> 139 <table width="100%" cellpadding="3" cellspacing="3"> 140 <tr> 141 <th scope="col">Name</th> 142 <th scope="col">Description</th> 143 <th scope="col"># Posts</th> 144 <th colspan="2">Action</th> 145 </tr> 146 <?php 147 cat_rows(); 148 ?> 159 149 </table> 160 150 … … 167 157 <input type="text" name="cat_name" value="" /></p> 168 158 <p>Category parent:<br /> 169 <?php dropdown_cats(FALSE, '', 'name', 'asc', FALSE, FALSE, FALSE, TRUE); ?></p> 159 <select name='cat' class='postform'> 160 <?php wp_dropdown_cats(); ?></p> 161 </select> 170 162 <p>Description: (optional) <br /> 171 163 <textarea name="category_description" rows="5" cols="50" style="width: 97%;"></textarea></p> -
trunk/wp-includes/template-functions.php
r798 r799 1461 1461 function get_category_children($id, $before=' / ', $after='') { 1462 1462 global $tablecategories, $cache_categories; 1463 $c_cache=$cache_categories; #can't do recursive foreach on a global, have to make a copy1463 $c_cache=$cache_categories; // Can't do recursive foreach on a global, have to make a copy 1464 1464 $chain = ""; 1465 1465 foreach ($c_cache as $category){
Note: See TracChangeset
for help on using the changeset viewer.