コード例 #1
0
ファイル: header.php プロジェクト: wdq233/BYMT2
        echo '搜点什么呢...';
    }
    ?>
" value="<?php 
    the_search_query();
    ?>
" autocomplete="off"<?php 
    if (bymt_c('custom_search_voice')) {
        echo ' x-webkit-speech x-webkit-grammar="builtin:translate"';
    }
    ?>
 />
				<ul id="search-cloud"<?php 
    if (bymt_c('ajax_search')) {
        echo ' data-cloudnum="';
        bymt_r('ajax_search_num', 'all');
        echo '"';
    }
    ?>
>
				</ul>
				<input type="submit" value="搜索" />
			</form>
		</div>
		<?php 
}
?>
	</div>
</div>
<?php 
if (bymt_c('sd_config_nav_ck')) {
コード例 #2
0
ファイル: functions.php プロジェクト: wdq233/BYMT2
function bymt_bulletin()
{
    echo '<i class="icon-sound"></i> ';
    if (bymt_c('ggid')) {
        $page_ID = bymt_c('ggid');
        $announcement = '';
        $comments = get_comments("number=1&post_id={$page_ID}");
        if (!empty($comments)) {
            foreach ($comments as $comment) {
                $id = $comment->comment_ID;
                if (current_user_can('level_10')) {
                    echo '<a href="' . get_page_link($page_ID) . '#respond" class="anno" rel="nofollow">(发表)</a> ';
                }
                echo '<span class="comment_text">' . convert_smilies($comment->comment_content) . '</span><span class="datetime" id="comm-' . $id . '"> (' . get_comment_date('m-d H:i', $comment->comment_ID) . ')</span>';
                if (bymt_c('ajax_ggdc') && !wp_is_mobile()) {
                    echo ' <span class="vote_up icon-up-1" id="up_' . $id . '" title="';
                    bymt_r('ajax_gg_d_t', '把持不住', 's');
                    echo '">' . get_comm_vote($id, 'up') . '</span> <span class="vote_down icon-down-1" id="down_' . $id . '" title="';
                    bymt_r('ajax_gg_c_t', '智商拙计', 's');
                    echo '">' . get_comm_vote($id, 'down') . '</span> <span class="vote_ok"></span>';
                }
            }
        } else {
            echo '欢迎光临' . esc_attr(get_bloginfo('name')) . '!';
        }
    } else {
        bymt_r('noticecontent', '欢迎光临' . esc_attr(get_bloginfo('name')) . '!');
    }
}
コード例 #3
0
ファイル: bymt-head.php プロジェクト: wdq233/BYMT2
function bymt_head()
{
    if (!isset($paged)) {
        $paged = 1;
    }
    echo "<title>";
    if (is_home()) {
        if (bymt_c('title_content')) {
            bymt('title_content', 'e');
            if ($paged > 1) {
                bymt_r('title_split', ' | ', 'e');
                printf('第%s页', $paged);
            }
        } else {
            esc_attr_e(bloginfo('name'));
            if ($paged > 1) {
                bymt_r('title_split', ' | ', 'e');
                printf('第%s页', $paged);
            }
            bymt_r('title_split', ' | ', 'e');
            esc_attr_e(bloginfo('description'));
        }
    } else {
        if (is_search()) {
            echo '"';
            the_search_query();
            echo '"的搜索结果';
        } elseif (is_single() || is_page()) {
            echo trim(wp_title('', 0));
        } elseif (is_category()) {
            single_cat_title();
        } elseif (is_year()) {
            the_time('Y年的文章');
        } elseif (is_month()) {
            the_time('Y年m月的文章');
        } elseif (is_day()) {
            the_time('Y年m月d日的文章');
        } elseif (is_404()) {
            echo '404错误:' . trim(wp_title('', 0));
        } elseif (is_author()) {
            global $author;
            $userdata = get_userdata($author);
            echo $userdata->display_name . '发表的文章';
        } elseif (function_exists('is_tag')) {
            if (is_tag()) {
                echo 'Tag:';
                single_tag_title("", true);
            }
        }
        if (get_query_var('page')) {
            bymt_r('title_split', ' | ', 'e');
            echo '第' . get_query_var('page') . '页';
        }
        if ($paged > 1) {
            bymt_r('title_split', ' | ', 'e');
            printf('第%s页', $paged);
        }
        bymt_r('title_split', ' | ', 'e');
        esc_attr_e(bloginfo('name'));
    }
    echo "</title>\n";
    global $post;
    if (is_singular()) {
        if ($post->post_excerpt) {
            $post_excerpt = $post->post_excerpt;
        } else {
            $post_excerpt = trim(preg_replace('/((\\s)*(\\n)+(\\s)*)/i', '', strip_tags($post->post_content)));
        }
        if (!empty($post_excerpt)) {
            $description = mb_substr($post_excerpt, 0, 200, 'UTF-8');
            $description .= mb_strlen($post_excerpt, 'UTF-8') > 200 ? '...' : '';
        } else {
            $description = trim(wp_title('', 0));
        }
        $tags = wp_get_post_tags($post->ID);
        if (empty($tags)) {
            $keywords = trim(wp_title('', 0));
        } else {
            $keywords = '';
        }
        foreach ($tags as $tag) {
            $keywords = $keywords . $tag->name . ",";
        }
    } elseif (is_home()) {
        $keywords = bymt_c('keyword_content');
        $description = bymt_c('description_content');
    } elseif (is_category()) {
        $keywords = single_cat_title('', false);
        $description = category_description();
    } elseif (is_tag()) {
        $keywords = single_tag_title('', false);
        $description = tag_description();
    }
    if (!isset($keywords)) {
        $keywords = '';
    }
    if (!isset($description)) {
        $description = '';
    }
    $keywords = esc_attr(trim(strip_tags($keywords)));
    $description = esc_attr(trim(strip_tags($description)));
    ?>
<meta name="description" content="<?php 
    echo $description;
    ?>
" />
<meta name="keywords" content="<?php 
    echo rtrim($keywords, ',');
    ?>
" />
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php 
    bloginfo('pingback_url');
    ?>
" />
<link rel="shortcut icon" href="<?php 
    if (bymt_c('favicon_ck')) {
        bymt('custom_favicon', 'u');
    } else {
        echo TPLDIR . "/images/favicon.png";
    }
    ?>
" type="image/x-icon" />
<link rel="icon" href="<?php 
    if (bymt_c('favicon_ck')) {
        bymt('custom_favicon', 'u');
    } else {
        echo TPLDIR . "/images/favicon.png";
    }
    ?>
" type="image/x-icon" />
<?php 
    if (wp_is_mobile()) {
        ?>
<link rel="stylesheet" type="text/css" href="<?php 
        echo TPLDIR . '/css/mobile.css';
        ?>
" media="all" />
<?php 
    } else {
        ?>
<link rel="stylesheet" type="text/css" href="<?php 
        echo TPLDIR . '/style.css';
        ?>
" media="all" />
<!--[if IE 7]><link rel="stylesheet" href="<?php 
        echo TPLDIR . '/css/ie7.css';
        ?>
" type="text/css" /><![endif]-->
<!--[if IE 8]><link rel="stylesheet" href="<?php 
        echo TPLDIR . '/css/ie8.css';
        ?>
" type="text/css" /><![endif]-->
<?php 
    }
}
コード例 #4
0
ファイル: footer.php プロジェクト: wdq233/BYMT2
    }
}
?>
<div id="footer" class="container">
	<div class="copyright">
		<?php 
if (bymt_c('icp_ck')) {
    ?>
<a href="http://www.miitbeian.gov.cn" target="_blank" rel="nofollow"><?php 
    bymt('icp', 'e');
    ?>
</a><?php 
}
?>
		<?php 
bymt_r('footer', '&copy; 2012-2014 <a href="' . esc_url(home_url('/')) . '" rel="index">' . esc_attr(get_bloginfo('name')) . '</a> All Rights Reserved');
?>
	</div>
	<?php 
if (!wp_is_mobile()) {
    ?>
	<div class="themeauthor">Powered by <a href="http://wordpress.org" target="_blank" rel="license"><strong>WordPress</strong></a> Theme by <a href="http://www.yuxiaoxi.com/themes/BYMT" target="_blank" rel="license"><strong>BYMT</strong></a></div>
	<?php 
}
?>
	<div style="display:none">
	<?php 
if (wp_is_mobile()) {
    ?>
    	<?php 
    if (bymt_c('wap_stat')) {