当前位置: 首页>>代码示例>>PHP>>正文


PHP _hui函数代码示例

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


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

示例1: mo_post_link

/**
 * [mo_post_link description]
 * @return [type] [description]
 */
function mo_post_link()
{
    global $post;
    $post_ID = $post->ID;
    $link = get_post_meta($post_ID, 'link', true);
    if ($link) {
        echo '<div class="post-linkto"><a class="btn btn-primary" href="' . $link . '"' . (_hui('post_link_blank_s') ? ' target="_blank"' : '') . (_hui('post_link_nofollow_s') ? ' rel="external nofollow"' : '') . '>' . (is_single() ? '<i class="glyphicon glyphicon-share-alt"></i>' : '') . _hui('post_link_h1') . ' <i class="fa fa-hand-o-right"></i></a></div>';
    }
}
开发者ID:sunyang3721,项目名称:wdy-wordpress,代码行数:13,代码来源:mo_post_link.php

示例2: mo_post_link

/**
 * [mo_post_link description]
 * @return [type] [description]
 */
function mo_post_link()
{
    global $post;
    $post_ID = $post->ID;
    $link = get_post_meta($post_ID, 'link', true);
    if ($link) {
        echo '<div class="post-linkto"><a class="btn btn-primary' . (!is_single() ? ' btn-xs' : ' btn-lg') . '" href="' . $link . '"' . (_hui('post_link_blank_s') ? ' target="_blank"' : '') . (_hui('post_link_nofollow_s') ? ' rel="external nofollow"' : '') . '>' . _hui('post_link_h1') . '</a></div>';
    }
}
开发者ID:yszar,项目名称:linuxwp,代码行数:13,代码来源:mo_post_link.php

示例3: hui_recent_posts_most

function hui_recent_posts_most()
{
    global $wpdb;
    // $days=400;
    $days = _hui('most_list_date');
    $limit = _hui('most_list_number');
    $output = '';
    if (!_hui('most_list_style') || _hui('most_list_style') == 'comment') {
        $today = date("Y-m-d H:i:s");
        $daysago = date("Y-m-d H:i:s", strtotime($today) - $days * 24 * 60 * 60);
        $result = $wpdb->get_results("SELECT comment_count, ID, post_title, post_date FROM {$wpdb->posts} WHERE post_date BETWEEN '{$daysago}' AND '{$today}' AND post_status='publish' AND post_type='post' ORDER BY comment_count DESC LIMIT 0 , {$limit}");
        if (empty($result)) {
            $output = '<li>' . __('暂无文章!', 'haoui') . __('近期有评论的文章才会显示在这里,你也可以在主题设置中选择按阅读数排行。', 'haoui') . '</li>';
        } else {
            $i = 1;
            foreach ($result as $topten) {
                $postid = $topten->ID;
                $title = $topten->post_title;
                $commentcount = $topten->comment_count;
                if ($commentcount != 0) {
                    $output .= '<li><p class="text-muted"><span class="post-comments">' . __('评论', 'haoui') . ' (' . $commentcount . ')</span>' . hui_get_post_like($class = 'post-like', $pid = $postid) . '</p><span class="label label-' . $i . '">' . $i . '</span><a' . hui_target_blank() . ' href="' . get_permalink($postid) . '" title="' . $title . '">' . $title . '</a></li>';
                    $i++;
                }
            }
        }
    } else {
        if (_hui('most_list_style') == 'view') {
            global $post;
            $limit_date = current_time('timestamp') - $days * 86400;
            $limit_date = date("Y-m-d H:i:s", $limit_date);
            $where = '';
            $mode = 'post';
            if (!empty($mode) && $mode != 'both') {
                $where = "post_type = '{$mode}'";
            } else {
                $where = '1=1';
            }
            $most_viewed = $wpdb->get_results("SELECT DISTINCT {$wpdb->posts}.*, (meta_value+0) AS views FROM {$wpdb->posts} LEFT JOIN {$wpdb->postmeta} ON {$wpdb->postmeta}.post_id = {$wpdb->posts}.ID WHERE post_date < '" . current_time('mysql') . "' AND post_date > '" . $limit_date . "' AND {$where} AND post_status = 'publish' AND meta_key = 'views' AND post_password = '' ORDER  BY views DESC LIMIT {$limit}");
            if ($most_viewed) {
                $i = 1;
                foreach ($most_viewed as $post) {
                    $title = get_the_title();
                    $post_views = intval($post->views);
                    // $output .= '<li class="item-'.$i.'"><a target="_blank" href="'.get_permalink($postid).'">'._get_post_thumbnail(array()).'<h2>'.$post_title.'</h2><p>'.hui_get_post_date( get_the_time('Y-m-d H:i:s') ).'<span class="post-views">阅读('.$post_views.')</span></p></a></li>';
                    $output .= '<li><p class="text-muted"><span class="post-comments">' . __('阅读', 'haoui') . ' (' . $post_views . ')</span>' . hui_get_post_like($class = 'post-like', $pid = $postid) . '</p><span class="label label-' . $i . '">' . $i . '</span><a' . hui_target_blank() . ' href="' . get_permalink($postid) . '" title="' . $title . '">' . $title . '</a></li>';
                    $i++;
                }
            } else {
                $output = '<li>' . __('暂无文章!', 'haoui') . '</li>';
            }
        }
    }
    echo '<div class="most-comment-posts">
            <h3 class="title"><strong>' . _hui('most_list_title') . '</strong></h3>
            <ul>' . $output . '</ul>
        </div>';
}
开发者ID:yszar,项目名称:linuxwp,代码行数:57,代码来源:hui_recent_posts_most.php

