本文整理汇总了PHP中comment_type函数的典型用法代码示例。如果您正苦于以下问题:PHP comment_type函数的具体用法?PHP comment_type怎么用?PHP comment_type使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了comment_type函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ks_list_comments
function ks_list_comments($comment, $args, $depth)
{
global $ks_settings;
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<dt><a name="comment-<?php
comment_ID();
?>
"><?php
if (!ks_option('ks_separate_comments')) {
?>
<font size="-1" color="<?php
echo $ks_settings['comment_color'];
?>
">[<?php
comment_type(_x('Comment', 'noun'), __('Trackback'), __('Pingback'));
?>
]</font><?php
}
?>
</a> <?php
ks_comment_content();
$html = array();
comment_reply_link(array_merge(array('before' => '<div>', 'after' => '</div>', 'reply_before' => '', 'reply_text' => '<img localsrc="149" alt="" />' . __('Reply'), 'login_text' => '<img localsrc="120" alt="" />' . __('Log in to Reply')), $args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
}
示例2: ks_comment_content
function ks_comment_content()
{
global $comment, $ks_settings;
?>
<img localsrc="<?php
comment_type(68, 112, 112);
?>
" alt="" /><?php
ks_comment_author_link();
?>
<img localsrc="46" alt=" @ " /><font color="<?php
echo $ks_settings['date_color'];
?>
"><?php
ks_comment_datetime();
?>
</font><br />
<?php
if ($comment->comment_approved == '0') {
?>
<em><font color="red"><?php
_e('Your comment is awaiting moderation.', 'ktai_style');
?>
</font></em><br />
<?php
}
comment_text();
edit_comment_link('<font color="' . $ks_settings['edit_color'] . '">' . __('Edit') . '</font>', '<div><img localsrc="104" alt="" />', '</div>');
}
示例3: andreas04_comment
function andreas04_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<li <?php
comment_class(empty($args['has_children']) ? '' : 'parent');
?>
id="comment-<?php
comment_ID();
?>
">
<div id="div-comment-<?php
comment_ID();
?>
">
<?php
comment_text();
?>
<p class="vcard"><cite>
<?php
if ($args['avatar_size'] != 0) {
echo get_avatar($comment, $args['avatar_size']);
}
?>
<?php
comment_type(__('Comment', 'andreas04'), __('Trackback', 'andreas04'), __('Pingback', 'andreas04'));
?>
<?php
_e('by', 'andreas04');
?>
<span class="fn"><?php
comment_author_link();
?>
</span> |
<?php
comment_date();
?>
<!-- @ <a href="#comment-<?php
comment_ID();
?>
"><?php
comment_time();
?>
</a> -->
<?php
edit_comment_link(__('Edit', 'andreas04'), ' | ');
?>
<?php
comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'before' => ' | ', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</cite></p>
</div>
<?php
}
示例4: custom_comment
function custom_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<li <?php
comment_class();
?>
id="comment-<?php
comment_ID();
?>
" >
<div class="c-grav"><?php
echo get_avatar(get_comment_author_email(), '40');
?>
</div>
<div class="c-body">
<div class="c-head">
<?php
comment_author_link();
?>
<span class="c-permalink"><a href="<?php
echo get_permalink();
?>
#comment-<?php
comment_ID();
?>
"><?php
_e('permalink', 'titan');
?>
</a></span>
</div>
<?php
if ($comment->comment_approved == '0') {
?>
<p><?php
_e('<em><strong>Please Note:</strong> Your comment is awaiting moderation.</em>', 'titan');
?>
</p>
<?php
}
?>
<?php
comment_text();
?>
<?php
comment_type('', 'Trackback', 'Pingback');
?>
<div class="reply">
<?php
echo comment_reply_link(array('depth' => $depth, 'max_depth' => $args['max_depth']));
?>
</div>
<?php
edit_comment_link(__('Edit', 'titan'));
?>
</div><!--end c-body-->
<?php
}
示例5: sdac_comment
function sdac_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<div class="commentBox <?php
comment_class();
?>
" id="li-comment-<?php
comment_ID();
?>
">
<div id="comment-<?php
comment_ID();
?>
">
<?php
if (function_exists('get_avatar')) {
echo get_avatar($comment, '40');
}
?>
<?php
comment_text();
?>
<i><?php
comment_type(__('Comment'), __('Trackback'), __('Pingback'));
?>
<?php
_e('by');
?>
<?php
comment_author_link();
?>
<?php
comment_date('m.d.y');
?>
@ <a href="#comment-<?php
comment_ID();
?>
"><?php
comment_time();
?>
</a> <?php
edit_comment_link(__("Edit This"), ' |');
?>
</i>
<p class="reply"> <?php
comment_reply_link(array_merge($args, array('depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</p>
</div>
</div>
<br />
<?php
}
示例6: supposedly_clean_comment
function supposedly_clean_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<li <?php
comment_class(empty($args['has_children']) ? '' : 'parent');
?>
id="comment-<?php
comment_ID();
?>
">
<div id="div-comment-<?php
comment_ID();
?>
" class="comment-author vcard">
<?php
if ($args['avatar_size'] != 0) {
echo get_avatar($comment, $args['avatar_size']);
}
?>
<?php
comment_text();
?>
<p><cite><?php
comment_type(__('Comment'), __('Trackback'), __('Pingback'));
?>
<?php
_e('by');
?>
<span class="fn"><?php
comment_author_link();
?>
</span> — <?php
comment_date();
?>
@ <a href="#comment-<?php
comment_ID();
?>
"><?php
comment_time();
?>
</a></cite> <?php
edit_comment_link(__("Edit This"), ' |');
?>
</p>
<div class="reply">
<?php
comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</div>
</div>
<?php
}
示例7: neo_sapien_05_comment
function neo_sapien_05_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<li <?php
comment_class(empty($args['has_children']) ? '' : 'parent');
?>
id="comment-<?php
comment_ID();
?>
">
<div id="div-comment-<?php
comment_ID();
?>
">
<div class="comment-author vcard comment-meta commentmetadata">
<?php
if ($args['avatar_size'] != 0) {
echo get_avatar($comment, $args['avatar_size']);
}
?>
<cite><?php
comment_type(__('Comment'), __('Trackback'), __('Pingback'));
?>
<?php
_e('by');
?>
<span class="fn"><?php
comment_author_link();
?>
</span> on <?php
comment_date();
?>
<a href="#comment-<?php
comment_ID();
?>
"><?php
comment_time();
?>
</a></cite>
</div>
<?php
comment_text();
?>
<div class="reply">
<?php
comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</div>
</div>
<?php
}
示例8: fauna_trackback
function fauna_trackback($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
?>
<? if ($comment->comment_type == "trackback" || $comment->comment_type == "pingback") { ?>
<? if (!$runonce) { $runonce = true; ?>
<h2 id="trackbacks"><?php
_e('Trackbacks & Pingbacks');
?>
</h2>
<? } ?>
<li><a name="comment-<?php
comment_ID();
?>
" href="<? echo($comment->comment_author_url); ?>" title="Visit <? echo($comment->comment_author); ?>">
<? if (function_exists('comment_favicon')) { comment_favicon($before='<img src="', $after='" alt="" class="trackback-avatar" />'); }; ?>
<strong><u><? echo($comment->comment_author); ?></u></strong>
<small>
<?php
comment_type(__('commented'), __('trackbacked'), __('pingbacked'));
?>
<?php
_e('on');
?>
<?php
if (function_exists('time_since')) {
echo time_since(abs(strtotime($comment->comment_date_gmt . " GMT")), time()) . " ago";
} else {
?>
<?php
comment_date();
?>
, <?php
comment_time();
}
?>
</small>
<?php
/* Trackback body text is disabled by default. To enable it, remove lines 22 and 24 of this file.
comment_text()
*/
?>
</a>
</li>
<?php
edit_comment_link(__("<li>Edit This</li>"));
?>
<? } ?>
<?php
}
示例9: classic_comment
function classic_comment($comment, $args, $depth)
{
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<li id="comment-<?php
comment_ID();
?>
">
<div id="div-comment-<?php
comment_ID();
?>
" class="vcard">
<?php
echo get_avatar($comment, 32);
?>
<?php
comment_text();
?>
<p><cite><?php
comment_type(__('Comment', 'classic'), __('Trackback', 'classic'), __('Pingback', 'classic'));
?>
<?php
_e('by', 'classic');
?>
<span class="fn"><?php
comment_author_link();
?>
</span> — <?php
comment_date();
?>
@ <a href="#comment-<?php
comment_ID();
?>
"><?php
comment_time();
?>
</a></cite> <?php
edit_comment_link(__('Edit This', 'classic'), ' | ');
?>
</p>
<div class="reply">
<?php
comment_reply_link(array_merge($args, array('add_below' => 'div-comment', 'depth' => $depth, 'max_depth' => $args['max_depth'])));
?>
</div>
</div>
<?php
}
示例10: wp_get_current_commenter
<?php
// this line is WordPress' motor, do not delete it.
$commenter = wp_get_current_commenter();
extract($commenter);
$comments = get_approved_comments($id);
$commentstatus = get_post($id);
if (!empty($commentstatus->post_password) && $_COOKIE['wp-postpass_'. COOKIEHASH] != $commentstatus->post_password) { // and it doesn't match the cookie
echo(get_the_password_form());
} else { ?>
<?php if ($comments) { ?>
<ol id="commentlist">
<?php foreach ($comments as $comment) { ?>
<li id="comment-<?php comment_ID() ?>">
<?php comment_text() ?>
<p><cite><?php comment_type(__('Comment'), __('Trackback'), __('Pingback')); ?> <?php _e("by"); ?> <?php comment_author_link() ?> — <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite></p>
</li>
<?php } // end for each comment ?>
</ol>
<?php } else { // this is displayed if there are no comments so far ?>
<p><?php _e("No comments yet."); ?></p>
<?php } ?>
<?php if ('open' == $commentstatus->comment_status) { ?>
<h2><?php _e("Leave a comment"); ?></h2>
<p><?php _e("Line and paragraph breaks automatic, e-mail address never displayed, <acronym title=\"Hypertext Markup Language\">HTML</acronym> allowed:"); ?> <code><?php echo allowed_tags(); ?></code></p>
<form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
<?php if ( $user_ID ) : ?>
<p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout »</a></p>
示例11: rtp_ping_list
/**
* Displays the Pingback/Trackback List
*
* @uses $rtp_post_comments Array
* @param Object $comment The Comment Objects
*
* @since rtPanel 2.0
*/
function rtp_ping_list($comment)
{
$GLOBALS['comment'] = $comment;
global $rtp_post_comments;
?>
<li id="comment-<?php
comment_ID();
?>
" <?php
comment_class();
?>
><?php
comment_author_link();
?>
<em>(<?php
comment_type(__('Comment', 'rtPanel'), __('Trackback', 'rtPanel'), __('Pingback', 'rtPanel'));
?>
)</em><?php
}
示例12: confirm
private function confirm($action)
{
global $comment;
$comment_id = intval($_GET['c']);
$formaction = $action . 'comment';
$nonce_action = 'approve' == $action ? 'approve-comment_' : 'delete-comment_';
$nonce_action .= $comment_id;
if (!($comment = get_comment_to_edit($comment_id))) {
$this->base->ks_die(__('Oops, no comment with this ID.') . sprintf(' <a href="%s">' . __('Go back') . '</a>', 'edit-comments.php'), '', false);
}
if (!current_user_can('edit_post', $comment->comment_post_ID)) {
$this->base->ks_die('delete' == $action ? __('You are not allowed to delete comments on this post.') : __('You are not allowed to edit comments on this post, so you cannot approve this comment.'));
}
include dirname(__FILE__) . '/admin-header.php';
switch ($action) {
case 'spam':
$message = __('You are about to mark the following comment as spam:');
break;
case 'trash':
$message = __('You are about to move the following comment to the Trash:', 'ktai_style');
break;
case 'delete':
$message = __('You are about to delete the following comment:');
break;
default:
$message = __('You are about to approve the following comment:');
break;
}
echo '<p><img localsrc="1" alt="" /><font color="red">' . $message . '</font><br />' . __('Are you sure you want to do this?') . '</p>';
?>
<form action="edit-comments.php" method="get">
<?php
$this->admin->sid_field();
?>
<div><input type="submit" value="<?php
_e('No');
?>
" /></div></form>
<form action="comment.php" method="get">
<?php
$this->admin->sid_field();
wp_nonce_field($nonce_action);
?>
<input type="hidden" name="action" value="<?php
echo esc_attr($formaction);
?>
" />
<input type="hidden" name="p" value="<?php
echo intval($comment->comment_post_ID);
?>
" />
<input type="hidden" name="c" value="<?php
echo intval($comment->comment_ID);
?>
" />
<input type="hidden" name="noredir" value="1" />
<div><input type="submit" value="<?php
_e('Yes');
?>
" /></div>
</form>
<dl><dt><img localsrc="<?php
comment_type(68, 112, 112);
?>
" alt="[<?php
comment_type(__('Comment', 'ktai_style'), __('Trackback'), __('Pingback'));
?>
] " /><?php
comment_author();
?>
<img localsrc="46" alt=" @ " /><font color="<?php
echo ks_option('ks_date_color');
?>
"><?php
ks_comment_datetime();
?>
</font></dt><dd><?php
if ($comment->comment_author_email) {
?>
<img localsrc="108" alt="" /><font color="olive"><?php
comment_author_email();
?>
</font><br /><?php
}
if ($comment->comment_author_url && 'http://' != $comment->comment_author_url) {
?>
<img localsrc="112" alt="" /><font color="olive"><?php
comment_author_url();
?>
</font><br /><?php
}
comment_excerpt();
?>
</dd></dl><?php
include dirname(__FILE__) . '/admin-footer.php';
}
示例13: start_el
/**
* @see Walker::start_lvl()
* @see Walker_Comment::start_el()
* @since 2.4
*
* @param string $output Passed by reference. Used to append additional content.
* @param object $comment Comment data object.
* @param int $depth Depth of comment in reference to parents.
* @param array $args
*/
function start_el(&$output, $comment, $depth, $args)
{
$depth++;
$GLOBALS['comment_depth'] = $depth;
if (!empty($args['callback'])) {
call_user_func($args['callback'], $comment, $args, $depth);
return;
}
$first = '';
if (isset($this->first_on_level) && $this->first_on_level) {
$first = 'comment-lvl-first';
}
$this->first_on_level = false;
$reply_link_opts = array_merge($args, array('add_below' => 'comment-wrapper', 'depth' => $depth, 'max_depth' => $args['max_depth'], 'before' => '<p class="reply">', 'after' => '</p>'));
$GLOBALS['comment'] = $comment;
extract($args, EXTR_SKIP);
?>
<li <?php
comment_class($first);
?>
id="comment-<?php
comment_ID();
?>
">
<div class="comment-wrapper clearfix" id="comment-wrapper-<?php
comment_ID();
?>
">
<?php
if (in_array(get_comment_type(), array('trackback', 'pingback', 'pings'))) {
?>
<p class="pingdata"><?php
printf(__('%1$s from %2$s on %3$s', 'tarski'), comment_type(_x('Comment', 'noun', 'tarski'), __('Trackback', 'tarski'), __('Pingback', 'tarski')), tarski_comment_author_link(), tarski_comment_link($comment, array('page' => $page)));
edit_comment_link(__('edit', 'tarski'), ' <span class="comment-edit">(', ')</span>');
?>
</p>
<?php
} else {
?>
<?php
if ($comment->comment_approved == '0') {
?>
<p class="moderated"><strong><?php
_e('Your comment is awaiting moderation.', 'tarski');
?>
</strong></p>
<?php
}
?>
<?php
echo tarski_avatar();
?>
<p class="comment-meta commentmetadata"><?php
printf(__('%1$s on %2$s', 'tarski'), '<span class="comment-author vcard">' . tarski_comment_author_link() . '</span>', '<span class="comment-permalink">' . tarski_comment_link($comment, array('page' => $page)) . '</span>');
edit_comment_link(__('edit', 'tarski'), ' <span class="comment-edit">(', ')</span>');
?>
</p>
<div class="comment-content content">
<?php
comment_text();
?>
</div>
<?php
comment_reply_link($reply_link_opts);
?>
<?php
}
?>
</div>
<?php
}
示例14: _e
</div>
<?php
if ($comment->comment_approved == '0') {
?>
<p><em><?php
_e('<strong>Please Note:</strong> Your comment is awaiting moderation.', 'vigilance');
?>
</em></p>
<?php
}
?>
<?php
comment_text();
?>
<?php
comment_type('', __('Trackback', 'vigilance'), __('Pingback', 'vigilance'));
?>
<?php
edit_comment_link(__('edit', 'vigilance'), '<p>', '</p>');
?>
</div>
</div>
<?php
/* Changes every other comment to a different class */
if ("alt" == $oddcomment) {
$oddcomment = "";
} else {
$oddcomment = "alt";
}
?>
示例15: foreach
<?php
if ($comments) {
?>
<ol id="commentlist">
<?php
foreach ($comments as $comment) {
?>
<li id="comment-<?php
comment_ID();
?>
">
<?php
comment_text();
?>
<p><cite><?php
comment_type('Comment', 'Trackback', 'Pingback');
?>
by <?php
comment_author_link();
?>
— <?php
comment_date();
?>
@ <a href="#comment-<?php
comment_ID();
?>
"><?php
comment_time();
?>
</a></cite></p>
</li>