CueBlocks_XMLSitemap_Plus_Plugin_AwBlog - Version 1.0.0

Version Notes

Developed by CueBlocks - December 2013

Download this release

Release Info

Developer Francesco Magazzu'
Extension CueBlocks_XMLSitemap_Plus_Plugin_AwBlog
Version 1.0.0
Comparing to
See all releases


Version 1.0.0

app/code/community/CueBlocks/SitemapPluginAwBlog/Model/Mysql4/Processor/Blog/Blog.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Description of
4
+ * @package CueBlocks_SitemapPluginAwBlog
5
+ * @company CueBlocks - http://www.cueblocks.com/
6
+ * @author Francesco Magazzu' <francesco.magazzu at cueblocks.com>
7
+ * @support <magento at cueblocks.com>
8
+ */
9
+
10
+
11
+ class CueBlocks_SitemapPluginAwBlog_Model_Mysql4_Processor_Blog_Blog extends Mage_Core_Model_Mysql4_Abstract
12
+ {
13
+
14
+ /**
15
+ * Collection Zend Db select
16
+ *
17
+ * @var Zend_Db_Select
18
+ */
19
+ protected $_select;
20
+
21
+ /**
22
+ * Init resource model (catalog/category)
23
+ *
24
+ */
25
+ protected function _construct()
26
+ {
27
+ $this->_init('blog/blog', 'post_id');
28
+ }
29
+
30
+ /**
31
+ * Retrieve cms page collection array
32
+ *
33
+ * @param unknown_type $storeId
34
+ * @return array
35
+ */
36
+ public function getCollection($storeId)
37
+ {
38
+ $pages = array();
39
+
40
+ $select = $this->_getWriteAdapter()->select()
41
+ ->from(array('main_table' => $this->getMainTable()), array($this->getIdFieldName(), 'identifier AS url', 'DATE(update_time) as updated_at'))
42
+ ->join(
43
+ array('store_table' => $this->getTable('blog/store')),
44
+ 'main_table.post_id=store_table.post_id',
45
+ array()
46
+ )
47
+ ->where('main_table.status=?', AW_Blog_Model_Status::STATUS_ENABLED)
48
+ ->where('store_table.store_id IN(?)', array(0, $storeId));
49
+ $query = $this->_getWriteAdapter()->query($select);
50
+
51
+ // die($select);
52
+
53
+ return $query;
54
+ }
55
+
56
+ }
app/code/community/CueBlocks/SitemapPluginAwBlog/Model/Observer.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Description of Observer
5
+ * @package CueBlocks_SitemapEnhancedPlus
6
+ * @company CueBlocks - http://www.cueblocks.com/
7
+ * @author Francesco Magazzu' <francesco.magazzu at cueblocks.com>
8
+ */
9
+
10
+ /**
11
+ * SitemapEnhancedPlus module observer
12
+ *
13
+ * @category Mage
14
+ * @package Mage_Sitemap
15
+ * @author Magento Core Team <core@magentocommerce.com>
16
+ */
17
+ class CueBlocks_SitemapPluginAwBlog_Model_Observer extends Varien_Object
18
+ {
19
+ public function processSource($event)
20
+ {
21
+ $sitemap = $event->getSitemap();
22
+ //
23
+ Mage::getModel('sitemapPluginAwBlog/processor_blog_blog')->process($sitemap);
24
+ }
25
+ }
app/code/community/CueBlocks/SitemapPluginAwBlog/Model/Processor/Blog/Blog.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Description of
4
+ * @package CueBlocks_SitemapPluginAwBlog
5
+ * @company CueBlocks - http://www.cueblocks.com/
6
+ * @author Francesco Magazzu' <francesco.magazzu at cueblocks.com>
7
+ * @support <magento at cueblocks.com>
8
+ */
9
+
10
+
11
+ class CueBlocks_SitemapPluginAwBlog_Model_Processor_Blog_Blog extends CueBlocks_SitemapEnhancedPlus_Model_Processor_Abstract
12
+ {
13
+ protected $_configKey = 'blog';
14
+ protected $_sourceModel = 'sitemapPluginAwBlog/processor_blog_blog';
15
+ protected $_fileName = '_blog';
16
+ protected $_counterLabel = 'AW Blog';
17
+
18
+ protected function _getUrl($row)
19
+ {
20
+ $url = '';
21
+ $route = Mage::getStoreConfig('blog/blog/route');
22
+ if ($route == "") {
23
+ $route = "blog";
24
+ }
25
+
26
+ $url = $route . '/' . $row['url'];
27
+ return $url;
28
+ }
29
+ }
app/code/community/CueBlocks/SitemapPluginAwBlog/etc/config.xml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <CueBlocks_SitemapPluginAwBlog>
5
+ <version>0.1.0</version>
6
+ </CueBlocks_SitemapPluginAwBlog>
7
+ </modules>
8
+ <global>
9
+ <models>
10
+ <sitemapPluginAwBlog>
11
+ <class>CueBlocks_SitemapPluginAwBlog_Model</class>
12
+ <resourceModel>sitemapPluginAwBlog_mysql4</resourceModel>
13
+ </sitemapPluginAwBlog>
14
+ <sitemapPluginAwBlog_mysql4>
15
+ <class>CueBlocks_SitemapPluginAwBlog_Model_Mysql4</class>
16
+ </sitemapPluginAwBlog_mysql4>
17
+ </models>
18
+ <events>
19
+ <cb_sitemap_plus_process_sources_before>
20
+ <observers>
21
+ <cueblocks_feed>
22
+ <type>singleton</type>
23
+ <class>sitemapPluginAwBlog/observer</class>
24
+ <method>processSource</method>
25
+ </cueblocks_feed>
26
+ </observers>
27
+ </cb_sitemap_plus_process_sources_before>
28
+ </events>
29
+ </global>
30
+ <default>
31
+ <sitemapEnhancedPlus>
32
+ <blog>
33
+ <enabled>1</enabled>
34
+ <enabled_realdate>1</enabled_realdate>
35
+ <priority>0.25</priority>
36
+ <changefreq>daily</changefreq>
37
+ </blog>
38
+ </sitemapEnhancedPlus>
39
+ </default>
40
+ </config>
app/code/community/CueBlocks/SitemapPluginAwBlog/etc/system.xml ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * @package CueBlocks_SitemapPluginAwBlog
4
+ * @company CueBlocks
5
+ * @author Francesco Magazzu' <francesco.magazzu at cueblocks.com>
6
+ -->
7
+ <config>
8
+ <sections>
9
+ <sitemapEnhancedPlus translate="label" module="sitemapEnhancedPlus">
10
+ <label>XML Sitemap Plus Generator &#38; Splitter</label>
11
+ <groups>
12
+ <blog translate="label">
13
+ <label>AW Blog Options</label>
14
+ <frontend_type>text</frontend_type>
15
+ <sort_order>40</sort_order>
16
+ <show_in_default>1</show_in_default>
17
+ <show_in_website>1</show_in_website>
18
+ <show_in_store>1</show_in_store>
19
+ <fields>
20
+ <enabled>
21
+ <label>Enable</label>
22
+ <frontend_type>select</frontend_type>
23
+ <source_model>adminhtml/system_config_source_yesno</source_model>
24
+ <sort_order>10</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ <comment>Include/exclude AW Blog pages in XML Sitemap.</comment>
29
+ <tooltip>If 'included', a XML sitemap containing only 'AW Blog' pages will be generated. Once
30
+ generated, this XML Sitemap filename will be appended with '_blog' to help you identify
31
+ that this sitemap has AW Blog pages in it.
32
+ </tooltip>
33
+ </enabled>
34
+ <enabled_realdate>
35
+ <label>Use real update date</label>
36
+ <frontend_type>select</frontend_type>
37
+ <source_model>adminhtml/system_config_source_yesno</source_model>
38
+ <sort_order>18</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ <comment>If you select 'yes' it will be used the date when the Blog page was updated. If you
43
+ select 'no' the date used will be the current one.
44
+ </comment>
45
+ <tooltip></tooltip>
46
+ <depends>
47
+ <enabled>1</enabled>
48
+ </depends>
49
+ </enabled_realdate>
50
+ <changefreq translate="label">
51
+ <label>Frequency (Optional)</label>
52
+ <frontend_type>select</frontend_type>
53
+ <source_model>sitemapEnhancedPlus/system_config_source_frequency</source_model>
54
+ <sort_order>11</sort_order>
55
+ <show_in_default>1</show_in_default>
56
+ <show_in_website>1</show_in_website>
57
+ <show_in_store>1</show_in_store>
58
+ <comment>How frequently is the content on the Blog pages likely to change ?</comment>
59
+ <tooltip>This value is only a hint to Search Engines and may not correlate exactly to how
60
+ often search engines crawl the Blog pages.
61
+ </tooltip>
62
+ <depends>
63
+ <enabled>1</enabled>
64
+ </depends>
65
+ </changefreq>
66
+ <priority translate="label comment">
67
+ <label>Priority (Optional)</label>
68
+ <frontend_type>text</frontend_type>
69
+ <backend_model>sitemapEnhancedPlus/system_config_backend_priority</backend_model>
70
+ <sort_order>20</sort_order>
71
+ <show_in_default>1</show_in_default>
72
+ <show_in_website>1</show_in_website>
73
+ <show_in_store>1</show_in_store>
74
+ <comment>The valid range is from 0.0 to 1.0, with 1.0 being the most important.</comment>
75
+ <tooltip>This indicates priority of your 'Blog' pages relative to all the other pages on the
76
+ site to Search Engines. Assigning a high priority to all the pages will not help your
77
+ site's search ranking.
78
+ </tooltip>
79
+ <depends>
80
+ <enabled>1</enabled>
81
+ </depends>
82
+ </priority>
83
+ <!--<excluded_pages translate="label">-->
84
+ <!--<label>Excluded pages</label>-->
85
+ <!--<frontend_type>multiselect</frontend_type>-->
86
+ <!--<can_be_empty>1</can_be_empty>-->
87
+ <!--<source_model>sitemapEnhancedPlus/system_config_source_cms</source_model>-->
88
+ <!--<sort_order>30</sort_order>-->
89
+ <!--<show_in_default>1</show_in_default>-->
90
+ <!--<show_in_website>1</show_in_website>-->
91
+ <!--<show_in_store>1</show_in_store>-->
92
+ <!--<comment>Press the 'Control' key and select the CMS pages that you want to exclude from your-->
93
+ <!--XML Sitemap(s).-->
94
+ <!--</comment>-->
95
+ <!--<depends>-->
96
+ <!--<enabled>1</enabled>-->
97
+ <!--</depends>-->
98
+ <!--</excluded_pages>-->
99
+ <js>
100
+ <frontend_type>hidden</frontend_type>
101
+ <sort_order>99</sort_order>
102
+ <show_in_default>1</show_in_default>
103
+ <show_in_website>1</show_in_website>
104
+ <show_in_store>1</show_in_store>
105
+ <comment>
106
+ <![CDATA[<script type='text/javascript'>
107
+
108
+ var groupId = 'sitemapEnhancedPlus_blog';
109
+ var jsRowId = 'tr#row_'+groupId+'_js';
110
+ var selectId = groupId+'_enabled';
111
+
112
+ hideFields(jsRowId);
113
+ addEventObserver(groupId,selectId);
114
+
115
+ </script> ]]>
116
+ </comment>
117
+ </js>
118
+ </fields>
119
+ </blog>
120
+ </groups>
121
+ </sitemapEnhancedPlus>
122
+ </sections>
123
+ </config>
app/etc/modules/CueBlocks_SitemapPluginAwBlog.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <CueBlocks_SitemapPluginAwBlog>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </CueBlocks_SitemapPluginAwBlog>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>CueBlocks_XMLSitemap_Plus_Plugin_AwBlog</name>
4
+ <version>1.0.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://store.cueblocks.com/LICENSE_STORE.txt">EULA</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Add Aw Blog support </summary>
10
+ <description>Add Aw Blog support </description>
11
+ <notes>Developed by CueBlocks - December 2013</notes>
12
+ <authors><author><name>Francesco Magazzu'</name><user>Franky</user><email>magento@cueblocks.com</email></author></authors>
13
+ <date>2014-01-23</date>
14
+ <time>09:17:52</time>
15
+ <contents><target name="magecommunity"><dir name="CueBlocks"><dir name="SitemapPluginAwBlog"><dir name="Model"><dir name="Mysql4"><dir name="Processor"><dir name="Blog"><file name="Blog.php" hash="066f17d0921e5888db34a6f9546feae3"/></dir></dir></dir><file name="Observer.php" hash="ca385e1d13c4efc415efb233cb02b1b7"/><dir name="Processor"><dir name="Blog"><file name="Blog.php" hash="b4e5f712c117fafe2651b5a994989a55"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="c0e7d3f82388691290c3f83ce03212ec"/><file name="system.xml" hash="7c73aa4544815f43aac9857f7531ffd7"/></dir></dir></dir></target><target name="mageetc"><dir><dir name="modules"><file name="CueBlocks_SitemapPluginAwBlog.xml" hash="034ba8ea5bb5a7a79c99389e250b33b5"/></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>