示例4: mo_get_user_page

/**
 * [mo_get_user_page description]
 * @return [type] [description]
 */
function mo_get_user_page()
{
    $pid = _hui('user_page');
    if (!$pid) {
        return false;
    }
    if (get_permalink($pid)) {
        return get_permalink($pid);
    }
    return false;
}
开发者ID:sunyang3721,项目名称:wdy-wordpress,代码行数:15,代码来源:mo_get_user_page.php

示例5: hui_post_link

function hui_post_link()
{
    global $post;
    $post_ID = $post->ID;
    $link = get_post_meta($post_ID, 'link', true);
    $linktitle = get_post_meta($post_ID, 'linktitle', true);
    if ($link) {
        if ($linktitle) {
            echo '<a class="post-linkto' . (is_single() ? ' action' : '') . '" href="' . $link . '"' . (_hui('post_link_blank_s') ? ' target="_blank"' : '') . (_hui('post_link_nofollow_s') ? ' rel="external nofollow"' : '') . '>' . (is_single() ? '<i class="glyphicon glyphicon-share-alt"></i>' : '') . $linktitle . '</a>';
        } else {
            echo '<a class="post-linkto' . (is_single() ? ' action' : '') . '" href="' . $link . '"' . (_hui('post_link_blank_s') ? ' target="_blank"' : '') . (_hui('post_link_nofollow_s') ? ' rel="external nofollow"' : '') . '>' . (is_single() ? '<i class="glyphicon glyphicon-share-alt"></i>' : '') . _hui('post_link_h1') . '</a>';
        }
    }
}
开发者ID:veryer,项目名称:wordpress,代码行数:14,代码来源:xiu-theme-add-diy-link.php

示例6: hui_focusslide

function hui_focusslide()
{
    $indicators = '';
    $inner = '';
    $sort = _hui('focusslide_sort') ? _hui('focusslide_sort') : '1 2 3 4 5';
    $sort = array_unique(explode(' ', trim($sort)));
    $i = 0;
    foreach ($sort as $key => $value) {
        if (_hui('focusslide_src_' . $value) && _hui('focusslide_href_' . $value) && _hui('focusslide_title_' . $value)) {
            $indicators .= '<li data-target="#slider" data-slide-to="' . $i . '"' . (!$i ? ' class="active"' : '') . '></li>';
            $inner .= '<div class="item' . (!$i ? ' active' : '') . '"><a' . (_hui('focusslide_blank_' . $value) ? ' target="_blank"' : '') . ' href="' . _hui('focusslide_href_' . $value) . '"><img src="' . _hui('focusslide_src_' . $value) . '"><span class="carousel-caption">' . _hui('focusslide_title_' . $value) . '</span><span class="carousel-bg"></span></a></div>';
            $i++;
        }
    }
    echo '<div id="slider" class="carousel slide" data-ride="carousel"><ol class="carousel-indicators">' . $indicators . '</ol><div class="carousel-inner">' . $inner . '</div><a class="left carousel-control" href="#slider" role="button" data-slide="prev"><span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span></a><a class="right carousel-control" href="#slider" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span></a></div>';
}
开发者ID:yszar,项目名称:linuxwp,代码行数:16,代码来源:hui_focusslide.php

示例7: mo_minicat

/**
 * [mo_minicat description]
 * @return html [description]
 */
