Version Notes
Stable release
Download this release
Release Info
| Developer | Développeurs EnvoiMoinsCher.com |
| Extension | orange_rss |
| Version | 0.1.0 |
| Comparing to | |
| See all releases | |
Version 0.1.0
- app/code/community/Orange/Rss/Model/Rss.php +53 -0
- app/code/community/Orange/Rss/etc/config.xml +53 -0
- app/code/community/Orange/Rss/etc/system.xml +66 -0
- app/design/frontend/base/default/layout/orange_rss.xml +14 -0
- app/design/frontend/base/default/template/orange/rss.phtml +36 -0
- app/etc/modules/Mage_OrangeRss.xml +9 -0
- package.xml +18 -0
- skin/frontend/base/default/css/orange_rss.css +10 -0
app/code/community/Orange/Rss/Model/Rss.php
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Orange_Rss_Model_Rss extends Mage_Core_Model_Abstract
|
| 3 |
+
{
|
| 4 |
+
function getStoreData($item)
|
| 5 |
+
{
|
| 6 |
+
return Mage::getStoreConfig('orange_rss/settings/' . $item);
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
public function getTitle()
|
| 10 |
+
{
|
| 11 |
+
return $this->getStoreData('title');
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
public function data()
|
| 15 |
+
{
|
| 16 |
+
$rssLink = $this->getStoreData('rss_link');
|
| 17 |
+
if(file_get_contents($rssLink))
|
| 18 |
+
{
|
| 19 |
+
$feed = Zend_Feed_Reader::import('http://rss.cnn.com/rss/edition_world.rss');
|
| 20 |
+
|
| 21 |
+
$data = array(
|
| 22 |
+
'title' => $feed->getTitle(),
|
| 23 |
+
'link' => $feed->getLink(),
|
| 24 |
+
'dateModified' => $feed->getDateModified(),
|
| 25 |
+
'description' => $feed->getDescription(),
|
| 26 |
+
'language' => $feed->getLanguage(),
|
| 27 |
+
'entries' => array(),
|
| 28 |
+
);
|
| 29 |
+
|
| 30 |
+
$i = 0;
|
| 31 |
+
foreach ($feed as $entry)
|
| 32 |
+
{
|
| 33 |
+
++$i;
|
| 34 |
+
$edata = array(
|
| 35 |
+
'title' => $entry->getTitle(),
|
| 36 |
+
'description' => $entry->getDescription(),
|
| 37 |
+
'dateModified' => $entry->getDateModified(),
|
| 38 |
+
'authors' => $entry->getAuthors(),
|
| 39 |
+
'link' => $entry->getLink(),
|
| 40 |
+
'content' => $entry->getContent()
|
| 41 |
+
);
|
| 42 |
+
$data['entries'][] = $edata;
|
| 43 |
+
if($i == $this->getStoreData('showposts'))
|
| 44 |
+
break;
|
| 45 |
+
}
|
| 46 |
+
return $data;
|
| 47 |
+
}
|
| 48 |
+
else
|
| 49 |
+
{
|
| 50 |
+
return false;
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
}
|
app/code/community/Orange/Rss/etc/config.xml
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Orange_Rss>
|
| 5 |
+
<version>1.0.0</version>
|
| 6 |
+
</Orange_Rss>
|
| 7 |
+
</modules>
|
| 8 |
+
<frontend>
|
| 9 |
+
<layout>
|
| 10 |
+
<updates>
|
| 11 |
+
<orange>
|
| 12 |
+
<file>orange_rss.xml</file>
|
| 13 |
+
</orange>
|
| 14 |
+
</updates>
|
| 15 |
+
</layout>
|
| 16 |
+
</frontend>
|
| 17 |
+
<global>
|
| 18 |
+
<models>
|
| 19 |
+
<orange_rss>
|
| 20 |
+
<class>Orange_Rss_Model</class>
|
| 21 |
+
</orange_rss>
|
| 22 |
+
</models>
|
| 23 |
+
</global>
|
| 24 |
+
<adminhtml>
|
| 25 |
+
<acl>
|
| 26 |
+
<resources>
|
| 27 |
+
<admin>
|
| 28 |
+
<children>
|
| 29 |
+
<system>
|
| 30 |
+
<children>
|
| 31 |
+
<config>
|
| 32 |
+
<children>
|
| 33 |
+
<orange_rss/>
|
| 34 |
+
</children>
|
| 35 |
+
</config>
|
| 36 |
+
</children>
|
| 37 |
+
</system>
|
| 38 |
+
</children>
|
| 39 |
+
</admin>
|
| 40 |
+
</resources>
|
| 41 |
+
</acl>
|
| 42 |
+
</adminhtml>
|
| 43 |
+
<default>
|
| 44 |
+
<orange_rss>
|
| 45 |
+
<settings>
|
| 46 |
+
<enable>1</enable>
|
| 47 |
+
<title>Rss</title>
|
| 48 |
+
<rss_link>http://</rss_link>
|
| 49 |
+
<showposts>3</showposts>
|
| 50 |
+
</settings>
|
| 51 |
+
</orange_rss>
|
| 52 |
+
</default>
|
| 53 |
+
</config>
|
app/code/community/Orange/Rss/etc/system.xml
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<tabs>
|
| 4 |
+
<orange translate="label">
|
| 5 |
+
<label>orange</label>
|
| 6 |
+
<sort_order>120</sort_order>
|
| 7 |
+
</orange>
|
| 8 |
+
</tabs>
|
| 9 |
+
<sections>
|
| 10 |
+
<orange_rss translate="label">
|
| 11 |
+
<label>Rss</label>
|
| 12 |
+
<tab>orange</tab>
|
| 13 |
+
<frontend_type>text</frontend_type>
|
| 14 |
+
<sort_order>1</sort_order>
|
| 15 |
+
<show_in_default>1</show_in_default>
|
| 16 |
+
<show_in_website>1</show_in_website>
|
| 17 |
+
<show_in_store>1</show_in_store>
|
| 18 |
+
<groups>
|
| 19 |
+
<settings translate="label">
|
| 20 |
+
<label>Settings</label>
|
| 21 |
+
<frontend_type>text</frontend_type>
|
| 22 |
+
<sort_order>1</sort_order>
|
| 23 |
+
<show_in_default>1</show_in_default>
|
| 24 |
+
<show_in_website>1</show_in_website>
|
| 25 |
+
<show_in_store>1</show_in_store>
|
| 26 |
+
<fields>
|
| 27 |
+
<enable translate="label">
|
| 28 |
+
<label>Enable</label>
|
| 29 |
+
<frontend_type>select</frontend_type>
|
| 30 |
+
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 31 |
+
<sort_order>1</sort_order>
|
| 32 |
+
<show_in_default>1</show_in_default>
|
| 33 |
+
<show_in_store>1</show_in_store>
|
| 34 |
+
<show_in_website>1</show_in_website>
|
| 35 |
+
</enable>
|
| 36 |
+
<title translate="label">
|
| 37 |
+
<label>Title</label>
|
| 38 |
+
<frontend_type>text</frontend_type>
|
| 39 |
+
<sort_order>2</sort_order>
|
| 40 |
+
<show_in_default>1</show_in_default>
|
| 41 |
+
<show_in_store>1</show_in_store>
|
| 42 |
+
<show_in_website>1</show_in_website>
|
| 43 |
+
</title>
|
| 44 |
+
<rss_link translate="label">
|
| 45 |
+
<label>Rss link</label>
|
| 46 |
+
<frontend_type>text</frontend_type>
|
| 47 |
+
<sort_order>3</sort_order>
|
| 48 |
+
<show_in_default>1</show_in_default>
|
| 49 |
+
<show_in_store>1</show_in_store>
|
| 50 |
+
<show_in_website>1</show_in_website>
|
| 51 |
+
</rss_link>
|
| 52 |
+
<showposts translate="label">
|
| 53 |
+
<label>Showposts</label>
|
| 54 |
+
<frontend_type>text</frontend_type>
|
| 55 |
+
<validate>validate-number validate-one-required</validate>
|
| 56 |
+
<sort_order>4</sort_order>
|
| 57 |
+
<show_in_default>1</show_in_default>
|
| 58 |
+
<show_in_store>1</show_in_store>
|
| 59 |
+
<show_in_website>1</show_in_website>
|
| 60 |
+
</showposts>
|
| 61 |
+
</fields>
|
| 62 |
+
</settings>
|
| 63 |
+
</groups>
|
| 64 |
+
</orange_rss>
|
| 65 |
+
</sections>
|
| 66 |
+
</config>
|
app/design/frontend/base/default/layout/orange_rss.xml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<layout>
|
| 3 |
+
<default>
|
| 4 |
+
<reference name="head">
|
| 5 |
+
<action method="addCss"><stylesheet>css/orange_rss.css</stylesheet></action>
|
| 6 |
+
</reference>
|
| 7 |
+
<reference name="right">
|
| 8 |
+
<block type="core/template" name="orange_rss" template="orange/rss.phtml" />
|
| 9 |
+
</reference>
|
| 10 |
+
<reference name="left">
|
| 11 |
+
<block type="core/template" name="orange_rss" template="orange/rss.phtml" />
|
| 12 |
+
</reference>
|
| 13 |
+
</default>
|
| 14 |
+
</layout>
|
app/design/frontend/base/default/template/orange/rss.phtml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
$rss = Mage::getModel('orange_rss/rss');
|
| 3 |
+
$posts = $rss->data();
|
| 4 |
+
?>
|
| 5 |
+
<div class="block">
|
| 6 |
+
<div class="block-title">
|
| 7 |
+
<strong><span><?php echo $rss->getTitle() ?></span></strong>
|
| 8 |
+
</div>
|
| 9 |
+
<div class="block-content block-rss">
|
| 10 |
+
<?php if($posts && count($posts)): ?>
|
| 11 |
+
<?php foreach($posts['entries'] as $post): ?>
|
| 12 |
+
<div class="post">
|
| 13 |
+
<?php if($_title = $post['title']): ?>
|
| 14 |
+
<div class="title">
|
| 15 |
+
<?php if($_link = $post['link']): ?>
|
| 16 |
+
<a href="<?php echo $_link ?>"><?php echo $post['title'] ?></a>
|
| 17 |
+
<?php else: ?>
|
| 18 |
+
<?php echo $post['title'] ?>
|
| 19 |
+
<?php endif ?>
|
| 20 |
+
</div>
|
| 21 |
+
<?php endif ?>
|
| 22 |
+
<?php if($_date = $post['dateModified']): ?>
|
| 23 |
+
<div class="date">
|
| 24 |
+
<?php echo date('d.m.Y', $_date->getTimestamp()) ?>
|
| 25 |
+
</div>
|
| 26 |
+
<?php endif ?>
|
| 27 |
+
<div class="content">
|
| 28 |
+
<?php echo strip_tags($post['description']) ?>
|
| 29 |
+
</div>
|
| 30 |
+
</div>
|
| 31 |
+
<?php endforeach ?>
|
| 32 |
+
<?php else: ?>
|
| 33 |
+
<p class="empty"><?php echo $this->__('No posts found.') ?></p>
|
| 34 |
+
<?php endif ?>
|
| 35 |
+
</div>
|
| 36 |
+
</div>
|
app/etc/modules/Mage_OrangeRss.xml
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<config>
|
| 3 |
+
<modules>
|
| 4 |
+
<Orange_Rss>
|
| 5 |
+
<active>true</active>
|
| 6 |
+
<codePool>community</codePool>
|
| 7 |
+
</Orange_Rss>
|
| 8 |
+
</modules>
|
| 9 |
+
</config>
|
package.xml
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?xml version="1.0"?>
|
| 2 |
+
<package>
|
| 3 |
+
<name>orange_rss</name>
|
| 4 |
+
<version>0.1.0</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
+
<license>Open Software License</license>
|
| 7 |
+
<channel>community</channel>
|
| 8 |
+
<extends/>
|
| 9 |
+
<summary>Extension for importing and merging RSS and Atom feeds to show on your Magento site.</summary>
|
| 10 |
+
<description>Extension for importing and merging RSS and Atom feeds to show on your Magento site.</description>
|
| 11 |
+
<notes>Stable release</notes>
|
| 12 |
+
<authors><author><name>Mage</name><user>Dev</user><email>mage.ext@gmail.com</email></author></authors>
|
| 13 |
+
<date>2013-01-02</date>
|
| 14 |
+
<time>11:19:27</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="Orange"><dir name="Rss"><dir name="Model"><file name="Rss.php" hash="af7c574222f737d8e4838eb775f6d5b0"/></dir><dir name="etc"><file name="config.xml" hash="8cdf345f29b4d809a5eb745e0c527f85"/><file name="system.xml" hash="7a966774384879fced6eca86fac10433"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="orange"><file name="rss.phtml" hash="87ee0544f4302adb1c810ab2213aa3f7"/></dir></dir><dir name="layout"><file name="orange_rss.xml" hash="a2e871dba31dc908deeec6470d2c79e6"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Mage_OrangeRss.xml" hash="4791b52dd59b9e18662f436ae2eebc17"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><file name="orange_rss.css" hash="5fb7273a9a83cbea346d7a4ef7f21349"/></dir></dir></dir></dir></target></contents>
|
| 16 |
+
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
+
</package>
|
skin/frontend/base/default/css/orange_rss.css
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
.block-rss { padding: 8px; }
|
| 2 |
+
.block-rss .post {
|
| 3 |
+
margin: 0 0 14px;
|
| 4 |
+
border-bottom: 1px solid #d7d7d7;
|
| 5 |
+
padding-bottom: 4px;
|
| 6 |
+
}
|
| 7 |
+
.block-rss .date {
|
| 8 |
+
font-style: italic;
|
| 9 |
+
margin: 0 0 4px;
|
| 10 |
+
}
|
