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


PHP FeedItem::set_image_url方法代码示例

本文整理汇总了PHP中FeedItem::set_image_url方法的典型用法代码示例。如果您正苦于以下问题:PHP FeedItem::set_image_url方法的具体用法?PHP FeedItem::set_image_url怎么用?PHP FeedItem::set_image_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在FeedItem的用法示例。


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

示例1: import

 function get_feed_data_struct($idcat = 0, $name = '')
 {
     global $Cache, $Sql, $LANG, $CONFIG, $CONFIG_NEWS;
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     load_module_lang('news');
     $data = new FeedData();
     $data->set_title($LANG['xml_news_desc'] . ' ' . $CONFIG['server_name']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=news&cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($LANG['xml_news_desc'] . ' ' . $CONFIG['server_name']);
     $data->set_lang($LANG['xml_lang']);
     $Cache->load('news');
     $result = $Sql->query_while("SELECT id, title, contents, timestamp, img\n            FROM " . PREFIX . "news\n            WHERE visible = 1\n            ORDER BY timestamp DESC" . $Sql->limit(0, 2 * $CONFIG_NEWS['pagination_news']), __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $item->set_title($row['title']);
         $link = new Url('/news/news' . url('.php?id=' . $row['id'], '-0-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'));
         $item->set_link($link);
         $item->set_guid($link);
         $item->set_desc(second_parse($row['contents']));
         $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp']));
         $item->set_image_url($row['img']);
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:30,代码来源:news_interface.class.php

示例2: FeedData

    function get_feed_data_struct($idcat = 0, $name = '')
    {
        if (MediaService::get_categories_manager()->get_categories_cache()->category_exists($idcat)) {
            require_once PATH_TO_ROOT . '/media/media_constant.php';
            $category = MediaService::get_categories_manager()->get_categories_cache()->get_category($idcat);
            $site_name = GeneralConfig::load()->get_site_name();
            $site_name = $idcat != Category::ROOT_CATEGORY ? $site_name . ' : ' . $category->get_name() : $site_name;
            $feed_module_name = LangLoader::get_message('module_title', 'common', 'media');
            $data = new FeedData();
            $data->set_title($feed_module_name . ' - ' . $site_name);
            $data->set_date(new Date());
            $data->set_link(SyndicationUrlBuilder::rss('media', $idcat));
            $data->set_host(HOST);
            $data->set_desc($feed_module_name . ' - ' . $site_name);
            $data->set_lang(LangLoader::get_message('xml_lang', 'main'));
            $data->set_auth_bit(Category::READ_AUTHORIZATIONS);
            $categories = MediaService::get_categories_manager()->get_childrens($idcat, new SearchCategoryChildrensOptions(), true);
            $ids_categories = array_keys($categories);
            $results = PersistenceContext::get_querier()->select('SELECT media.*, cat.image
				FROM ' . MediaSetup::$media_table . ' media
				LEFT JOIN ' . MediaSetup::$media_cats_table . ' cat ON cat.id = media.idcat
				WHERE media.idcat IN :ids_categories
				AND infos = :status_approved
				ORDER BY timestamp DESC', array('ids_categories' => $ids_categories, 'status_approved' => MEDIA_STATUS_APROBED));
            foreach ($results as $row) {
                // Rewriting
                $link = new Url('/media/media' . url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . Url::encode_rewrite($row['name']) . '.php'));
                $item = new FeedItem();
                $item->set_title($row['name']);
                $item->set_link($link);
                $item->set_guid($link);
                $item->set_desc(FormatingHelper::second_parse($row['contents']));
                $item->set_date(new Date($row['timestamp'], Timezone::SERVER_TIMEZONE));
                $item->set_image_url($row['image']);
                $item->set_auth(MediaService::get_categories_manager()->get_heritated_authorizations($row['idcat'], Category::READ_AUTHORIZATIONS, Authorizations::AUTH_PARENT_PRIORITY));
                $enclosure = new FeedItemEnclosure();
                $enclosure->set_lenght(@filesize($row['url']));
                $enclosure->set_type($row['mime_type']);
                $enclosure->set_url($row['url']);
                $item->set_enclosure($enclosure);
                $data->add_item($item);
            }
            $results->dispose();
            return $data;
        }
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:46,代码来源:MediaFeedProvider.class.php

示例3: get_feed_data_struct

    public function get_feed_data_struct($idcat = 0, $name = '')
    {
        if (ArticlesService::get_categories_manager()->get_categories_cache()->category_exists($idcat)) {
            $querier = PersistenceContext::get_querier();
            $category = ArticlesService::get_categories_manager()->get_categories_cache()->get_category($idcat);
            $site_name = GeneralConfig::load()->get_site_name();
            $site_name = $idcat != Category::ROOT_CATEGORY ? $site_name . ' : ' . $category->get_name() : $site_name;
            $feed_module_name = LangLoader::get_message('articles.feed_name', 'common', 'articles');
            $data = new FeedData();
            $data->set_title($feed_module_name . ' - ' . $site_name);
            $data->set_date(new Date());
            $data->set_link(SyndicationUrlBuilder::rss('articles', $idcat));
            $data->set_host(HOST);
            $data->set_desc($feed_module_name . ' - ' . $site_name);
            $data->set_lang(LangLoader::get_message('xml_lang', 'main'));
            $data->set_auth_bit(Category::READ_AUTHORIZATIONS);
            $categories = ArticlesService::get_categories_manager()->get_childrens($idcat, new SearchCategoryChildrensOptions(), true);
            $ids_categories = array_keys($categories);
            $now = new Date();
            $results = $querier->select('SELECT articles.id, articles.id_category, articles.title, articles.rewrited_title, articles.picture_url, 
			articles.contents, articles.description, articles.date_created, cat.rewrited_name AS rewrited_name_cat
			FROM ' . ArticlesSetup::$articles_table . ' articles
			LEFT JOIN ' . ArticlesSetup::$articles_cats_table . ' cat ON cat.id = articles.id_category
			WHERE articles.id_category IN :cats_ids
			AND (published = 1 OR (published = 2 AND publishing_start_date < :timestamp_now AND (publishing_end_date > :timestamp_now OR publishing_end_date = 0)))
			ORDER BY articles.date_created DESC', array('cats_ids' => $ids_categories, 'timestamp_now' => $now->get_timestamp()));
            foreach ($results as $row) {
                $row['rewrited_name_cat'] = !empty($row['id_category']) ? $row['rewrited_name_cat'] : 'root';
                $link = ArticlesUrlBuilder::display_article($row['id_category'], $row['rewrited_name_cat'], $row['id'], $row['rewrited_title']);
                $item = new FeedItem();
                $item->set_title($row['title']);
                $item->set_link($link);
                $item->set_guid($link);
                $item->set_desc(FormatingHelper::second_parse($row['contents']));
                $item->set_date(new Date($row['date_created'], Timezone::SERVER_TIMEZONE));
                $item->set_image_url($row['picture_url']);
                $item->set_auth(ArticlesService::get_categories_manager()->get_heritated_authorizations($row['id_category'], Category::READ_AUTHORIZATIONS, Authorizations::AUTH_PARENT_PRIORITY));
                $data->add_item($item);
            }
            $results->dispose();
            return $data;
        }
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:43,代码来源:ArticlesFeedProvider.class.php

示例4: FeedData

    function get_feed_data_struct($idcat = 0, $name = '')
    {
        if (GalleryService::get_categories_manager()->get_categories_cache()->category_exists($idcat)) {
            $category = GalleryService::get_categories_manager()->get_categories_cache()->get_category($idcat);
            $config = GalleryConfig::load();
            $site_name = GeneralConfig::load()->get_site_name();
            $site_name = $idcat != Category::ROOT_CATEGORY ? $site_name . ' : ' . $category->get_name() : $site_name;
            $feed_module_name = LangLoader::get_message('module_title', 'common', 'gallery');
            $data = new FeedData();
            $data->set_title($feed_module_name . ' - ' . $site_name);
            $data->set_date(new Date());
            $data->set_link(SyndicationUrlBuilder::rss('gallery', $idcat));
            $data->set_host(HOST);
            $data->set_desc($feed_module_name . ' - ' . $site_name);
            $data->set_lang(LangLoader::get_message('xml_lang', 'main'));
            $data->set_auth_bit(Category::READ_AUTHORIZATIONS);
            $categories = GalleryService::get_categories_manager()->get_childrens($idcat, new SearchCategoryChildrensOptions(), true);
            $ids_categories = array_keys($categories);
            $results = PersistenceContext::get_querier()->select('SELECT *
				FROM ' . GallerySetup::$gallery_table . '
				WHERE idcat IN :ids_categories
				ORDER BY timestamp DESC
				LIMIT :pics_number_per_page', array('ids_categories' => $ids_categories, 'pics_number_per_page' => $config->get_pics_number_per_page()));
            foreach ($results as $row) {
                $link = TextHelper::htmlentities(GalleryUrlBuilder::get_link_item($row['idcat'], $row['id']));
                $item = new FeedItem();
                $item->set_title($row['name']);
                $item->set_link($link);
                $item->set_guid($link);
                $item->set_date(new Date($row['timestamp'], Timezone::SERVER_TIMEZONE));
                $item->set_image_url(Url::to_rel('/gallery/pics/' . $row['path']));
                $item->set_auth(GalleryService::get_categories_manager()->get_heritated_authorizations($row['idcat'], Category::READ_AUTHORIZATIONS, Authorizations::AUTH_PARENT_PRIORITY));
                $data->add_item($item);
            }
            $results->dispose();
            return $data;
        }
    }
开发者ID:AroundPBT,项目名称:PHPBoost,代码行数:38,代码来源:GalleryFeedProvider.class.php

示例5: import

 function get_feed_data_struct($idcat = 0)
 {
     global $Cache, $Sql, $LANG, $MEDIA_LANG, $CONFIG, $MEDIA_CONFIG, $MEDIA_CATS;
     $Cache->load('media');
     load_module_lang('media');
     require_once PATH_TO_ROOT . '/media/media_constant.php';
     require_once PATH_TO_ROOT . '/media/media_cats.class.php';
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     $data = new FeedData();
     $data->set_title($MEDIA_LANG['xml_media_desc']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=media&amp;cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($MEDIA_LANG['xml_media_desc']);
     $data->set_lang($LANG['xml_lang']);
     $data->set_auth_bit(MEDIA_AUTH_READ);
     $cats = new MediaCats();
     $children_cats = array();
     $cats->build_children_id_list($idcat, $children_cats, RECURSIVE_EXPLORATION, ADD_THIS_CATEGORY_IN_LIST);
     $result = $Sql->query_while("SELECT id, idcat, name, contents, timestamp FROM " . PREFIX . "media WHERE infos = '" . MEDIA_STATUS_APROBED . "' AND idcat IN (" . implode($children_cats, ',') . " ) ORDER BY timestamp DESC" . $Sql->limit(0, $MEDIA_CONFIG['pagin']), __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $link = new Url('/media/media' . url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['name']) . '.php'));
         $item->set_title($row['name']);
         $item->set_link($link);
         $item->set_guid($link);
         $item->set_desc(second_parse($row['contents']));
         $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp']));
         $item->set_image_url($MEDIA_CATS[$row['idcat']]['image']);
         $item->set_auth($cats->compute_heritated_auth($row['idcat'], MEDIA_AUTH_READ, AUTH_PARENT_PRIORITY));
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:37,代码来源:media_interface.class.php

示例6: import

 function get_feed_data_struct($idcat = 0, $name = '')
 {
     global $Cache, $Sql, $LANG, $CONFIG, $CONFIG_ARTICLES, $CAT_ARTICLES;
     $Cache->load('articles');
     require_once PATH_TO_ROOT . '/articles/articles_constants.php';
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     $data = new FeedData();
     $data->set_title($LANG['xml_articles_desc']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=articles&amp;cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($LANG['xml_articles_desc']);
     $data->set_lang($LANG['xml_lang']);
     $data->set_auth_bit(READ_CAT_ARTICLES);
     $cat_clause = !empty($idcat) ? " AND a.idcat = '" . $idcat . "'" : '';
     $result = $Sql->query_while("SELECT a.id, a.idcat, a.title, a.contents, a.timestamp, a.icon, ac.auth\n        FROM " . PREFIX . "articles a\n        LEFT JOIN " . PREFIX . "articles_cats ac ON ac.id = a.idcat\n        WHERE a.visible = 1 AND (ac.aprob = 1 OR a.idcat = 0) " . $cat_clause . "\n        ORDER BY a.timestamp DESC\n        " . $Sql->limit(0, 2 * $CONFIG_ARTICLES['nbr_articles_max']), __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $link = new Url('/articles/articles' . url('.php?cat=' . $row['idcat'] . '&amp;id=' . $row['id'], '-' . $row['idcat'] . '-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'));
         $item->set_title($row['title']);
         $item->set_link($link);
         $item->set_guid($link);
         $item->set_desc(preg_replace('`\\[page\\](.+)\\[/page\\]`U', '<br /><strong>$1</strong><hr />', second_parse($row['contents'])));
         $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp']));
         $item->set_image_url($row['icon']);
         $item->set_auth($row['idcat'] == 0 ? $CONFIG_ARTICLES['auth_root'] : unserialize($row['auth']));
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:33,代码来源:articles_interface.class.php

示例7: import

 function get_feed_data_struct($idcat = 0, $name = '')
 {
     require_once PATH_TO_ROOT . '/download/download_auth.php';
     require_once PATH_TO_ROOT . '/download/download_cats.class.php';
     import('content/syndication/feed_data');
     import('util/date');
     import('util/url');
     global $Cache, $Sql, $LANG, $DOWNLOAD_LANG, $CONFIG, $CONFIG_DOWNLOAD, $DOWNLOAD_CATS;
     load_module_lang('download');
     $Cache->load('download');
     $data = new FeedData();
     $data->set_title($DOWNLOAD_LANG['xml_download_desc']);
     $data->set_date(new Date());
     $data->set_link(new Url('/syndication.php?m=download&amp;cat=' . $idcat));
     $data->set_host(HOST);
     $data->set_desc($DOWNLOAD_LANG['xml_download_desc']);
     $data->set_lang($LANG['xml_lang']);
     $data->set_auth_bit(DOWNLOAD_READ_CAT_AUTH_BIT);
     $cats = new DownloadCats();
     $children_cats = array();
     $cats->build_children_id_list($idcat, $children_cats, RECURSIVE_EXPLORATION, ADD_THIS_CATEGORY_IN_LIST);
     $req = "SELECT id, idcat, title, contents, timestamp, image\n        FROM " . PREFIX . "download\n        WHERE visible = 1 AND idcat IN (" . implode($children_cats, ',') . " )\n        ORDER BY timestamp DESC" . $Sql->limit(0, $CONFIG_DOWNLOAD['nbr_file_max']);
     $result = $Sql->query_while($req, __LINE__, __FILE__);
     while ($row = $Sql->fetch_assoc($result)) {
         $item = new FeedItem();
         $link = new Url('/download/download' . url('.php?id=' . $row['id'], '-' . $row['id'] . '+' . url_encode_rewrite($row['title']) . '.php'));
         $item->set_title($row['title']);
         $item->set_link($link);
         $item->set_guid($link);
         $item->set_desc(second_parse($row['contents']));
         $item->set_date(new Date(DATE_TIMESTAMP, TIMEZONE_SYSTEM, $row['timestamp']));
         $item->set_image_url($row['image']);
         $item->set_auth($cats->compute_heritated_auth($row['idcat'], DOWNLOAD_READ_CAT_AUTH_BIT, AUTH_PARENT_PRIORITY));
         $data->add_item($item);
     }
     $Sql->query_close($result);
     return $data;
 }
开发者ID:janus57,项目名称:PHPBoost_v3c,代码行数:38,代码来源:download_interface.class.php


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