Changeset 323
- Timestamp:
- 08/20/03 22:59:20 (5 years ago)
- Files:
-
- trunk/b2-include/b2template.functions.php (modified) (3 diffs)
- trunk/wp-pass.php (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/b2-include/b2template.functions.php
r308 r323 523 523 global $id, $post; 524 524 $output = stripslashes($post->post_title); 525 return($output); 525 if (!empty($post->post_password)) { // if there's a password 526 $output = 'Protected: ' . $output; 527 } 528 return $output; 526 529 } 527 530 … … 581 584 function get_the_content($more_link_text='(more...)', $stripteaser=0, $more_file='') { 582 585 global $id, $post, $more, $c, $withcomments, $page, $pages, $multipage, $numpages; 583 global $HTTP_SERVER_VARS, $ preview;586 global $HTTP_SERVER_VARS, $HTTP_COOKIE_VARS, $preview; 584 587 global $querystring_start, $querystring_equal, $querystring_separator; 585 588 global $pagenow; 586 589 $output = ''; 590 591 if (!empty($post->post_password)) { // if there's a password 592 if ($HTTP_COOKIE_VARS['wp-postpass'] != $post->post_password) { // and it doesn't match the cookie 593 $output = "<form action='$siteurl/wp-pass.php' method='post'> 594 <p>This post is password protected. To view it please enter your password below:</p> 595 <p><label>Password: <input name='post_password' type='text' size='20' /></label> <input type='submit' name='Submit' value='Submit' /></p> 596 </form> 597 "; 598 return $output; 599 } 600 } 601 587 602 if ($more_file != '') { 588 603 $file = $more_file; … … 667 682 function get_the_excerpt($fakeit = false) { 668 683 global $id, $post; 669 global $HTTP_SERVER_VARS, $ preview;684 global $HTTP_SERVER_VARS, $HTTP_COOKIE_VARS, $preview; 670 685 $output = ''; 671 686 $output = $post->post_excerpt; 687 if (!empty($post->post_password)) { // if there's a password 688 if ($HTTP_COOKIE_VARS['wp-postpass'] != $post->post_password) { // and it doesn't match the cookie 689 $output = "There is no excerpt because this is a protected post."; 690 return $output; 691 } 692 } 672 693 //if we haven't got an excerpt, make one in the style of the rss ones 673 694 if (($output == '') && $fakeit) {
