Zero108 Posted January 24, 2019 Share Posted January 24, 2019 (edited) https://www.a108.net/gallery/images.xml/ https://www.a108.net/rss/7-gallery.xml/Два RSS-потока. Первый от приложения Gallery. Второй создается для галереи в админке. Как модифицировать любой из них, чтобы в поле <description> </description> добавлялся автомтически url добавленного в галерею изображения. Иначе трансляция в Instagram не работает. Например, так: <description>https://www.a108.net/uploads/monthly_2019_01/large.gallery_1_49_112555.jpg.f3fa0691cc47c7c87119525ca5edf900.jpg</description> Edited January 24, 2019 by Zero108 Link to comment Share on other sites More sharing options...
siv1987 Posted January 24, 2019 Share Posted January 24, 2019 Так оно и так там добавляется <description> <p> <a href='https://www.a108.net/gallery/image/2717-shrila-pran-krishna-das-babaji-shrila-pran-krishna-das-babadzhi/' title='Shrila Pran Krishna das Babaji : Шрила Пран Кришна дас бабаджи'><img src='https://www.a108.net/uploads/monthly_2019_01/large.IL4UyoYUa3A.jpg.f56ddbc6a74586b16b8368bf54747dce.jpg' title="Shrila Pran Krishna das Babaji : Шрила Пран Кришна дас бабаджи" alt="Shrila Pran Krishna das Babaji : Шрила Пран Кришна дас бабаджи"></a> </p></description> Link to comment Share on other sites More sharing options...
Zero108 Posted January 25, 2019 Author Share Posted January 25, 2019 Вот в этом есть и его пока использую: https://www.a108.net/gallery/images.xml/Во втором, к сожалению, url картинки не вставляют. Не подскажите шаблон или файл, где можно поменять данные, выводимые в эти rss потоки? Link to comment Share on other sites More sharing options...
newbie Posted January 25, 2019 Share Posted January 25, 2019 Для первого\applications\gallery\modules\front\gallery\browse.php $document->addItem( $image->caption, $image->url(), \IPS\Theme::i()->getTemplate( 'view' )->rssContent( $image ), \IPS\DateTime::ts( $image->updated ), $image->id ); \IPS\Theme::i()->getTemplate( 'view' )->rssContent( $image ) можете заменить на $image->url() Для второго\system\Content\Search\Result\Content.phpНайти$object = $class::load( $this->indexData['index_object_id'] );Ниже добавить if (\IPS\Dispatcher::hasInstance() and \IPS\Dispatcher::i()->controllerLocation == 'front' and \IPS\Request::i()->app == 'core' and \IPS\Request::i()->module == 'discover' and \IPS\Request::i()->controller == 'rss' and \IPS\Request::i()->id == 7 ) { $this->indexData['index_content'] = $object->url(); } 2 Link to comment Share on other sites More sharing options...
Zero108 Posted July 22, 2019 Author Share Posted July 22, 2019 Пытаюсь стать автором на Flipboard. Для этого нужно иметь свой собственный RSS-поток, к которому предъявлены строгие требования: https://about.flipboard.com/rss-spec/ В частности у моего RSS-потока https://www.a108.net/rss/9-articles.xml/ отсутствуют такие поля из их списка:<language> the language the feed is written in, using ISO-639 language codes and optionally ISO-3166 country codes – examples include “en”, “fr”, “en-CA”, and “fr-FR”<guid>a unique id for this entry in the feed (can be the item URL).<dc:creator> the author(s) of the article.<enclosure> use this tag to add a media element that will be used in layout view to illustrate your article. It can be an image or a video. For videos, mobile-friendly mp4 format is strongly preferred. For images, prefer a high-resolution image; the smallest dimension should not be under 500px. Как добавить эти поля в RSS-поток, создаваемый через админпанель? Например, для language прописать для конкретного потока en; для dc:creator прописать любое фиксированне имя автора; для guid подставить url из поля link; в enclosure прописать url приаттаченной к статье картинки? Link to comment Share on other sites More sharing options...
newbie Posted July 23, 2019 Share Posted July 23, 2019 the language the feed is written in, using ISO-639 language codes and optionally ISO-3166 country codes – examples include “en”, “fr”, “en-CA”, and “fr-FR”Это есть Как добавить эти поля в RSS-поток, создаваемый через админпанель? \system\Xml\Rss.php /** * Add Item * * @param string $title Item title * @param \IPS\Http\Url|NULL $link Item link * @param string|NULL $description Item description/content * @param \IPS\DateTime|NULL $date Item date * @param string $guid Item ID * @return void * @todo [Future] The feed will validate now, but unrecognized attribute values cause warnings when validating. Also, the validator recommends using an Atom feed with the atom:link attribute. */ public function addItem( $title = NULL, \IPS\Http\Url $link = NULL, $description = NULL, \IPS\DateTime $date = NULL, $guid = NULL ) Добавляете свои элементы по аналогии с другими. Link to comment Share on other sites More sharing options...
Zero108 Posted July 23, 2019 Author Share Posted July 23, 2019 (edited) а как же ?<dc:creator><enclosure> И почему когда я в браузере смотрю содержание RSS-потока, я не вижу упомянутых 4 полей? Edited July 23, 2019 by Zero108 Link to comment Share on other sites More sharing options...
newbie Posted July 24, 2019 Share Posted July 24, 2019 Я написал, что уже есть.Остальные нужно добавить в указанный метод. Link to comment Share on other sites More sharing options...
Zero108 Posted July 24, 2019 Author Share Posted July 24, 2019 Подскажите, пожалуйста, как добавить. Я не программист. Link to comment Share on other sites More sharing options...
newbie Posted July 27, 2019 Share Posted July 27, 2019 У Вас там 1 база (база, созданная в Pages) используется для РСС? Link to comment Share on other sites More sharing options...
Zero108 Posted July 27, 2019 Author Share Posted July 27, 2019 (edited) Да, статьи из Pages беруться из одной базы. Edited July 27, 2019 by Zero108 Link to comment Share on other sites More sharing options...
newbie Posted August 1, 2019 Share Posted August 1, 2019 На выходных посмотрю. 1 Link to comment Share on other sites More sharing options...
newbie Posted August 5, 2019 Share Posted August 5, 2019 Что-то ссылка на рсс https://www.a108.net/rss/9-articles.xml/ не работает.Еще нужно решение? Link to comment Share on other sites More sharing options...
Zero108 Posted August 5, 2019 Author Share Posted August 5, 2019 Да, переставляем сервер Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now