diff --git a/b2-include/b2functions.php b/b2-include/b2functions.php index feeac5b0ed..b56678af61 100644 --- a/b2-include/b2functions.php +++ b/b2-include/b2functions.php @@ -575,7 +575,8 @@ function add_option() { } function get_postdata($postid) { - global $tableusers, $tablecategories, $tableposts, $tablecomments, $wpdb; + global $post, $tableusers, $tablecategories, $tableposts, $tablecomments, $wpdb; + $post = $wpdb->get_row("SELECT * FROM $tableposts WHERE ID = $postid"); $postdata = array ( @@ -662,22 +663,29 @@ function profile($user_login) { echo "user_login."','Profile','toolbar=0,status=1,location=0,directories=0,menuBar=1,scrollbars=1,resizable=0,width=480,height=320,left=100,top=100'); return false;\">$user_login"; } -function dropdown_categories($blog_ID=1, $default=1) { - global $postdata,$tablecategories,$mode, $wpdb; - $query="SELECT * FROM $tablecategories ORDER BY cat_name"; - $results = $wpdb->get_results($query); - $width = ($mode=="sidebar") ? "100%" : "170px"; - echo ''; - if ($postdata["Category"] != '') { - $default = $postdata["Category"]; - } - foreach($results as $post) { - echo "cat_ID."\""; - if ($post->cat_ID == $default) - echo " selected"; - echo ">".$post->cat_name.""; +function dropdown_categories($default = 0) { + global $post, $tablecategories, $tablepost2cat, $mode, $wpdb; + $categories = $wpdb->get_results("SELECT * FROM $tablecategories ORDER BY cat_name"); + + if ($post->ID) { + $postcategories = $wpdb->get_col(" + SELECT category_id + FROM $tablecategories, $tablepost2cat + WHERE $tablepost2cat.category_id = cat_ID AND $tablepost2cat.post_id = $post->ID + "); + } else { + $postcategories[] = $default; } - echo ""; + + foreach($categories as $category) { + ++$i; + $category->cat_name = stripslashes($category->cat_name); + echo "cat_ID, $postcategories)) + echo " checked='checked'"; + echo ">$category->cat_name "; + } + } function touch_time($edit = 1) { diff --git a/blog.header.php b/blog.header.php index 213a3db4ad..ff3d5e1fd2 100644 --- a/blog.header.php +++ b/blog.header.php @@ -13,7 +13,7 @@ require_once ($curpath.$b2inc.'/b2functions.php'); require_once ($curpath.$b2inc.'/xmlrpc.inc'); require_once ($curpath.$b2inc.'/xmlrpcs.inc'); -$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'); +$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'); for ($i=0; $iget_results($request); + if (1 == count($posts)) { if ($p || $name) { $more = 1; diff --git a/wp-admin/wp-admin.css b/wp-admin/wp-admin.css index 08a70c09bd..3130df552c 100644 --- a/wp-admin/wp-admin.css +++ b/wp-admin/wp-admin.css @@ -147,6 +147,20 @@ textarea, input, select { font-size: 14px; } +#categorydiv { + float: right; + width: 10%; + line-height: 130%; +} + +#poststuff { + width: 88%; +} + +#poststuff textarea { + width: 100%; +} + #ed_button { padding: 1px; } @@ -202,6 +216,7 @@ textarea, input, select { padding: 0 2px; display: block; margin-bottom: 1px; + margin-top: 1px; border-bottom: 1px solid #666; font-size: 11px; } @@ -241,11 +256,12 @@ label input { text-align: right; } -#titlediv, #categorydiv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv { +#titlediv, #poststatusdiv, #commentstatusdiv, #pingstatusdiv, #postpassworddiv { float: left; margin-right: 5px; } + #wphead { background: url(../b2-img/wp-small.png) no-repeat; border-bottom: 4px solid #333; diff --git a/wp-admin/wp-edit.form.php b/wp-admin/wp-edit.form.php index 4381194288..864fb22cff 100644 --- a/wp-admin/wp-edit.form.php +++ b/wp-admin/wp-edit.form.php @@ -77,10 +77,8 @@ window.onload = focusit; - - Category: - - + Categories: + Post @@ -107,7 +105,9 @@ window.onload = focusit; - + + + -Excerpt: +Excerpt: - + - + 100)) { - $rows = 9; + $rows = 10; } ?> - + @@ -236,3 +236,4 @@ if ('edit' == $action) echo " +
Excerpt: +
Excerpt: -