Changeset 12
- Timestamp:
- 04/24/2003 01:04:42 AM (22 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/b2-include/b2edit.form.php
r8 r12 48 48 <table cellspacing="0" cellpadding="0" border="0" width="100%"> 49 49 <tr> 50 <td<?php 51 52 if ($action != "editcomment") { 53 54 // this is for everything but comment editing 55 ?>> 56 <table height="60" align="left" cellpadding="0" cellspacing="0"> 57 <td height="60" width="190"> 58 <label for="title"><b>Title :</b></label><br /> 59 <input type="text" name="post_title" size="20" tabindex="1" style="width: 170px;" value="<?php echo $edited_post_title; ?>" id="title" /> 60 </td> 61 <td> 62 <label for="category"><b>Category :</b></label><br /><?php dropdown_categories(); ?> 63 </td> 64 </table> 65 <?php 50 <?php if ($action != "editcomment") { 51 // this is for everything but comment editing 52 ?> <td> 53 <table height="60" align="left" cellpadding="0" cellspacing="0"> 54 <td height="60" width="190"> 55 <label for="title"><b>Title :</b></label><br /> 56 <input type="text" name="post_title" size="20" tabindex="1" style="width: 170px;" value="<?php echo $edited_post_title; ?>" id="title" /> 57 </td> 58 <td> 59 <label for="category"><b>Category :</b></label><br /><?php dropdown_categories(); ?> 60 </td> 61 </table> 62 <?php 66 63 67 64 } else { 68 65 69 66 // this is for comment editing 70 ?>colspan="2"> </td>67 ?> <td colspan="2"> </td> 71 68 </tr> 72 69 … … 82 79 <input type="text" name="newcomment_author_url" size="20" value="<?php echo format_to_edit($commentdata["comment_author_url"]) ?>" tabindex="3" id="URL" /> 83 80 <?php 84 85 } 81 82 } // end else comment editing 86 83 87 84 ?> … … 92 89 <table cellspacing="0" cellpadding="0" border="0" width="100%"> 93 90 <td valign="bottom"> 91 <?php 92 if ($action != 'editcomment') { 93 echo '<label for="excerpt"><b>Excerpt :</b></label>'; 94 } else { 95 echo '<br /><label for="content"><b>Comment :</b></label>'; 96 } 97 ?> 98 </td> 99 <td valign="bottom" align="right"> </td> 100 </table> 101 102 <textarea rows="3" cols="40" style="width:100%" name="excerpt" tabindex="4" wrap="virtual" id="content"><?php echo $excerpt ?></textarea><br /> 103 <table cellspacing="0" cellpadding="0" border="0" width="100%"> 104 94 105 <?php 95 106 if ($action != 'editcomment') { … … 121 132 <?php if ($use_spellchecker) { ?> 122 133 <!--<input type = "button" value = "Spell Check" onclick="var f=document.forms[0]; doSpell( 'en', f.post_content, '<?php echo $spellchecker_url ?>/sproxy.cgi', true);" class="search" tabindex="5" />--> 123 <input type="button" value="Spellcheck" onclick="DoSpell 124 ('post','content','');" class="search" tabindex="9"/> 134 <input type="button" value="Spellcheck" onclick="DoSpell('post','content','');" class="search" tabindex="9"/> 125 135 <?php } ?> 126 136 -
trunk/b2-include/b2edit.showposts.php
r8 r12 37 37 38 38 <table width="100%"> 39 <tr> 40 <td valign="top" width="200"> 41 Show posts: </td> 42 <td> 43 <table cellpadding="0" cellspacing="0" border="0"> 44 <td colspan="2" align="center"><!-- show next/previous X posts --> 45 <form name="previousXposts" method="get"><?php 39 <tr> 40 <td valign="top" width="200"> 41 Show posts: 42 </td> 43 <td> 44 <table cellpadding="0" cellspacing="0" border="0"> 45 <tr> 46 <td colspan="2" align="center"><!-- show next/previous X posts --> 47 <form name="previousXposts" method="get"> 48 <?php 46 49 if ($previousXstart > 0) { 47 50 ?> 48 <input type="hidden" name="poststart" value="<?php echo $previousXstart; ?>" /> 49 <input type="hidden" name="postend" value="<?php echo $previousXend; ?>" /> 50 <input type="submit" name="submitprevious" class="search" value="< <?php echo $posts ?>" /><?php 51 } 52 ?></form></td><td><form name="nextXposts" method="get"> 53 <input type="hidden" name="poststart" value="<?php echo $nextXstart; ?>" /> 54 <input type="hidden" name="postend" value="<?php echo $nextXend; ?>" /> 55 <input type="submit" name="submitnext" class="search" value="<?php echo $posts ?> >" /></form> 56 </td> 57 </tr> 58 </table> 59 </td> 60 </tr> 61 <tr> 62 <td valign="top" width="200"><!-- show X first/last posts --> 63 <form name="showXfirstlastposts" method="get"> 64 <input type="text" name="posts" value="<?php echo $posts ?>" style="width:40px;" /?> 65 <select name="order"> <option value="DESC" <?php 51 <input type="hidden" name="poststart" value="<?php echo $previousXstart; ?>" /> 52 <input type="hidden" name="postend" value="<?php echo $previousXend; ?>" /> 53 <input type="submit" name="submitprevious" class="search" value="< <?php echo $posts ?>" /> 54 <?php 55 } 56 ?> 57 </form> 58 </td> 59 <td> 60 <form name="nextXposts" method="get"> 61 <input type="hidden" name="poststart" value="<?php echo $nextXstart; ?>" /> 62 <input type="hidden" name="postend" value="<?php echo $nextXend; ?>" /> 63 <input type="submit" name="submitnext" class="search" value="<?php echo $posts ?> >" /> 64 </form> 65 </td> 66 </tr> 67 </table> 68 </td> 69 </tr> 70 <tr> 71 <td valign="top" width="200"><!-- show X first/last posts --> 72 <form name="showXfirstlastposts" method="get"> 73 <input type="text" name="posts" value="<?php echo $posts ?>" style="width:40px;" /?> 74 <?php 66 75 if (!isset($order)) 67 76 $order="DESC"; 68 77 $i = $order; 69 78 if ($i == "DESC") 70 echo " selected"; 71 ?>>last posts</option> 72 <option value="ASC" <?php 79 $besp_selected = "selected"; 80 ?> 81 <select name="order"> 82 <option value="DESC" "<?= $besp_selected ?>">last posts</option> 83 <?php 84 $besp_selected = ""; 73 85 if ($i == "ASC") 74 echo " selected"; 75 ?>>first posts</option> 76 </select> <input type="submit" name="submitfirstlast" class="search" value="OK" /> 77 </form> 78 </td> 79 <td valign="top"><!-- show post X to post X --> 80 <form name="showXfirstlastposts" method="get"> 81 <input type="text" name="poststart" value="<?php echo $poststart ?>" style="width:40px;" /?> to <input type="text" name="postend" value="<?php echo $postend ?>" style="width:40px;" /?> <select name="order"> 82 <option value="DESC" <?php 86 $besp_selected = "selected"; 87 ?> 88 <option value="ASC" "<?= $besp_selected?>">first posts</option> 89 </select> 90 <input type="submit" name="submitfirstlast" class="search" value="OK" /> 91 </form> 92 </td> 93 <td valign="top"><!-- show post X to post X --> 94 <form name="showXfirstlastposts" method="get"> 95 <input type="text" name="poststart" value="<?php echo $poststart ?>" style="width:40px;" /?> to <input type="text" name="postend" value="<?php echo $postend ?>" style="width:40px;" /?> 96 <select name="order"> 97 <?php 98 $besp_selected = ""; 83 99 $i = $order; 84 100 if ($i == "DESC") 85 echo " selected"; 86 ?>>from the end</option> 87 <option value="ASC" <?php 101 $besp_selected = "selected"; 102 ?> 103 <option value="DESC" "<?= $besp_selected ?>">from the end</option> 104 <?php 105 $besp_selected = ""; 88 106 if ($i == "ASC") 89 echo " selected"; 90 ?>>from the start</option> 91 </select> <input type="submit" name="submitXtoX" class="search" value="OK" /></form> 92 </td> 93 94 </tr> 107 $besp_selected = "selected"; 108 ?> <option value="ASC" "<?= $besp_selected ?>">from the start</option> 109 </select> 110 <input type="submit" name="submitXtoX" class="search" value="OK" /> 111 </form> 112 </td> 113 </tr> 95 114 </table> 96 115 <?php echo $tablebottom ?> … … 239 258 if ($safe_mode) 240 259 echo "<xmp>"; 260 the_excerpt(); 261 echo '<br />'; 262 if ($safe_mode) 263 echo "</xmp>"; 264 ?> 265 <?php 266 if ($safe_mode) 267 echo "<xmp>"; 241 268 the_content(); 242 269 if ($safe_mode) 243 270 echo "</xmp>"; 244 271 ?> 245 272 </p> 246 273 <?php 247 274 … … 323 350 <?php echo $tabletop ?> 324 351 <table width="100%"> 325 <tr>326 <td valign="top" width="200">327 Show posts: </td>328 <td>329 <table cellpadding="0" cellspacing="0" border="0">330 <td colspan="2" align="center"><!-- show next/previous X posts -->331 <form name="previousXposts" method="get"><?php352 <tr> 353 <td valign="top" width="200">Show posts: </td> 354 <td> 355 <table cellpadding="0" cellspacing="0" border="0"> 356 <tr> 357 <td colspan="2" align="center"><!-- show next/previous X posts --> 358 <form name="previousXposts" method="get"><?php 332 359 if ($previousXstart > -1) { 333 360 ?> 334 <input type="hidden" name="poststart" value="<?php echo $previousXstart; ?>" /> 335 <input type="hidden" name="postend" value="<?php echo $previousXend; ?>" /> 336 <input type="submit" name="submitprevious" class="search" value="< Previous <?php echo $posts ?>" /><?php 337 } 338 ?></form></td><td><form name="nextXposts" method="get"> 339 <input type="hidden" name="poststart" value="<?php echo $nextXstart; ?>" /> 340 <input type="hidden" name="postend" value="<?php echo $nextXend; ?>" /> 341 <input type="submit" name="submitnext" class="search" value="Next <?php echo $posts ?> >" /></form> 342 </td> 343 </tr> 344 </table> 345 </td> 346 </tr> 347 <tr> 348 <td valign="top" width="200"><!-- show X first/last posts --> 349 <form name="showXfirstlastposts" method="get"> 350 <input type="text" name="posts" value="<?php echo $posts ?>" style="width:40px;" /?> 351 <select name="order"> <option value="DESC" <?php 361 <input type="hidden" name="poststart" value="<?php echo $previousXstart; ?>" /> 362 <input type="hidden" name="postend" value="<?php echo $previousXend; ?>" /> 363 <input type="submit" name="submitprevious" class="search" value="< Previous <?php echo $posts ?>" /><?php 364 } 365 ?> 366 </form> 367 </td> 368 <td> 369 <form name="nextXposts" method="get"> 370 <input type="hidden" name="poststart" value="<?php echo $nextXstart; ?>" /> 371 <input type="hidden" name="postend" value="<?php echo $nextXend; ?>" /> 372 <input type="submit" name="submitnext" class="search" value="Next <?php echo $posts ?> >" /> 373 </form> 374 </td> 375 </tr> 376 </table> 377 </td> 378 </tr> 379 <tr> 380 <td valign="top" width="200"><!-- show X first/last posts --> 381 <form name="showXfirstlastposts" method="get"> 382 <input type="text" name="posts" value="<?php echo $posts ?>" style="width:40px;" /?> 383 <select name="order"> <option value="DESC" <?php 352 384 $i = $order; 353 385 if ($i == "DESC") … … 358 390 echo " selected"; 359 391 ?>>first posts</option> 360 </select> <input type="submit" name="submitfirstlast" class="search" value="OK" />361 </form>362 </td>363 <td valign="top"><!-- show post X to post X -->364 <form name="showXfirstlastposts" method="get">365 <input type="text" name="poststart" value="<?php echo $poststart ?>" style="width:40px;" /?> to <input type="text" name="postend" value="<?php echo $postend ?>" style="width:40px;" /?> <select name="order">366 <option value="DESC" <?php392 </select> <input type="submit" name="submitfirstlast" class="search" value="OK" /> 393 </form> 394 </td> 395 <td valign="top"><!-- show post X to post X --> 396 <form name="showXfirstlastposts" method="get"> 397 <input type="text" name="poststart" value="<?php echo $poststart ?>" style="width:40px;" /?> to <input type="text" name="postend" value="<?php echo $postend ?>" style="width:40px;" /?> <select name="order"> 398 <option value="DESC" <?php 367 399 $i = $order; 368 400 if ($i == "DESC") … … 373 405 echo " selected"; 374 406 ?>>from the start</option> 375 </select> <input type="submit" name="submitXtoX" class="search" value="OK" /></form>376 </td>377 378 </tr>379 </table>407 </select> <input type="submit" name="submitXtoX" class="search" value="OK" /> 408 </form> 409 </td> 410 </tr> 411 </table> 380 412 <?php echo $tablebottom ?> -
trunk/b2-include/b2functions.php
r9 r12 519 519 'Date' => $myrow->post_date, 520 520 'Content' => $myrow->post_content, 521 'Excerpt' => $myrow->post_excerpt, 521 522 'Title' => $myrow->post_title, 522 523 'Category' => $myrow->post_category, … … 535 536 'Date' => $row->post_date, 536 537 'Content' => $row->post_content, 538 'Excerpt' => $row->post_excerpt, 537 539 'Title' => $row->post_title, 538 540 'Category' => $row->post_category, -
trunk/b2-include/b2template.functions.php
r8 r12 370 370 return($output); 371 371 } 372 373 function the_excerpt() { 374 $excerpt = get_the_excerpt(); 375 $excerpt = convert_bbcode($excerpt); 376 $excerpt = convert_gmcode($excerpt); 377 $excerpt = convert_smilies($excerpt); 378 $excerpt = convert_chars($excerpt, 'html'); 379 $excerpt = apply_filters('the_excerpt', $excerpt); 380 echo $excerpt; 381 } 382 383 function the_excerpt_rss($cut = 0, $encode_html = 0) { 384 $excerpt = get_the_excerpt(); 385 $excerpt = convert_bbcode($excerpt); 386 $excerpt = convert_gmcode($excerpt); 387 $excerpt = convert_chars($excerpt, 'unicode'); 388 if ($cut && !$encode_html) { 389 $encode_html = 2; 390 } 391 if ($encode_html == 1) { 392 $excerpt = htmlspecialchars($excerpt); 393 $cut = 0; 394 } elseif ($encode_html == 0) { 395 $excerpt = make_url_footnote($excerpt); 396 } elseif ($encode_html == 2) { 397 $excerpt = strip_tags($excerpt); 398 } 399 if ($cut) { 400 $blah = explode(' ', $excerpt); 401 if (count($blah) > $cut) { 402 $k = $cut; 403 $use_dotdotdot = 1; 404 } else { 405 $k = count($blah); 406 $use_dotdotdot = 0; 407 } 408 for ($i=0; $i<$k; $i++) { 409 $excerpt .= $blah[$i].' '; 410 } 411 $excerpt .= ($use_dotdotdot) ? '...' : ''; 412 $excerpt = $excerpt; 413 } 414 echo $excerpt; 415 } 416 function the_excerpt_unicode() { 417 $excerpt = get_the_excerpt(); 418 $excerpt = convert_bbcode($excerpt); 419 $excerpt = convert_gmcode($excerpt); 420 $excerpt = convert_smilies($excerpt); 421 $excerpt = convert_chars($excerpt, 'unicode'); 422 $excerpt = apply_filters('the_excerpt_unicode', $excerpt); 423 echo $excerpt; 424 } 425 function get_the_excerpt() { 426 global $id,$postdata; 427 global $HTTP_SERVER_VARS, $preview; 428 $output = ''; 429 $output = $postdata['Excerpt']; 430 if ($preview) { // preview fix for javascript bug with foreign languages 431 $output = preg_replace('/\%u([0-9A-F]{4,4})/e', "'&#'.base_convert('\\1',16,10).';'", $output); 432 } 433 return($output); 434 } 435 436 437 372 438 373 439 function link_pages($before='<br />', $after='<br />', $next_or_number='number', $nextpagelink='next page', $previouspagelink='previous page', $pagelink='%', $more_file='') { … … 1124 1190 'Date' => $HTTP_GET_VARS['preview_date'], 1125 1191 'Content' => $HTTP_GET_VARS['preview_content'], 1192 'Excerpt' => $HTTP_GET_VARS['preview_excerpt'], 1126 1193 'Title' => $HTTP_GET_VARS['preview_title'], 1127 1194 'Category' => $HTTP_GET_VARS['preview_category'], -
trunk/b2edit.php
r3 r12 20 20 } 21 21 22 $b2varstoreset = array('action','safe_mode','withcomments','c','posts','poststart','postend','content','edited_post_title','comment_error','profile', 'trackback_url' );22 $b2varstoreset = array('action','safe_mode','withcomments','c','posts','poststart','postend','content','edited_post_title','comment_error','profile', 'trackback_url', 'excerpt'); 23 23 for ($i=0; $i<count($b2varstoreset); $i += 1) { 24 24 $b2var = $b2varstoreset[$i]; … … 47 47 $content = balanceTags($HTTP_POST_VARS["content"]); 48 48 $content = format_to_post($content); 49 $excerpt = balanceTags($HTTP_POST_VARS["excerpt"]); 50 $excerpt = format_to_post($excerpt); 49 51 $post_title = addslashes($HTTP_POST_VARS["post_title"]); 50 52 $post_category = intval($HTTP_POST_VARS["post_category"]); … … 69 71 } 70 72 71 $query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category ) VALUES ('0','$user_ID','$now','$content','".$post_title."','".$post_category."')";73 $query = "INSERT INTO $tableposts (ID, post_author, post_date, post_content, post_title, post_category, post_excerpt) VALUES ('0','$user_ID','$now','$content','".$post_title."','".$post_category."','".$excerpt."')"; 72 74 $result = mysql_query($query) or mysql_oops($query); 73 75 … … 129 131 $content = $postdata["Content"]; 130 132 $content = format_to_edit($content); 133 $excerpt = $postdata["Excerpt"]; 134 $excerpt = format_to_edit($excerpt); 131 135 $edited_post_title = format_to_edit($postdata["Title"]); 132 136 … … 160 164 $content = balanceTags($HTTP_POST_VARS["content"]); 161 165 $content = format_to_post($content); 166 $excerpt = balanceTags($HTTP_POST_VARS["excerpt"]); 167 $excerpt = format_to_post($excerpt); 162 168 $post_title = addslashes($HTTP_POST_VARS["post_title"]); 163 169 … … 178 184 } 179 185 180 $query = "UPDATE $tableposts SET post_content=\"$content\", post_ title=\"$post_title\", post_category=\"$post_category\"".$datemodif." WHERE ID=$post_ID";186 $query = "UPDATE $tableposts SET post_content=\"$content\", post_excerpt=\"$excerpt\", post_title=\"$post_title\", post_category=\"$post_category\"".$datemodif." WHERE ID=$post_ID"; 181 187 $result = mysql_query($query) or mysql_oops($query); 182 188 -
trunk/index.php
r5 r12 37 37 38 38 <div class="storyContent"> 39 <div class="storyExcerpt"> 40 <?php the_excerpt(); ?> 41 </div> 39 42 <?php the_content(); ?> 40 43 -
trunk/layout2b.css
r3 r12 64 64 #content>.storyContent+.storyContent {text-indent:30px;} 65 65 66 .storyExcerpt { 67 font:12px/18px verdana, arial, helvetica, sans-serif; 68 font-weight: bold; 69 } 66 70 67 71 a {
Note: See TracChangeset
for help on using the changeset viewer.