• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP setPostViews函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中setPostViews函数的典型用法代码示例。如果您正苦于以下问题:PHP setPostViews函数的具体用法?PHP setPostViews怎么用?PHP setPostViews使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了setPostViews函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: update_view

/**
 * call response ajax
 */
function update_view()
{
    $action = $_POST['action'];
    $id = $_POST['id'];
    switch ($action) {
        case 'update_view':
            setPostViews($id, 'view-news');
            break;
    }
    exit;
}
开发者ID:localymine,项目名称:sms-brandname,代码行数:14,代码来源:my_functions.php


示例2: get_template_part

<div class="row top">
	<div class="small-12 medium-8 columns" role="main">

				<?php 
    //if( is_singular( array('ercs','whitepapers','webinars','special-reports') )) {
    get_template_part('parts/flags');
    ?>

	<?php 
    do_action('foundationpress_before_content');
    ?>

	<?php 
    while (have_posts()) {
        the_post();
        setPostViews(get_the_ID());
        ?>

<?php 
        $astused = get_post_meta($id, '_wp_esmad_template', true);
        $oldtemplate = get_post_meta($id, '_wp_post_template', true);
        if (!$oldtemplate == 'default' and strlen($oldtemplate > 4)) {
            echo '<!-- old template' . $oldtemplate . ' -->';
            //using old template
            //require_once( 'library/boxes.php' );
            include 'single-coa.php';
        } else {
            ?>

		<article <?php 
            post_class();
开发者ID:esm-erika,项目名称:eschoolnews,代码行数:31,代码来源:single-staff.php


示例3: get_header

<?php

/*
Single Post Template: Review
*/
/**
 * The template for displaying review single posts.
 *
 * @package opengamer_theme
 */
get_header();
$post_id = $post->ID;
setPostViews($post_id);
?>
<style>
    #masthead {
        background: rgb(52, 168, 83);
    }

    .menu-item a {
        color: #fff;
        border-bottom: solid 2px rgb(52, 168, 83);
    }

    .menu-item a:hover {
        border-bottom: solid 2px #fff;
    }
</style>
<div id="primary" class="content-area">
    <main id="main" class="site-main" role="main">
开发者ID:Chudylo,项目名称:opengamer_theme,代码行数:30,代码来源:single-review.php


示例4: setPostViews

<?php

$ajaxVal = $_GET['ajax'];
if ($ajaxVal == "getPostViews") {
    setPostViews($_GET['postID']);
    echo getPostViews($_GET['postID']);
}
开发者ID:sdgdsffdsfff,项目名称:shipin,代码行数:7,代码来源:fo_ajax.php


示例5: countShits

function countShits()
{
    $corazones = $_GET['corazones'];
    setPostViews(4, $corazones);
    die;
}
开发者ID:joasssko,项目名称:CorridaVirtualCuprum,代码行数:6,代码来源:functions.php


示例6: the_view

function the_view()
{
    echo getPostViews(get_the_ID());
    if (is_single()) {
        setPostViews(get_the_ID());
    }
}
开发者ID:Nsking-xs,项目名称:rccoder,代码行数:7,代码来源:functions.php


示例7: themerex_callback_post_counter

 function themerex_callback_post_counter()
 {
     global $_REQUEST;
     if (!wp_verify_nonce($_REQUEST['nonce'], 'ajax_nonce')) {
         die;
     }
     $response = array('error' => '');
     $id = (int) $_REQUEST['post_id'];
     if (isset($_REQUEST['likes'])) {
         $counter = max(0, (int) $_REQUEST['likes']);
         setPostLikes($id, $counter);
     } else {
         if (isset($_REQUEST['views'])) {
             $counter = max(0, (int) $_REQUEST['views']);
             setPostViews($id, $counter);
         }
     }
     echo json_encode($response);
     die;
 }
开发者ID:amankatoch,项目名称:wp-plugin,代码行数:20,代码来源:functions.php


示例8: while

</div>

<div class="dt-sc-margin30"></div>

<div class="container">

    <!-- Primary Starts -->

    <section id="primary" class="content-full-width invt_det">

<?php 
while (have_posts()) {
    the_post();
    $timezone = +5.5;
    $date = gmdate("F d, Y H:i:s", time() + 3600 * ($timezone + date("I")));
    setPostViews(get_the_ID(), $date);
    ?>
    
            <input  type="hidden" name="showninterest" id="showninterest" value="0" />
            <div class="column dt-sc-one-fourth first" >
                <div class="id_logo">
                    <div class="portfolio-thumb">

    <?php 
    if (has_post_thumbnail()) {
        // $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ) );
        the_post_thumbnail();
    } else {
        $img = wp_get_attachment_image_src(693);
        echo "<img src='" . $img[0] . "' />";
    }
开发者ID:sushilcs111,项目名称:sourcesunlimited,代码行数:31,代码来源:single-startup.php


示例9: single_views

function single_views($postID)
{
    $count = setPostViews($postID);
    echo '&harr;' . $count . '次浏览';
}
开发者ID:ericzuobin,项目名称:luandun,代码行数:5,代码来源:functions.php


示例10: wp_get_attachment_url

if (has_post_thumbnail()) {
    ?>
            <div class="container-fluid article-hero-image">
                <?php 
    $postFeatured = wp_get_attachment_url(get_post_thumbnail_id($post->ID));
    ?>
                <img src="<?php 
    echo $postFeatured;
    ?>
" class="img-responsive">
            </div>
            <?php 
}
// set post views
$postId = get_the_ID();
setPostViews($postId);
?>

    <div class="container-fluid inner-page-content">
        <div class="container">
            <div class="row basic-page">
                <div class="col-md-9">
                    <article class="main-article">
                        <h1><?php 
the_title();
?>
</h1>
                        <div class="article-meta pull-left">
                            <div class="meta-title">SHARE</div>
                            <div class="social-buttons small">
                                <ul class="no-bullets inline">
开发者ID:AllFamous,项目名称:camella,代码行数:31,代码来源:template-news-and-articles.php


示例11: get_header

get_header('soms');
?>

<div class="category-news-block auto rek" style="  background-image: none !important; float:right !important; width:670px; margin-top:0px !important;">

<?php 
while ( have_posts() ) : the_post(); //стандартная итерация по массиву 
?>

<div style="background-color:#EEE; padding:20px;">
<h1 style="font-family:bandera_proregular; font-size:50px; border-bottom:0 !important; margin-bottom:0 !important;">
<?php the_title(); ?> 
</h1>

<h1 style="font-family:Verdana, Geneva, sans-serif; border-bottom: 0 !important; font-size:25px; margin:0; padding:0;">
<span style="font-size:10px; color:#333;"><?php echo get_date_formatted(get_the_date('d.m.Y.H.i')); ?></span> <span style="font-size:10px; color:#333;">&nbsp;&nbsp;&nbsp; Коментариев: <?php comments_number('0', '1', '%'); ?> &nbsp;&nbsp;&nbsp; Просмотров: <?php setPostViews(get_the_ID()); ?><?php echo getPostViews(get_the_ID()); ?></span>
</h1>

</div>


<div style="overflow:hidden;" class="single-som">
<?php the_content(); ?>
</div>

<br>
<script type="text/javascript">(function() {
  if (window.pluso)if (typeof window.pluso.start == "function") return;
  if (window.ifpluso==undefined) { window.ifpluso = 1;
    var d = document, s = d.createElement('script'), g = 'getElementsByTagName';
    s.type = 'text/javascript'; s.charset='UTF-8'; s.async = true;
开发者ID:TimurMG,项目名称:mg-red,代码行数:31,代码来源:single-som.php


示例12: get_header

<?php

/*
 * Author: KhangLe
 *
 */
get_header();
setPostViews($post->ID, 'view-news');
?>

<div class="container news margin-top-xl margin-bottom-xl">
    <div class="row">
        <div class="col-xs-12 col-md-2">
            <?php 
get_sidebar('news-left');
?>
        </div>
        <div class="col-xs-12 col-md-7">
            <article class="news-detail">
                <h2><span><?php 
echo $post->post_title;
?>
</span></h2>
                <p><?php 
echo $post->post_content;
?>
</p>
            </article>
        </div>
        <div class="col-xs-12 col-md-3">
            <?php 
开发者ID:localymine,项目名称:sms-brandname,代码行数:31,代码来源:single-news.php



注:本文中的setPostViews函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP setPref函数代码示例发布时间:2022-05-15
下一篇:
PHP setParam函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap