moved the password form into its own function get_the_password_form() and added functions needed for the comments RSS feed
git-svn-id: http://svn.automattic.com/wordpress/trunk@394 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c4d859cca9
commit
737d3b5294
|
@ -487,6 +487,15 @@ function the_author_posts() {
|
||||||
|
|
||||||
/***** Post tags *****/
|
/***** Post tags *****/
|
||||||
|
|
||||||
|
function get_the_password_form() {
|
||||||
|
$output = "<form action='" . get_settings('siteurl') . "/wp-pass.php' method='post'>
|
||||||
|
<p>This post is password protected. To view it please enter your password below:</p>
|
||||||
|
<p><label>Password: <input name='post_password' type='text' size='20' /></label> <input type='submit' name='Submit' value='Submit' /></p>
|
||||||
|
</form>
|
||||||
|
";
|
||||||
|
return $output;
|
||||||
|
}
|
||||||
|
|
||||||
function the_ID() {
|
function the_ID() {
|
||||||
global $id;
|
global $id;
|
||||||
echo $id;
|
echo $id;
|
||||||
|
@ -596,11 +605,7 @@ function get_the_content($more_link_text='(more...)', $stripteaser=0, $more_file
|
||||||
|
|
||||||
if (!empty($post->post_password)) { // if there's a password
|
if (!empty($post->post_password)) { // if there's a password
|
||||||
if ($HTTP_COOKIE_VARS['wp-postpass'] != $post->post_password) { // and it doesn't match the cookie
|
if ($HTTP_COOKIE_VARS['wp-postpass'] != $post->post_password) { // and it doesn't match the cookie
|
||||||
$output = "<form action='" . get_settings('siteurl') . "/wp-pass.php' method='post'>
|
$output = get_the_password_form();
|
||||||
<p>This post is password protected. To view it please enter your password below:</p>
|
|
||||||
<p><label>Password: <input name='post_password' type='text' size='20' /></label> <input type='submit' name='Submit' value='Submit' /></p>
|
|
||||||
</form>
|
|
||||||
";
|
|
||||||
return $output;
|
return $output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -848,10 +853,6 @@ function next_post($format='%', $next='next post: ', $title='yes', $in_same_cat=
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function next_posts($max_page = 0) { // original by cfactor at cooltux.org
|
function next_posts($max_page = 0) { // original by cfactor at cooltux.org
|
||||||
global $HTTP_SERVER_VARS, $siteurl, $blogfilename, $p, $paged, $what_to_show, $pagenow;
|
global $HTTP_SERVER_VARS, $siteurl, $blogfilename, $p, $paged, $what_to_show, $pagenow;
|
||||||
global $querystring_start, $querystring_equal, $querystring_separator;
|
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||||
|
@ -1311,6 +1312,46 @@ function comment_time($d='') {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function comments_rss_link($link_text='Comments RSS', $commentsrssfilename = 'wp-commentsrss2.php') {
|
||||||
|
global $id;
|
||||||
|
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||||
|
$url = $commentsrssfilename.$querystring_start.'p'.$querystring_equal.$id;
|
||||||
|
$url = '<a href="'.$url.'">'.$link_text.'</a>';
|
||||||
|
echo $url;
|
||||||
|
}
|
||||||
|
|
||||||
|
function comment_author_rss() {
|
||||||
|
global $comment;
|
||||||
|
echo strip_tags(stripslashes($comment->comment_author));
|
||||||
|
}
|
||||||
|
|
||||||
|
function comment_text_rss() {
|
||||||
|
global $comment;
|
||||||
|
$comment_text = stripslashes($comment->comment_content);
|
||||||
|
$comment_text = str_replace('<trackback />', '', $comment_text);
|
||||||
|
$comment_text = str_replace('<pingback />', '', $comment_text);
|
||||||
|
$comment_text = convert_chars($comment_text);
|
||||||
|
$comment_text = convert_bbcode($comment_text);
|
||||||
|
$comment_text = convert_gmcode($comment_text);
|
||||||
|
$comment_text = convert_smilies($comment_text);
|
||||||
|
$comment_text = apply_filters('comment_text', $comment_text);
|
||||||
|
$comment_text = strip_tags($comment_text);
|
||||||
|
$comment_text = htmlspecialchars($comment_text);
|
||||||
|
echo $comment_text;
|
||||||
|
}
|
||||||
|
|
||||||
|
function comment_link_rss() {
|
||||||
|
global $comment,$postdata,$pagenow,$siteurl,$blogfilename;
|
||||||
|
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||||
|
echo $siteurl.'/'.$blogfilename.$querystring_start.'p'.$querystring_equal.$comment->comment_post_ID.$querystring_separator.'c'.$querystring_equal.'1#comments';
|
||||||
|
}
|
||||||
|
|
||||||
|
function permalink_comments_rss() {
|
||||||
|
global $comment,$postdata,$pagenow,$siteurl,$blogfilename;
|
||||||
|
global $querystring_start, $querystring_equal, $querystring_separator;
|
||||||
|
echo $siteurl.'/'.$blogfilename.$querystring_start.'p'.$querystring_equal.$comment->comment_post_ID.$querystring_separator.'c'.$querystring_equal.'1';
|
||||||
|
}
|
||||||
|
|
||||||
/***** // Comment tags *****/
|
/***** // Comment tags *****/
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue