Changeset 571
- Timestamp:
- 12/05/2003 01:44:42 AM (23 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
b2-include/b2functions.php (modified) (2 diffs)
-
blog.header.php (modified) (3 diffs)
-
wp-admin/wp-admin.css (modified) (3 diffs)
-
wp-admin/wp-edit.form.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/b2-include/b2functions.php
r570 r571 576 576 577 577 function get_postdata($postid) { 578 global $tableusers, $tablecategories, $tableposts, $tablecomments, $wpdb; 578 global $post, $tableusers, $tablecategories, $tableposts, $tablecomments, $wpdb; 579 579 580 $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID = $postid"); 580 581 … … 663 664 } 664 665 665 function dropdown_categories($blog_ID=1, $default=1) { 666 global $postdata,$tablecategories,$mode, $wpdb; 667 $query="SELECT * FROM $tablecategories ORDER BY cat_name"; 668 $results = $wpdb->get_results($query); 669 $width = ($mode=="sidebar") ? "100%" : "170px"; 670 echo '<select name="post_category" style="width:'.$width.';" tabindex="2" id="category">'; 671 if ($postdata["Category"] != '') { 672 $default = $postdata["Category"]; 673 } 674 foreach($results as $post) { 675 echo "<option value=\"".$post->cat_ID."\""; 676 if ($post->cat_ID == $default) 677 echo " selected"; 678 echo ">".$post->cat_name."</option>"; 679 } 680 echo "</select>"; 666 function dropdown_categories($default = 0) { 667 global $post, $tablecategories, $tablepost2cat, $mode, $wpdb; 668 $categories = $wpdb->get_results("SELECT * FROM $tablecategories ORDER BY cat_name"); 669 670 if ($post->ID) { 671 $postcategories = $wpdb->get_col(" 672 SELECT category_id 673 FROM $tablecategories, $tablepost2cat 674 WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = $post->ID 675 "); 676 } else { 677 $postcategories[] = $default; 678 } 679 680 foreach($categories as $category) { 681 ++$i; 682 $category->cat_name = stripslashes($category->cat_name); 683 echo "<label for='category-$category->cat_ID' class='selectit'><input value='$category->cat_ID' type='checkbox' name='post_category' id='category-$category->cat_ID'"; 684 if ($postcategories && in_array($category->cat_ID, $postcategories)) 685 echo " checked='checked'"; 686 echo ">$category->cat_name</label> "; 687 } 688 681 689 } 682 690 -
trunk/blog.header.php
r569 r571 14 14 require_once ($curpath.$b2inc.'/xmlrpcs.inc'); 15 15 16 $b2varstoreset = array('m','p','posts','w','c', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'name' );16 $b2varstoreset = array('m','p','posts','w','c', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'name', 'category_nicename'); 17 17 18 18 for ($i=0; $i<count($b2varstoreset); $i += 1) { … … 290 290 // Get private posts 291 291 if (isset($user_ID) && ('' != intval($user_ID))) 292 $where .= " OR post_author = $user_ID AND post_status != 'draft')";292 $where .= " OR post_author = $user_ID AND post_status != 'draft')"; 293 293 else 294 294 $where .= ')'; … … 308 308 // echo $request; 309 309 $posts = $wpdb->get_results($request); 310 310 311 if (1 == count($posts)) { 311 312 if ($p || $name) { -
trunk/wp-admin/wp-admin.css
r560 r571 146 146 #adminmenu2 a { 147 147 font-size: 14px; 148 } 149 150 #categorydiv { 151 float: right; 152 width: 10%; 153 line-height: 130%; 154 } 155 156 #poststuff { 157 width: 88%; 158 } 159 160 #poststuff textarea { 161 width: 100%; 148 162 } 149 163 … … 203 217 display: block; 204 218 margin-bottom: 1px; 219 margin-top: 1px; 205 220 border-bottom: 1px solid #666; 206 221 font-size: 11px; … … 242 257 } 243 258 244 #titlediv, # categorydiv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv {259 #titlediv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv { 245 260 float: left; 246 261 margin-right: 5px; 247 262 } 263 248 264 249 265 #wphead { -
trunk/wp-admin/wp-edit.form.php
r560 r571 78 78 <input type="text" name="post_title" size="25" tabindex="1" style="width: 190px;" value="<?php echo $edited_post_title; ?>" id="title" /> 79 79 </div> 80 <div id="categorydiv"> 81 <label for="category"><a href="http://wordpress.org/docs/reference/post/#category" title="Help on categories">Category</a>:</label> 82 <br /> 83 <?php dropdown_categories($blog_ID, $default_post_cat); ?> 80 <div id="categorydiv"> <a href="http://wordpress.org/docs/reference/post/#category" title="Help on categories">Categories</a>: <br /> 81 <?php dropdown_categories($default_post_cat); ?> 84 82 </div> 85 83 <div id="poststatusdiv"> … … 108 106 <input name="post_password" type="text" id="post_password" value="<?php echo $post_password ?>" /> 109 107 </div> 110 <br style="clear: both" /> 108 109 110 <div id="poststuff"> 111 111 <?php 112 112 … … 146 146 if ($action != 'editcomment') { 147 147 ?> 148 <p ><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a>:148 <p style="clear: both;" ><a href="http://wordpress.org/docs/reference/post/#excerpt" title="Help with excerpts">Excerpt</a>: 149 149 <br /> 150 <textarea rows="3" cols="40" style="width:100%"name="excerpt" tabindex="4" wrap="virtual" id="excerpt"><?php echo $excerpt ?></textarea></p>150 <textarea rows="3" cols="40" name="excerpt" tabindex="4" wrap="virtual" id="excerpt"><?php echo $excerpt ?></textarea></p> 151 151 152 152 <?php 153 153 } // if not a comment 154 154 ?> 155 <table width="100%">155 <table style="width: 100%; "> 156 156 <tr> 157 157 <td> … … 177 177 $rows = get_settings('default_post_edit_rows'); 178 178 if (($rows < 3) || ($rows > 100)) { 179 $rows = 9;179 $rows = 10; 180 180 } 181 181 ?> 182 <textarea rows="<?php echo $rows; ?>" cols="40" style="width:100%"name="content" tabindex="4" wrap="virtual" id="content"><?php echo $content ?></textarea><br />182 <textarea rows="<?php echo $rows; ?>" cols="40" name="content" tabindex="4" wrap="virtual" id="content"><?php echo $content ?></textarea><br /> 183 183 <?php 184 184 if ($use_quicktags) { … … 237 237 </form> 238 238 </div> 239 </div>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)