コード例 #1
0
ファイル: functions.php プロジェクト: jackycgq/tinection-pro
function tin_post_meta($special = 0)
{
    $thelayout = the_layout();
    if (is_singular()) {
        ?>
	<div id="single-meta">
		<span class="single-meta-author"><i class="fa fa-user">&nbsp;</i><?php 
        the_author_posts_link();
        ?>
</span>
		<span class="single-meta-time"><i class="fa fa-calendar">&nbsp;</i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<?php 
        if (is_single()) {
            ?>
<span class="single-meta-category"><i class="fa fa-folder-open">&nbsp;</i><?php 
            the_category(' ', '');
            ?>
</span><?php 
        }
        ?>
		<?php 
        if (current_user_can('level_7')) {
            ?>
<span class="single-meta-edit"><i class="fa fa-edit">&nbsp;</i><?php 
            edit_post_link(__(' 编辑 ', 'tinection'));
            ?>
</span><?php 
        }
        ?>
		<span class="single-meta-comments"><?php 
        if (comments_open()) {
            ?>
|&nbsp;&nbsp;<i class="fa fa-comments"></i>&nbsp;<a href="#" class="commentbtn"><?php 
            comments_number(__('抢沙发', 'tinection'), __('1 条评论', 'tinection'), __('% 条评论', 'tinection'));
            ?>
</a><?php 
        } else {
            ?>
|&nbsp;<i class="fa fa-comments"></i><?php 
            _e(' 评论关闭', 'tinection');
        }
        ?>
</span>
		<span class="single-meta-views"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
&nbsp;</span>
	</div>
	<?php 
    } elseif (is_search() || is_home() && $thelayout == 'blog' || is_category() && $special == 0 || is_tag() || is_date()) {
        ?>
	<div class="meta">
		<?php 
        if (!is_category()) {
            ?>
<span class="postlist-meta-cat"><i class="fa fa-bookmark"></i><?php 
            the_category(' ', false);
            ?>
</span><?php 
        }
        ?>
		<span class="postlist-meta-time"><i class="fa fa-calendar"></i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<span class="postlist-meta-views"><i class="fa fa-fire"></i><?php 
        echo '浏览: ' . get_tin_traffic('single', get_the_ID());
        ?>
</span>
		<span class="postlist-meta-comments"><?php 
        if (comments_open()) {
            ?>
<i class="fa fa-comments"></i><a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('<span>评论: </span>0', 'tinection'), __('<span>评论: </span>1', 'tinection'), __('<span>评论: </span>%', 'tinection'));
            ?>
</a><?php 
        }
        ?>
</span>
	</div>
	<?php 
    } elseif (is_home() || is_category() && $special == 1) {
        ?>
	<div class="postlist-meta">
		<div class="postlist-meta-time"><i class="fa fa-calendar"></i>&nbsp;<?php 
        echo date('Y-m-j', get_the_time('U'));
        ?>
</div>
		<div class="postlist-meta-views" style="float:right;"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
</div>
		<?php 
        get_template_part('includes/like_collect_meta');
        ?>
	</div>
	<?php 
    } else {
        ?>
	<div id="single-meta">
		<span class="single-meta-author"><i class="fa fa-user">&nbsp;</i><?php 
        the_author_posts_link();
        ?>
</span>
		<span class="single-meta-edit"><?php 
        edit_post_link(__(' 编辑 ', 'tinection'));
        ?>
</span>
		<span class="single-meta-time"><i class="fa fa-calendar">&nbsp;</i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
		<span class="single-meta-comments"><?php 
        if (comments_open()) {
            ?>
|&nbsp;&nbsp;<i class="fa fa-comments"></i>&nbsp;<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('0 条评论', 'tinection'), __('1 条评论', 'tinection'), __('% 条评论', 'tinection'));
            ?>
</a><?php 
        } else {
            ?>
|&nbsp;<i class="fa fa-comments"></i><?php 
            _e(' 评论关闭', 'tinection');
        }
        ?>
</span>
		<span class="single-meta-views"><i class="fa fa-fire"></i>&nbsp;<?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
&nbsp;</span>
	</div>
	<?php 
    }
}
コード例 #2
0
ファイル: catlist_bar_4.php プロジェクト: surperone/Tinection
" title="<?php 
        the_title();
        ?>
"><?php 
        the_title();
        ?>
</a></h3>
	</div>
	<div class="postlist-meta">
		<span class="postlist-meta-time"><?php 
        echo date('Y-m-j', get_the_time('U'));
        ?>
</span>
		<span class="delim"></span>
		<span class="postlist-meta-views"><?php 
        echo get_tin_traffic('single', get_the_ID());
        ?>
&nbsp;℃</span>
		<span class="delim"></span>
		<span class="postlist-meta-comments"><?php 
        if (comments_open()) {
            ?>
<i class="fa fa-comments"></i>&nbsp;&nbsp;<a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number('0', '1', '%');
            ?>
</a><?php 
        }
        ?>
コード例 #3
0
        $imgsrc = $large_image_url[0];
    } else {
        $imgsrc = catch_first_image();
    }
    ?>
					<img src="<?php 
    echo tin_thumb_source($imgsrc, 360, 300);
    ?>
" alt="<?php 
    the_title();
    ?>
">
					<div class="view-share">
						<p class="view"><?php 
    _e('人气:', 'tinection');
    echo get_tin_traffic('single', $post->ID);
    ?>
</p>
						<div class="share">
							<div id="bdshare" class="bdshare_t get-codes-bdshare baidu-share" data-bd-bind="1421241759771"><span><?php 
    _e('分享:', 'tinection');
    ?>
