本文整理汇总了PHP中wp_get_rss_charset函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_get_rss_charset函数的具体用法?PHP wp_get_rss_charset怎么用?PHP wp_get_rss_charset使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_get_rss_charset函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: comment_text_rss
function comment_text_rss($with_html = false)
{
global $blog_charset;
global $comment;
$comment_text = stripslashes($comment->comment_content);
$comment_text = str_replace('<trackback />', '', $comment_text);
$comment_text = str_replace('<pingback />', '', $comment_text);
$comment_text = convert_chars($comment_text);
$comment_text = convert_bbcode($comment_text);
$comment_text = convert_gmcode($comment_text);
$comment_text = convert_smilies($comment_text);
$comment_text = apply_filters('comment_text', $comment_text);
if (!$with_html) {
$comment_text = strip_tags($comment_text);
$comment_text = htmlspecialchars($comment_text);
}
$rss_charset = wp_get_rss_charset();
if ($blog_charset != $rss_charset) {
echo mb_convert_encoding($comment_text, $rss_charset, $blog_charset);
} else {
echo $comment_text;
}
}
示例2: header
// enter your blog's ID
$doing_rss = 1;
header("Content-type: application/xml");
include_once dirname(__FILE__) . "/../../mainfile.php";
error_reporting(E_ERROR);
if ($_GET['num']) {
$showposts = $_GET['num'];
}
require 'wp-blog-header.php';
if (isset($showposts) && $showposts) {
$showposts = (int) $showposts;
$posts_per_page = $showposts;
} else {
$posts_per_page = get_settings('posts_per_rss');
}
$rss_charset = wp_get_rss_charset();
echo '<?xml version="1.0" encoding="' . $rss_charset . '"?' . '>';
?>
<!-- generator="wordpress/<?php
echo $wp_version;
?>
" -->
<rss version="0.92">
<channel>
<title><?php
bloginfo_rss("name");
?>
</title>
<link><?php
bloginfo_rss("url");
?>
示例3: wp_convert_rss_charset
function wp_convert_rss_charset($srcstr)
{
return mb_conv($srcstr, wp_get_rss_charset(), $GLOBALS['blog_charset']);
}
示例4: dirname
<?php
$GLOBALS['blog'] = 1;
$GLOBALS['doing_rss'] = 1;
require_once dirname(__FILE__) . '/wp-config.php';
error_reporting(E_ERROR);
init_param('GET', 'num', 'integer');
if (test_param('num')) {
$GLOBALS['showposts'] = get_param('num');
}
require_once 'wp-blog-header.php';
header('Content-type: application/xml');
echo '<?xml version="1.0" encoding="' . wp_get_rss_charset() . '"?' . '>';
?>
<!-- generator="wordpress/<?php
echo $GLOBALS['wp_version'];
?>
" -->
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
<title><?php
bloginfo_rss('name');
?>
</title>
<link><?php
bloginfo_rss('url');
?>
</link>
<description><?php
示例5: wp_convert_rss_charset
function wp_convert_rss_charset($srcstr)
{
global $blog_charset;
$rss_charset = wp_get_rss_charset();
if ($blog_charset != $rss_charset) {
return mb_convert_encoding($srcstr, $rss_charset, $blog_charset);
} else {
return $srcstr;
}
}
示例6: wp_convert_rss_charset
function wp_convert_rss_charset($srcstr)
{
$rss_charset = wp_get_rss_charset();
if ($GLOBALS['blog_charset'] != $rss_charset) {
if (strtolower($GLOBALS['blog_charset']) == 'euc-jp' && strtolower($rss_charset) == 'utf-8') {
return mb_convert_encoding(mb_convert_encoding($srcstr, "SJIS", "EUC-JP"), "UTF-8", "SJIS-win");
}
return mb_convert_encoding($srcstr, $rss_charset, $GLOBALS['blog_charset']);
} else {
return $srcstr;
}
}