本文整理汇总了PHP中et_the_time函数的典型用法代码示例。如果您正苦于以下问题:PHP et_the_time函数的具体用法?PHP et_the_time怎么用?PHP et_the_time使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了et_the_time函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: convert
public static function convert($comment)
{
global $current_user;
$result = (object) $comment;
$childs = get_children(array('post_parent' => $result->comment_ID));
$author = get_user_by('id', $comment->user_id);
$result->id = $result->comment_ID;
$result->et_votes = get_comment_meta($result->comment_ID, 'et_votes');
$result->et_votes_count = !empty($result->et_votes) ? count($result->et_votes) : 0;
$result->content_filter = apply_filters('the_content', $result->comment_content);
$result->content_edit = et_the_content_edit($comment->comment_content);
$result->avatar = et_get_avatar($result->user_id ? $result->user_id : $result->comment_author_email, 30);
$result->human_date = et_the_time(strtotime($result->comment_date));
$result->total_childs = sprintf(__('Comment(%d) ', ET_DOMAIN), count($childs));
$result->new_nonce = wp_create_nonce('insert_comment');
$result->author = $author->display_name;
$result->author_url = get_author_posts_url($author->ID);
return $result;
}
开发者ID:callmeaatrey,项目名称:zap-query,代码行数:19,代码来源:questions.php
示例2: et_the_time
<?php
global $post;
$question = QA_Questions::convert($post);
$et_post_date = et_the_time(strtotime($question->post_date));
$category = !empty($question->question_category[0]) ? $question->question_category[0]->name : __('No Category', ET_DOMAIN);
$category_link = !empty($question->question_category[0]) ? get_term_link($question->question_category[0]->term_id, 'question_category') : '#';
?>
<li <?php
post_class('question-item pending-question');
?>
data-id="<?php
echo $post->ID;
?>
">
<div class="col-md-8 col-xs-8 q-left-content">
<div class="q-ltop-content">
<a href="<?php
the_permalink();
?>
" class="question-title">
<?php
the_title();
?>
</a>
</div>
<div class="q-lbtm-content">
<div class="question-excerpt">
<?php
the_excerpt();
?>
开发者ID:callmeaatrey,项目名称:zap-query,代码行数:31,代码来源:pending-question-loop.php
示例3: convert
/**
* convert comments
*/
function convert($comment, $thumb = 'thumbnail', $merge_post = true, $merge_author = true)
{
global $ae_post_factory;
/**
* add comment meta
*/
if (!empty($this->meta)) {
foreach ($this->meta as $key => $value) {
$comment->{$value} = get_comment_meta($comment->comment_ID, $value, true);
}
}
// comment link
$comment->comment_link = get_comment_link($comment->comment_ID);
$comment->ID = $comment->comment_ID;
$comment->id = $comment->comment_ID;
// caculate date ago
$comment->date_ago = et_the_time(strtotime($comment->comment_date));
if ($merge_post) {
/**
* add post data to comment
*/
if (!isset($this->post_arr[$comment->comment_post_ID])) {
// check post exist or not
$post = get_post($comment->comment_post_ID);
if ($post && !is_wp_error($post)) {
// get register post object by post factory
$post_object = $ae_post_factory->get($post->post_type);
// if not null convert post
if ($post_object) {
$comment->post_data = $post_object->convert($post, $thumb, false);
} else {
// keep the simple post
$comment->post_data = $post;
}
// add post data to post_arr
$this->post_arr[$post->ID] = $comment->post_data;
}
} else {
// post data already exist
$comment->post_data = $this->post_arr[$comment->comment_post_ID];
}
}
if ($merge_author) {
/**
* add author data to comment
*/
if (!isset($this->author_arr[$comment->user_id])) {
// user_id not existed in author_arr
$author = get_userdata($comment->user_id);
if ($author) {
$users = AE_Users::get_instance();
$comment->author_data = $users->convert($author);
// add author_data to author_arr
$this->author_arr[$comment->user_id] = $comment->author_data;
}
} else {
// author data already exist
$comment->author_data = $this->author_arr[$comment->user_id];
}
}
$this->current_comment = $comment;
return apply_filters('ae_convert_comment', $this->current_comment);
}
开发者ID:linniepinski,项目名称:perssistant,代码行数:66,代码来源:class-ae-comments.php
示例4: _e
?>
</div>
<?php
if ($answer->ID == $question->et_best_answer) {
?>
<p class="alert-stt-answer-style">
<i class="fa fa-check-circle"></i>
<?php
_e("This answer accepted by", ET_DOMAIN);
?>
<a href="javascript:void(0)"><?php
the_author_meta('display_name', $question->post_author);
?>
</a>.
<?php
echo et_the_time(strtotime(get_post_meta($answer->ID, 'et_is_best_answer', true)));
?>
<?php
printf(__("Earned %d points.", ET_DOMAIN), $badge_points->a_accepted);
?>
</p>
<?php
}
?>
</div>
</div><!-- end left content -->
<div class="col-md-4 q-right-content">
<ul class="question-statistic">
<li>
<a href="javascript:void(0)" class="action" data-name="approve">
<span class="question-views">
开发者ID:rinodung,项目名称:wp-question,代码行数:31,代码来源:pending-answer-loop.php
示例5: et_the_time
<?php
global $post;
$answer = QA_Answers::convert($post);
$question = QA_Questions::convert(get_post($answer->post_parent));
$et_post_date = et_the_time(strtotime($answer->post_date));
$badge_points = qa_get_badge_point();
$category = !empty($question->question_category[0]) ? $question->question_category[0]->name : __('No Category', ET_DOMAIN);
$category_link = !empty($question->question_category[0]) ? get_term_link($question->question_category[0]->term_id, 'question_category') : '#';
?>
<li <?php
post_class('question-item');
?>
data-id="<?php
echo $post->ID;
?>
">
<div class="avatar-user">
<a href="<?php
the_permalink();
?>
">
<?php
echo et_get_avatar($post->post_author, 55);
?>
</a>
</div>
<div class="info-user">
<?php
qa_user_badge($post->post_author, true, true);
?>
开发者ID:rinodung,项目名称:wp-question,代码行数:31,代码来源:answer-loop.php
示例6: et_get_avatar
<span class="author-avatar">
<?php
echo et_get_avatar($qa_answer->post_author, 30);
?>
</span>
<span class="author-name"><?php
echo $qa_answer->author_name;
?>
</span>
</a>
<?php
qa_user_badge($qa_answer->post_author);
?>
<span class="question-time">
<?php
printf(__('Answered %s.', ET_DOMAIN), et_the_time(strtotime($qa_answer->post_date)));
?>
</span>
</div>
<!--// Answer owner infomation -->
<div class="col-md-4 col-xs-4 question-control">
<!-- share comment , report -->
<ul>
<li>
<a class="share-social" href="javascript:void(0);" data-toggle="popover" data-placement="top" data-container="body" data-content='<?php
echo qa_template_share($qa_answer->ID);
?>
' data-html="true">
<?php
_e("Share", ET_DOMAIN);
开发者ID:rinodung,项目名称:wp-question,代码行数:31,代码来源:item-answer.php
示例7: qa_list_changelog
//.........这里部分代码省略.........
$text = __("You voted down question %s.", ET_DOMAIN);
}
$i = '<i class="fa fa-thumbs-down"></i>';
break;
case 'post_question':
$text = __("You asked %s.", ET_DOMAIN);
$i = '<i class="fa fa-question-circle"></i>';
break;
case 'edit_question':
if ($log->qa_be_voted == $user_ID && $log->qa_be_voted != $log->qa_voted_by) {
$text = __("Your question %s was edited.", ET_DOMAIN);
} else {
$text = __("You edited question %s.", ET_DOMAIN);
}
$i = '<i class="fa fa-question-circle"></i>';
break;
case 'post_answer':
$text = __("You answered question %s.", ET_DOMAIN);
$i = '<i class="fa fa-comments"></i>';
break;
case 'edit_answer':
if ($log->qa_be_voted == $user_ID && $log->qa_be_voted != $log->qa_voted_by) {
$text = __("Your answer on question %s was edited.", ET_DOMAIN);
} else {
$text = __("You edited answer on question %s.", ET_DOMAIN);
}
$i = '<i class="fa fa-comments"></i>';
break;
case 'q_unvote':
if ($log->qa_be_voted == $user_ID) {
$text = __("Your question %s was unvoted.", ET_DOMAIN);
} else {
$text = __("You unvoted question %s.", ET_DOMAIN);
}
$i = '<i class="fa fa-undo"></i>';
break;
case 'a_unvote':
if ($log->qa_be_voted == $user_ID) {
$text = __("Your answer on question %s was unvoted.", ET_DOMAIN);
} else {
$text = __("Your unvoted an answer on question %s.", ET_DOMAIN);
}
$i = '<i class="fa fa-undo"></i>';
break;
case 'a_marked':
if ($log->qa_be_voted == $user_ID) {
$text = __("Your answer on question %s was marked as the accepted answer.", ET_DOMAIN);
} else {
$text = __("You marked question %s was answered.", ET_DOMAIN);
}
$i = '<i class="fa fa-check-circle"></i>';
break;
case 'a_unmarked':
if ($log->qa_be_voted == $user_ID) {
$text = __("Your best answer on question %s was unaccepted.", ET_DOMAIN);
} else {
$text = __("You changed the best answer on question %s.", ET_DOMAIN);
}
$i = '<i class="fa fa-undo"></i>';
break;
default:
$text = '';
break;
}
$link = '';
if (!empty($parent)) {
if ($parent->post_type == 'answer') {
$permalink = get_permalink($parent->post_parent);
$link = '<a href="' . $permalink . '">' . get_the_title($parent->post_parent) . '</a>';
} else {
$permalink = get_permalink($parent->ID);
$link = '<a href="' . $permalink . '">' . get_the_title($parent->ID) . '</a>';
}
}
?>
<li>
<?php
echo $i;
?>
<span>
<?php
printf($text, $link);
?>
<br>
<span class="time-activity">
<?php
echo et_the_time(strtotime($post->post_date));
?>
</span>
</span>
</li>
<?php
}
?>
</ul>
<?php
}
wp_reset_query();
}
开发者ID:rinodung,项目名称:wp-question,代码行数:101,代码来源:changelog.php
注:本文中的et_the_time函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论