</span>
								<a href="#" class="bds_qzone" data-cmd="qzone" title="<?php 
    _e('分享到QQ空间', 'tinection');
    ?>
"></a>
								<a href="#" class="bds_tsina" data-cmd="tsina" title="<?php 
    _e('分享到新浪微博', 'tinection');
    ?>
"></a>
コード例 #4
0
ファイル: newsletter.php プロジェクト: surperone/Tinection
function newsletter_posts_issue($issue, $show_browser_link = 0)
{
    date_default_timezone_set('Asia/Shanghai');
    global $wpdb;
    $issue_posts = get_tin_meta('issue');
    $issue_posts = explode(',', $issue_posts);
    $issue--;
    $the_issue_posts = isset($issue_posts[$issue]) ? $issue_posts[$issue] : '';
    $the_issue_posts_array = explode('|', $the_issue_posts);
    $the_issue_posts_str = implode(',', $the_issue_posts_array);
    $num = $issue + 1;
    $para = '邮件订阅-issue#' . $num;
    $html = tin_newsletter_html_head($para);
    if (!empty($the_issue_posts)) {
        $newsletter_posts = $wpdb->get_results("SELECT DISTINCT {$wpdb->posts}.* FROM {$wpdb->posts} WHERE post_type = 'post' AND post_status = 'publish' AND id IN ({$the_issue_posts_str}) ORDER BY post_date DESC");
        foreach ($newsletter_posts as $post) {
            $post_id = $post->ID;
            $post_date = get_the_date('Y-m-j h:i:s', $post);
            $post_cat = get_the_category($post);
            $post_views = get_tin_traffic('single', $post_id);
            $post_comments = $post->comment_count;
            $post_title = get_the_title($post);
            $post_url = get_permalink($post);
            $post_excerpt = wp_trim_words($post->post_content, 120);
            $pre_match_images = preg_match_all('/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', $post->post_content, $matches);
            $first_image = $matches[1][0];
            $random = mt_rand(1, 25);
            if (has_post_thumbnail($post_id)) {
                $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id($post_id));
                $thumbnail = $thumbnail[0];
            } elseif (!empty($first_image)) {
                $thumbnail = $first_image;
            } else {
                $thumbnail = get_bloginfo('stylesheet_directory') . '/images/random/' . $random . '.jpg';
            }
            $html .= newsletter_posts_loop_template($post_title, $post_url, $post_excerpt, $thumbnail, $post_date, $post_cat, $post_views, $post_comments);
        }
        $html .= '</div>';
    } else {
        $html .= '<div style="height:20px;margin-bottom:20px;padding:0 10px;">未找到相关内容!</div>';
    }
    if ($show_browser_link != 0) {
        $issue_num = $num;
    } else {
        $issue_num = $show_browser_link;
    }
    $html .= tin_newsletter_html_foot('issue', $issue_num);
    return $html;
}
コード例 #5
0
        echo ot_get_option('singletopad');
        ?>
		</div>
		<?php 
    }
    ?>
		<div class="downmid">
			<div class="downld">
				<div class="downld-meta">
					<a><?php 
    _e('文件列表  ', 'tinection');
    ?>
</a>
					<span class="downld-meta-hot"><?php 
    _e('|  热度: ', 'tinection');
    echo get_tin_traffic('single', $pid);
    ?>
&nbsp;℃&nbsp;&nbsp;|</span>
					<span class="downld-meta-date"><?php 
    _e('  生产日期: ', 'tinection');
    echo $post->post_date;
    ?>
</span>
				</div>
				<div class="downldlinks sg-dl">
					<div class="downldlinks-inner" pid="<?php 
    echo $pid;
    ?>
" uid = "<?php 
    echo $uid;
    ?>
コード例 #6
0
	
		<article class="clr col-small">
			<h3>
				<span class="num"><?php 
                echo $i;
                ?>
</span>
				<?php 
                echo '<a href="' . $post_url . '" title="' . $post_title . '">' . $post_title . '</a>';
                ?>
				<span class="date"><?php 
                echo $post_date;
                ?>
</span>
				<span class="views"><?php 
                echo sprintf(__('浏览(%1$s)', 'tinection'), get_tin_traffic('single', get_the_ID()));
                ?>
</span>
				<span class="comments"><?php 
                if (comments_open()) {
                    comments_number(__('评论(0)', 'tinection'), __('评论(1)', 'tinection'), __('评论(%)', 'tinection'));
                } else {
                    _e('评论关闭', 'tinection');
                }
                ?>
</span>
			</h3>
		</article>		
	<?php 
            }
            ?>
コード例 #7
0
ファイル: page-articles.php プロジェクト: surperone/Tinection
        the_title();
        ?>
</a>
					</h3>
					<!-- Post meta -->
					<div class="meta">
						<span class="postlist-meta-cat"><i class="fa fa-bookmark"></i><?php 
        the_category(' ', false);
        ?>
</span>
						<span class="postlist-meta-time"><i class="fa fa-calendar"></i><?php 
        echo timeago(get_gmt_from_date(get_the_time('Y-m-d G:i:s')));
        ?>
</span>
						<span class="postlist-meta-views"><i class="fa fa-fire"></i><?php 
        echo '浏览: ' . get_tin_traffic('single', get_the_ID());
        ?>
</span>
						<span class="postlist-meta-comments"><?php 
        if (comments_open()) {
            ?>
<i class="fa fa-comments"></i><a href="<?php 
            comments_link();
            ?>
"><?php 
            comments_number(__('<span>评论: </span>0', 'tinection'), __('<span>评论: </span>1', 'tinection'), __('<span>评论: </span>%', 'tinection'));
            ?>
</a><?php 
        }
        ?>
</span>