function mo_minicat()
{
    if (!_hui('minicat')) {
        return;
    }
    $args = array('ignore_sticky_posts' => 1, 'showposts' => 1, 'cat' => _hui('minicat'));
    query_posts($args);
    while (have_posts()) {
        the_post();
        $category = get_the_category();
        echo '<article class="excerpt-minic excerpt-minic-index">';
        echo '<h2><a' . _post_target_blank() . ' class="red" href="' . get_category_link($category[0]->term_id) . '">【' . (_hui('minicat_home_title') ? _hui('minicat_home_title') : '今日观点') . '】</a> <a href="' . get_permalink() . '" title="' . get_the_title() . _get_delimiter() . get_bloginfo('name') . '">' . get_the_title() . '</a></h2>';
        echo '<p class="note">' . _get_excerpt() . '</p>';
        echo '</article>';
    }
    wp_reset_query();
}
开发者ID:yszar,项目名称:linuxwp,代码行数:21,代码来源:mo_minicat.php

示例8: mo_slider

/**
 * [mo_slider description]
 * @param  string $id   [description]
 * @return html         [description]
 */
function mo_slider($id = 'slider')
{
    $indicators = '';
    $inner = '';
    $sort = _hui($id . '_sort') ? _hui($id . '_sort') : '1 2 3 4 5';
    $sort = array_unique(explode(' ', trim($sort)));
    $i = 0;
    foreach ($sort as $key => $value) {
        if (_hui($id . '_src_' . $value) && _hui($id . '_href_' . $value) && _hui($id . '_title_' . $value)) {
            $indicators .= '<li data-target="#' . $id . '" data-slide-to="' . $i . '"' . (!$i ? ' class="active"' : '') . '></li>';
            $inner .= '<div class="item' . (!$i ? ' active' : '') . '"><a' . (_hui($id . '_blank_' . $value) ? ' target="_blank"' : '') . ' href="' . _hui($id . '_href_' . $value) . '"><img src="' . _hui($id . '_src_' . $value) . '"></a></div>';
            // <span class="carousel-caption">'._hui($id.'_title_'.$value).'</span>
            $i++;
        }
    }
    echo '<div id="' . $id . '" class="carousel slide" data-ride="carousel"><ol class="carousel-indicators">' . $indicators . '</ol><div class="carousel-inner" role="listbox">' . $inner . '</div><a class="left carousel-control" href="#' . $id . '" role="button" data-slide="prev"><i class="fa fa-angle-left"></i></a><a class="right carousel-control" href="#' . $id . '" role="button" data-slide="next"><i class="fa fa-angle-right"></i></a></div>';
}
开发者ID:sunyang3721,项目名称:wdy-wordpress,代码行数:22,代码来源:mo_slider.php

示例9: hui_posts_focus

function hui_posts_focus()
{
    $html = '';
    $html .= '<li class="large"><a' . hui_target_blank() . ' href="' . _hui('focus_href') . '"><img class="thumb" data-original="' . _hui('focus_src') . '"><h4>' . _hui('focus_title') . '</h4></a></li>';
    $sticky = get_option('sticky_posts');
    rsort($sticky);
    query_posts(array('post__in' => $sticky, 'ignore_sticky_posts' => 1, 'showposts' => 4));
    if (have_posts()) {
        while (have_posts()) {
            the_post();
            $html .= '<li><a' . hui_target_blank() . ' href="' . get_permalink() . '">';
            $html .= hui_get_thumbnail();
            $html .= '<h4>' . get_the_title() . '</h4>';
            $html .= '</a></li>';
        }
    }
    wp_reset_query();
    echo '<div class="focusmo"><ul>' . $html . '</ul></div>';
}
开发者ID:yszar,项目名称:linuxwp,代码行数:19,代码来源:hui_posts_focus.php

示例10: hui_posts_sticky

function hui_posts_sticky()
{
    $title = _hui('sticky_title');
    $showposts = _hui('sticky_limit');
    $sticky = get_option('sticky_posts');
    rsort($sticky);
    query_posts(array('post__in' => $sticky, 'ignore_sticky_posts' => 1, 'showposts' => $showposts));
    if (have_posts()) {
        printf('<div class="sticky"><h3 class="title"><strong>' . $title . '</strong></h3><ul>');
        while (have_posts()) {
            the_post();
            echo '<li class="item"><a' . hui_target_blank() . ' href="' . get_permalink() . '">';
            echo hui_get_thumbnail();
            echo get_the_title();
            echo '</a></li>';
        }
        printf('</ul></div>');
    }
    wp_reset_query();
}
开发者ID:yszar,项目名称:linuxwp,代码行数:20,代码来源:hui_posts_sticky.php

示例11: mo_get_post_from

/**
 * [mo_get_post_from description]
 * @param  string $pid      [description]
 * @param  string $prevtext [description]
 * @return [type]           [description]
 */
