本文整理汇总了PHP中RSSFeed::SetImage方法的典型用法代码示例。如果您正苦于以下问题:PHP RSSFeed::SetImage方法的具体用法?PHP RSSFeed::SetImage怎么用?PHP RSSFeed::SetImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RSSFeed
的用法示例。
在下文中一共展示了RSSFeed::SetImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: display
public function display($part = 'all')
{
switch ($part) {
case 'page-menu-only':
if (file_exists('theme/' . $this->get_config('es_theme') . '/page_menu.php')) {
$page_menu_file = 'theme/' . $this->get_config('es_theme') . '/page_menu.php';
} else {
$page_menu_file = 'includes/layout/theme//page_menu.php';
}
ob_start();
include $page_menu_file;
$page_menu = ob_get_contents();
ob_end_clean();
echo $page_menu;
break;
case 'posts-only':
echo '<div id="new-post"></div>';
$this->get_posts();
break;
case 'topbar-only':
ob_start();
include 'includes/layout/topbar.php';
$this->topbar = ob_get_contents();
ob_end_clean();
echo $this->topbar;
break;
case 'sidebar-only':
if (file_exists('theme/' . $this->get_config('es_theme') . '/sidebar.php')) {
$sidebar_file = 'theme/' . $this->get_config('es_theme') . '/sidebar.php';
} else {
$sidebar_file = 'includes/layout/theme/sidebar.php';
}
ob_start();
include $sidebar_file;
$sidebar = ob_get_contents();
ob_end_clean();
echo $sidebar;
break;
case 'first-load':
if ($this->configFileExists()) {
ob_start();
include 'includes/layout/topbar.php';
$this->topbar = ob_get_contents();
ob_end_clean();
$script_uri = 'http://' . str_replace('www.', '', $_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI'];
if (substr($script_uri, -1) != '/') {
$script_uri .= '/';
}
$editsee_request = str_replace(str_replace('www.', '', $this->get_config('es_main_url')), '', $script_uri);
if (substr($editsee_request, 0, 5) == 'feed/') {
include "includes/RSSFeed.class.php";
header("Content-type: text/xml; charset=UTF-8");
$myfeed = new RSSFeed();
$myfeed->SetChannel($this->get_config('es_main_url'), $this->get_config('es_title'), $this->get_config('es_description'), 'en-us', date(Y) . ' ' . $_SERVER['HTTP_HOST'], 'webmaster@' . $_SERVER['HTTP_HOST'], $this->get_config('es_title'));
$myfeed->SetImage('');
$query = $this->db->_query("select id,title,urltag,content,date_entered from " . $this->db->get_table_prefix() . "post \n\t\t\t\t\t\t\t\t\t\t\t\t\twhere type='post' and deleted='0' and (date_entered <= NOW())\n\t\t\t\t\t\t\t\t\t\t\t\t\torder by date_entered desc");
while ($post = $query->_fetch_assoc()) {
$post['content'] = strip_tags($post['content'], '<br/><br>');
if (strpos($post['content'], '!--full-post--!')) {
$post['content'] = substr($post['content'], 0, strpos($post['content'], '!--full-post--!'));
$add_dots = true;
} else {
if (strlen($post['content']) > 280) {
$post['content'] = substr(substr($post['content'], 0, 280), 0, strrpos(substr($post['content'], 0, 280), ' '));
$add_dots = true;
}
}
$post['content'] = htmlentities(stripslashes($post['content']));
if ($add_dots) {
$post['content'] .= ' [...]';
}
$myfeed->SetItem($this->get_config('es_main_url') . 'post/' . $post['id'], $this->get_config('es_main_url') . 'post/' . $post['urltag'], $post['title'], $post['date_entered'], $post['content']);
}
echo $myfeed->output();
exit;
}
$editsee_index = '';
if ($editsee_request == '' || $editsee_request == $this->get_config('es_postpage') . '/' || $editsee_request == 'index.php/') {
$post_start = 0;
$page_number = 1;
if ($this->get_config('es_homepage') == '!posts!' || $editsee_request == $this->get_config('es_postpage') . '/') {
$this->is_posts = true;
} else {
$editsee_request = $this->get_config('es_homepage') . '/';
}
}
if (substr($editsee_request, 0, 5) == 'page/') {
$page_number = substr(substr($editsee_request, 5), 0, strpos(substr($editsee_request, 5), '/'));
$post_start = ($page_number - 1) * $this->get_config('es_posts_per_page');
$this->is_posts = true;
}
if ($this->is_posts) {
ob_start();
$this->get_posts($post_start);
$editsee_index .= ob_get_contents();
ob_end_clean();
} else {
$query = $this->db->_query("select id,title from " . $this->db->get_table_prefix() . "post where urltag='" . substr($editsee_request, 0, -1) . "'");
if ($query->_num_rows() == 1) {
$this->is_page = true;
//.........这里部分代码省略.........