diff --git a/b2-include/b2edit.form.php b/b2-include/b2edit.form.php index 8f024f8855..6285de8e2e 100644 --- a/b2-include/b2edit.form.php +++ b/b2-include/b2edit.form.php @@ -47,27 +47,24 @@ switch($action) { - > -
- - -
-
- -
-
-
- + + + +
+
+ +
+
+
+ colspan="2">  +?>   @@ -81,8 +78,8 @@ if ($action != "editcomment") {
" tabindex="3" id="URL" /> @@ -91,6 +88,20 @@ if ($action != "editcomment") { + +
+Excerpt :'; +} else { + echo '
'; +} +?> +
 
+ +
+ + Post :'; @@ -120,8 +131,7 @@ echo " checked" ?> tabindex="7" id="autobr" />
- \ No newline at end of file + diff --git a/b2-include/b2edit.showposts.php b/b2-include/b2edit.showposts.php index 7f3bcbe2cb..1e56b9f9a0 100644 --- a/b2-include/b2edit.showposts.php +++ b/b2-include/b2edit.showposts.php @@ -36,62 +36,81 @@ if ($previousXstart < 0) { ?> - - - + + + - + - - + $besp_selected = "selected"; +?> +   + + + +
-Show posts: - - + - - - + + +
-
+
+ Show posts: + + + + - -
+ + 0) { ?> - - -" /> + + +
- - -
-
-
-
- -
+ + + + + +
+
+
+ +>last posts -
-
-
- to    + +
+
+
+  to   +  
-
@@ -238,11 +257,19 @@ echo " selected"; "; + the_excerpt(); + echo '
'; + if ($safe_mode) + echo ""; + ?> + "; the_content(); if ($safe_mode) echo ""; ?> -

+

- - - + + + - + - - -
-Show posts: - - + - - - + + +
-
+
Show posts: + + + - -
+ -1) { ?> - - -" /> + +
- - -
-
-
-
- -
+ + + + + +
+
+
+ +   -
-
-
- to   +
+
+
+  to   
-
+   + + + + \ No newline at end of file diff --git a/b2-include/b2functions.php b/b2-include/b2functions.php index 877cab5c37..d7fc4d5c08 100644 --- a/b2-include/b2functions.php +++ b/b2-include/b2functions.php @@ -518,6 +518,7 @@ function get_postdata($postid) { 'Author_ID' => $myrow->post_author, 'Date' => $myrow->post_date, 'Content' => $myrow->post_content, + 'Excerpt' => $myrow->post_excerpt, 'Title' => $myrow->post_title, 'Category' => $myrow->post_category, ); @@ -534,6 +535,7 @@ function get_postdata2($postid=0) { // less flexible, but saves mysql queries 'Author_ID' => $row->post_author, 'Date' => $row->post_date, 'Content' => $row->post_content, + 'Excerpt' => $row->post_excerpt, 'Title' => $row->post_title, 'Category' => $row->post_category, # 'Notify' => $row->post_notifycomments, diff --git a/b2-include/b2template.functions.php b/b2-include/b2template.functions.php index cf0696c7d8..66824acaa6 100644 --- a/b2-include/b2template.functions.php +++ b/b2-include/b2template.functions.php @@ -370,6 +370,72 @@ function get_the_content($more_link_text='(more...)', $stripteaser=0, $more_file return($output); } +function the_excerpt() { + $excerpt = get_the_excerpt(); + $excerpt = convert_bbcode($excerpt); + $excerpt = convert_gmcode($excerpt); + $excerpt = convert_smilies($excerpt); + $excerpt = convert_chars($excerpt, 'html'); + $excerpt = apply_filters('the_excerpt', $excerpt); + echo $excerpt; +} + +function the_excerpt_rss($cut = 0, $encode_html = 0) { + $excerpt = get_the_excerpt(); + $excerpt = convert_bbcode($excerpt); + $excerpt = convert_gmcode($excerpt); + $excerpt = convert_chars($excerpt, 'unicode'); + if ($cut && !$encode_html) { + $encode_html = 2; + } + if ($encode_html == 1) { + $excerpt = htmlspecialchars($excerpt); + $cut = 0; + } elseif ($encode_html == 0) { + $excerpt = make_url_footnote($excerpt); + } elseif ($encode_html == 2) { + $excerpt = strip_tags($excerpt); + } + if ($cut) { + $blah = explode(' ', $excerpt); + if (count($blah) > $cut) { + $k = $cut; + $use_dotdotdot = 1; + } else { + $k = count($blah); + $use_dotdotdot = 0; + } + for ($i=0; $i<$k; $i++) { + $excerpt .= $blah[$i].' '; + } + $excerpt .= ($use_dotdotdot) ? '...' : ''; + $excerpt = $excerpt; + } + echo $excerpt; +} +function the_excerpt_unicode() { + $excerpt = get_the_excerpt(); + $excerpt = convert_bbcode($excerpt); + $excerpt = convert_gmcode($excerpt); + $excerpt = convert_smilies($excerpt); + $excerpt = convert_chars($excerpt, 'unicode'); + $excerpt = apply_filters('the_excerpt_unicode', $excerpt); + echo $excerpt; +} +function get_the_excerpt() { + global $id,$postdata; + global $HTTP_SERVER_VARS, $preview; + $output = ''; + $output = $postdata['Excerpt']; + if ($preview) { // preview fix for javascript bug with foreign languages + $output = preg_replace('/\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output); + } + return($output); +} + + + + function link_pages($before='
', $after='
', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') { global $id,$page,$numpages,$multipage,$more; global $pagenow; @@ -1123,6 +1189,7 @@ function start_b2() { 'Author_ID' => $HTTP_GET_VARS['preview_userid'], 'Date' => $HTTP_GET_VARS['preview_date'], 'Content' => $HTTP_GET_VARS['preview_content'], + 'Excerpt' => $HTTP_GET_VARS['preview_excerpt'], 'Title' => $HTTP_GET_VARS['preview_title'], 'Category' => $HTTP_GET_VARS['preview_category'], 'Notify' => 1, diff --git a/b2edit.php b/b2edit.php index a5a2f5c9da..4204d2b5fa 100644 --- a/b2edit.php +++ b/b2edit.php @@ -19,7 +19,7 @@ if (!get_magic_quotes_gpc()) { $HTTP_COOKIE_VARS = add_magic_quotes($HTTP_COOKIE_VARS); } -$b2varstoreset = array('action','safe_mode','withcomments','c','posts','poststart','postend','content','edited_post_title','comment_error','profile', 'trackback_url'); +$b2varstoreset = array('action','safe_mode','withcomments','c','posts','poststart','postend','content','edited_post_title','comment_error','profile', 'trackback_url', 'excerpt'); for ($i=0; $i 4) && (!empty($HTTP_POST_VARS["edit_date"]))) { @@ -177,7 +183,7 @@ case "editpost": $datemodif = ""; } - $query = "UPDATE $tableposts SET post_content=\"$content\", post_title=\"$post_title\", post_category=\"$post_category\"".$datemodif." WHERE ID=$post_ID"; + $query = "UPDATE $tableposts SET post_content=\"$content\", post_excerpt=\"$excerpt\", post_title=\"$post_title\", post_category=\"$post_category\"".$datemodif." WHERE ID=$post_ID"; $result = mysql_query($query) or mysql_oops($query); if (isset($sleep_after_edit) && $sleep_after_edit > 0) { diff --git a/index.php b/index.php index 2e4a385565..759f68605f 100644 --- a/index.php +++ b/index.php @@ -36,6 +36,9 @@
+
+ +