function mo_get_post_from($pid = '', $prevtext = '来源:')
{
    if (!_hui('post_from_s')) {
        return;
    }
    if (!$pid) {
        $pid = get_the_ID();
    }
    $fromname = trim(get_post_meta($pid, "fromname_value", true));
    $fromurl = trim(get_post_meta($pid, "fromurl_value", true));
    $from = '';
    if ($fromname) {
        if ($fromurl && _hui('post_from_link_s')) {
            $from = '<a href="' . $fromurl . '" target="_blank" rel="external nofollow">' . $fromname . '</a>';
        } else {
            $from = $fromname;
        }
        $from = (_hui('post_from_h1') ? _hui('post_from_h1') : $prevtext) . $from;
    }
    return $from;
}
开发者ID:yszar,项目名称:linuxwp,代码行数:27,代码来源:mo_get_post_from.php

示例12: mo_is_minicat

/**
 * [mo_is_minicat description]
 * @return bool [description]
 */
function mo_is_minicat()
{
    if (!_hui('minicat_s')) {
        return false;
    }
    if (!_hui('minicat')) {
        return false;
    }
    if (is_category()) {
        global $wp_query;
        $cat_ID = get_query_var('cat');
    } else {
        if (!is_page()) {
            $category = get_the_category();
            $cat_ID = $category[0]->cat_ID;
        }
    }
    if ($cat_ID == _hui('minicat')) {
        return true;
    }
    return false;
}
开发者ID:yszar,项目名称:linuxwp,代码行数:26,代码来源:mo_is_minicat.php

示例13: the_time

    ?>
                <li>
                    <time><?php 
    the_time('d');
    ?>
日</time>
                    <a href="<?php 
    the_permalink();
    ?>
"><?php 
    the_title();
    ?>
 </a>
                    <span class="text-muted"><?php 
    echo hui_get_comment_number();
    ?>
</span>
                </li>
            <?php 
}
?>
            </ul>
        </div>
        </article>
    </div>
</div>
<?php 
if (_hui('archives_sidebar_s')) {
    get_sidebar();
}
get_footer();
开发者ID:sunyang3721,项目名称:wp-for-sae,代码行数:31,代码来源:archives.php

示例14: _hui

} else {
    if ((is_category() || is_tag() || is_search()) && _hui('sideroll_list_s')) {
        $roll = _hui('sideroll_list');
    } else {
        if (is_single() && _hui('sideroll_post_s')) {
            $roll = _hui('sideroll_post');
        } else {
            if (is_page() && _hui('sideroll_page_s')) {
                $roll = _hui('sideroll_page');
            }
        }
    }
}
$ajaxpager = '0';
if ((!wp_is_mobile() && _hui('ajaxpager_s') || wp_is_mobile() && _hui('ajaxpager_s_m')) && _hui('ajaxpager')) {
    $ajaxpager = _hui('ajaxpager');
}
?>
<script>
window.jui = {
	uri: '<?php 
echo THEME_URI;
?>
',
	roll: '<?php 
echo $roll;
?>
',
	ajaxpager: '<?php 
echo $ajaxpager;
?>
开发者ID:yszar,项目名称:linuxwp,代码行数:31,代码来源:footer.php

示例15: add_post_meta

        $data = $_POST[$meta_box['name']];
        if (get_post_meta($post_id, $meta_box['name']) == "") {
            add_post_meta($post_id, $meta_box['name'], $data, true);
        } elseif ($data != get_post_meta($post_id, $meta_box['name'], true)) {
            update_post_meta($post_id, $meta_box['name'], $data);
        } elseif ($data == "") {
            delete_post_meta($post_id, $meta_box['name'], get_post_meta($post_id, $meta_box['name'], true));
        }
    }
}
/* 
 * post meta link
 * ====================================================
*/
$postmeta_link = array(array("name" => "link", "std" => ""));
if (_hui('post_link_excerpt_s') || _hui('post_link_single_s')) {
    add_action('admin_menu', 'hui_postmeta_link_create');
    add_action('save_post', 'hui_postmeta_link_save');
}
function hui_postmeta_link()
{
    global $post, $postmeta_link;
    foreach ($postmeta_link as $meta_box) {
        $meta_box_value = get_post_meta($post->ID, $meta_box['name'], true);
        if ($meta_box_value == "") {
            $meta_box_value = $meta_box['std'];
        }
        echo '<p>' . $meta_box['title'] . '</p>';
        echo '<p><input type="text" style="width:98%" value="' . $meta_box_value . '" name="' . $meta_box['name'] . '"></p>';
    }
    echo '<input type="hidden" name="post_newmetaboxes_noncename" id="post_newmetaboxes_noncename" value="' . wp_create_nonce(plugin_basename(__FILE__)) . '" />';
开发者ID:yszar,项目名称:linuxwp,代码行数:31,代码来源:functions.admin.php


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