Reviews_Sidebar - Version 1.0.7

Version Notes

Bugfix
* Product images

Download this release

Release Info

Developer Magento Core Team
Extension Reviews_Sidebar
Version 1.0.7
Comparing to
See all releases


Code changes from version 1.0.5 to 1.0.7

app/code/community/Amasty/Review/Block/Sidebar.php CHANGED
@@ -24,6 +24,18 @@ class Amasty_Review_Block_Sidebar extends Mage_Core_Block_Template
24
  else
25
  $collection->getSelect()->order('rand()');
26
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  $collection->load();
28
 
29
 
@@ -45,6 +57,7 @@ class Amasty_Review_Block_Sidebar extends Mage_Core_Block_Template
45
  }
46
 
47
  $this->setReviews($collection);
 
48
  }
49
 
50
 
24
  else
25
  $collection->getSelect()->order('rand()');
26
 
27
+ // sinse v1.0.6
28
+ $currProduct = Mage::registry('product');
29
+ $currCategory = Mage::registry('current_category');
30
+
31
+ if (Mage::getStoreConfig('amreview/sidebar/for_product') && $currProduct instanceof Mage_Catalog_Model_Product){
32
+ $collection->addEntityFilter($currProduct->getId());
33
+ }
34
+ elseif (Mage::getStoreConfig('amreview/sidebar/for_category') && $currCategory instanceof Mage_Catalog_Model_Category){
35
+ $collection->addCategoryFilter($currCategory);
36
+ }
37
+
38
+ //echo $collection->getSelect(); exit;
39
  $collection->load();
40
 
41
 
57
  }
58
 
59
  $this->setReviews($collection);
60
+ return parent::_prepareLayout();
61
  }
62
 
63
 
app/code/community/Amasty/Review/Model/Mysql4/Collection.php CHANGED
@@ -11,6 +11,7 @@ class Amasty_Review_Model_Mysql4_Collection extends Mage_Review_Model_Mysql4_Rev
11
 
12
  $this->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
13
  ->addStoreFilter($store->getId())
 
14
  ->addAttributeToSelect(array('name','visibility'), 'inner');
15
 
16
  Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this);
11
 
12
  $this->addStatusFilter(Mage_Review_Model_Review::STATUS_APPROVED)
13
  ->addStoreFilter($store->getId())
14
+ ->addAttributeToSelect('thumbnail')
15
  ->addAttributeToSelect(array('name','visibility'), 'inner');
16
 
17
  Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($this);
app/code/community/Amasty/Review/etc/config.xml CHANGED
@@ -1,112 +1,114 @@
1
- <?xml version="1.0"?>
2
- <config>
3
- <modules>
4
- <Amasty_Review>
5
- <version>1.0.5</version>
6
- </Amasty_Review>
7
- </modules>
8
- <adminhtml>
9
- <acl>
10
- <resources>
11
- <all>
12
- <title>Allow Everything</title>
13
- </all>
14
- <admin>
15
- <children>
16
- <system>
17
- <children>
18
- <config>
19
- <children>
20
- <amreview translate="title" module="amreview">
21
- <title>Reviews Sidebar</title>
22
- </amreview>
23
- </children>
24
- </config>
25
- </children>
26
- </system>
27
- </children>
28
- </admin>
29
- </resources>
30
- </acl>
31
- <translate>
32
- <modules>
33
- <Amasty_Review>
34
- <files>
35
- <default>Amasty_Review.csv</default>
36
- </files>
37
- </Amasty_Review>
38
- </modules>
39
- </translate>
40
- </adminhtml>
41
- <frontend>
42
- <translate>
43
- <modules>
44
- <Amasty_Review>
45
- <files>
46
- <default>Amasty_Review.csv</default>
47
- </files>
48
- </Amasty_Review>
49
- </modules>
50
- </translate>
51
- <layout>
52
- <updates>
53
- <amreview>
54
- <file>amreview.xml</file>
55
- </amreview>
56
- </updates>
57
- </layout>
58
- </frontend>
59
- <global>
60
- <models>
61
- <amreview>
62
- <class>Amasty_Review_Model</class>
63
- <resourceModel>amreview_mysql4</resourceModel>
64
- </amreview>
65
- <amreview_mysql4>
66
- <class>Amasty_Review_Model_Mysql4</class>
67
- </amreview_mysql4>
68
- </models>
69
- <resources>
70
- <amreview_setup>
71
- <setup>
72
- <module>Amasty_Review</module>
73
- </setup>
74
- <connection>
75
- <use>core_setup</use>
76
- </connection>
77
- </amreview_setup>
78
- <amreview_write>
79
- <connection>
80
- <use>core_write</use>
81
- </connection>
82
- </amreview_write>
83
- <amreview_read>
84
- <connection>
85
- <use>core_read</use>
86
- </connection>
87
- </amreview_read>
88
- </resources>
89
- <blocks>
90
- <amreview>
91
- <class>Amasty_Review_Block</class>
92
- </amreview>
93
- </blocks>
94
- <helpers>
95
- <amreview>
96
- <class>Amasty_Review_Helper</class>
97
- </amreview>
98
- </helpers>
99
- </global>
100
-
101
- <default>
102
- <amreview>
103
- <sidebar>
104
- <active>1</active>
105
- <by_date>1</by_date>
106
- <count>5</count>
107
- <max_words>30</max_words>
108
- <show_stars>1</show_stars>
109
- </sidebar>
110
- </amreview>
111
- </default>
 
 
112
  </config>
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Amasty_Review>
5
+ <version>1.0.6</version>
6
+ </Amasty_Review>
7
+ </modules>
8
+ <adminhtml>
9
+ <acl>
10
+ <resources>
11
+ <all>
12
+ <title>Allow Everything</title>
13
+ </all>
14
+ <admin>
15
+ <children>
16
+ <system>
17
+ <children>
18
+ <config>
19
+ <children>
20
+ <amreview translate="title" module="amreview">
21
+ <title>Reviews Sidebar</title>
22
+ </amreview>
23
+ </children>
24
+ </config>
25
+ </children>
26
+ </system>
27
+ </children>
28
+ </admin>
29
+ </resources>
30
+ </acl>
31
+ <translate>
32
+ <modules>
33
+ <Amasty_Review>
34
+ <files>
35
+ <default>Amasty_Review.csv</default>
36
+ </files>
37
+ </Amasty_Review>
38
+ </modules>
39
+ </translate>
40
+ </adminhtml>
41
+ <frontend>
42
+ <translate>
43
+ <modules>
44
+ <Amasty_Review>
45
+ <files>
46
+ <default>Amasty_Review.csv</default>
47
+ </files>
48
+ </Amasty_Review>
49
+ </modules>
50
+ </translate>
51
+ <layout>
52
+ <updates>
53
+ <amreview>
54
+ <file>amreview.xml</file>
55
+ </amreview>
56
+ </updates>
57
+ </layout>
58
+ </frontend>
59
+ <global>
60
+ <models>
61
+ <amreview>
62
+ <class>Amasty_Review_Model</class>
63
+ <resourceModel>amreview_mysql4</resourceModel>
64
+ </amreview>
65
+ <amreview_mysql4>
66
+ <class>Amasty_Review_Model_Mysql4</class>
67
+ </amreview_mysql4>
68
+ </models>
69
+ <resources>
70
+ <amreview_setup>
71
+ <setup>
72
+ <module>Amasty_Review</module>
73
+ </setup>
74
+ <connection>
75
+ <use>core_setup</use>
76
+ </connection>
77
+ </amreview_setup>
78
+ <amreview_write>
79
+ <connection>
80
+ <use>core_write</use>
81
+ </connection>
82
+ </amreview_write>
83
+ <amreview_read>
84
+ <connection>
85
+ <use>core_read</use>
86
+ </connection>
87
+ </amreview_read>
88
+ </resources>
89
+ <blocks>
90
+ <amreview>
91
+ <class>Amasty_Review_Block</class>
92
+ </amreview>
93
+ </blocks>
94
+ <helpers>
95
+ <amreview>
96
+ <class>Amasty_Review_Helper</class>
97
+ </amreview>
98
+ </helpers>
99
+ </global>
100
+
101
+ <default>
102
+ <amreview>
103
+ <sidebar>
104
+ <active>1</active>
105
+ <by_date>1</by_date>
106
+ <count>5</count>
107
+ <max_words>30</max_words>
108
+ <show_stars>1</show_stars>
109
+ <for_product>0</for_product>
110
+ <for_category>0</for_category>
111
+ </sidebar>
112
+ </amreview>
113
+ </default>
114
  </config>
app/code/community/Amasty/Review/etc/system.xml CHANGED
@@ -62,6 +62,24 @@
62
  <show_in_website>1</show_in_website>
63
  <show_in_store>1</show_in_store>
64
  </show_stars>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  </fields>
66
  </sidebar>
67
  </groups>
62
  <show_in_website>1</show_in_website>
63
  <show_in_store>1</show_in_store>
64
  </show_stars>
65
+ <for_category translate="label">
66
+ <label>Reviews for Current Category</label>
67
+ <frontend_type>select</frontend_type>
68
+ <source_model>adminhtml/system_config_source_yesno</source_model>
69
+ <sort_order>60</sort_order>
70
+ <show_in_default>1</show_in_default>
71
+ <show_in_website>1</show_in_website>
72
+ <show_in_store>1</show_in_store>
73
+ </for_category>
74
+ <for_product translate="label">
75
+ <label>Reviews for Current Product</label>
76
+ <frontend_type>select</frontend_type>
77
+ <source_model>adminhtml/system_config_source_yesno</source_model>
78
+ <sort_order>70</sort_order>
79
+ <show_in_default>1</show_in_default>
80
+ <show_in_website>1</show_in_website>
81
+ <show_in_store>1</show_in_store>
82
+ </for_product>
83
  </fields>
84
  </sidebar>
85
  </groups>
app/code/local/Amasty/Base/Model/Feed.php CHANGED
@@ -100,7 +100,8 @@ class Amasty_Base_Model_Feed extends Mage_AdminNotification_Model_Feed
100
  if (is_null($this->_feedUrl)) {
101
  $this->_feedUrl = self::URL_NEWS;
102
  }
103
- return $this->_feedUrl;
 
104
  }
105
 
106
  protected function getInterests()
100
  if (is_null($this->_feedUrl)) {
101
  $this->_feedUrl = self::URL_NEWS;
102
  }
103
+ $query = '?s=' . urlencode(Mage::getStoreConfig('web/unsecure/base_url'));
104
+ return $this->_feedUrl . $query;
105
  }
106
 
107
  protected function getInterests()
app/design/frontend/default/default/layout/amreview.xml CHANGED
@@ -1,15 +1,15 @@
1
- <?xml version="1.0"?>
2
- <layout version="0.1.0">
3
- <default>
4
- <reference name="right">
5
- <block type="amreview/sidebar" name="amreview_sidebar"
6
- template="amreview/sidebar.phtml"/>
7
- </reference>
8
- <!-- begin: comment this block if you use 3colunms template -->
9
- <reference name="left">
10
- <block type="amreview/sidebar" name="amreview_sidebar"
11
- template="amreview/sidebar.phtml" />
12
- </reference>
13
- <!-- end -->
14
- </default>
15
  </layout>
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.0">
3
+ <default>
4
+ <reference name="right">
5
+ <block type="amreview/sidebar" name="amreview_sidebar" before="-"
6
+ template="amreview/sidebar.phtml"/>
7
+ </reference>
8
+ <!-- begin: comment this block if you use 3colunms template -->
9
+ <reference name="left">
10
+ <block type="amreview/sidebar" name="amreview_sidebar"
11
+ template="amreview/sidebar.phtml" />
12
+ </reference>
13
+ <!-- end -->
14
+ </default>
15
  </layout>
app/design/frontend/default/default/template/amreview/sidebar.phtml CHANGED
@@ -1,4 +1,4 @@
1
- <?php $reviews = $this->getReviews() ?>
2
  <?php if ($reviews && $reviews->count() > 0) : ?>
3
  <div class="block block-review">
4
  <div class="block-title">
@@ -6,6 +6,11 @@
6
  </div>
7
  <div class="block-content">
8
  <?php foreach ($reviews as $review): ?>
 
 
 
 
 
9
  <h5><a href="<?php echo $review->getUrl()?>"><?php echo $this->htmlEscape($review->getName())?></a></h5>
10
  <?php echo $this->__('Review by %s', $this->htmlEscape($review->getNickname()))?>
11
  <?php if (count($review->getRatingVotes())): ?>
@@ -33,4 +38,4 @@
33
  <?php endforeach ?>
34
  </div>
35
  </div>
36
- <?php endif ?>
1
+ <?php $reviews = $this->getReviews() ?>
2
  <?php if ($reviews && $reviews->count() > 0) : ?>
3
  <div class="block block-review">
4
  <div class="block-title">
6
  </div>
7
  <div class="block-content">
8
  <?php foreach ($reviews as $review): ?>
9
+
10
+ <div class="product-images">
11
+ <a href="<?php echo $review->getUrl()?>"><img src="<?php echo $this->helper('catalog/image')->init($review, 'thumbnail')->resize(50) ?>" alt="<?php echo $this->htmlEscape($review->getName()) ?>" width="50" height="50" /></a>
12
+ </div>
13
+
14
  <h5><a href="<?php echo $review->getUrl()?>"><?php echo $this->htmlEscape($review->getName())?></a></h5>
15
  <?php echo $this->__('Review by %s', $this->htmlEscape($review->getNickname()))?>
16
  <?php if (count($review->getRatingVotes())): ?>
38
  <?php endforeach ?>
39
  </div>
40
  </div>
41
+ <?php endif ?>
app/design/frontend/default/default/template/amreview/sidebar_images.phtml ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php $reviews = $this->getReviews() ?>
2
+ <?php if ($reviews && $reviews->count() > 0) : ?>
3
+ <div class="block block-review">
4
+ <div class="block-title">
5
+ <strong><span><?php echo $this->__("Product's Reviews") ?></span></strong>
6
+ </div>
7
+ <div class="block-content">
8
+ <?php foreach ($reviews as $review): ?>
9
+ <table width="100%" border="0" >
10
+ <tr>
11
+ <td width="55px">
12
+ <a href="<?php echo $review->getUrl()?>"><img src="<?php echo $this->helper('catalog/image')->init($review, 'thumbnail')->resize(50) ?>" alt="<?php echo $this->htmlEscape($review->getName()) ?>" width="50" height="50" /></a>
13
+ <td>
14
+ <td align="left">
15
+ <p class="product-name"><a href="<?php echo $review->getUrl()?>"><?php echo $this->htmlEscape($review->getName()) ?></a></p>
16
+ <?php echo $this->__('Review by %s', $this->htmlEscape($review->getNickname()))?>
17
+ <td>
18
+ </tr>
19
+ </table>
20
+ <?php if (count($review->getRatingVotes())): ?>
21
+ <table class="ratings-list" cellspacing="0">
22
+ <tbody>
23
+ <?php foreach ($review->getRatingVotes() as $_vote): ?>
24
+ <tr>
25
+ <td class="label"><strong><?php echo $_vote->getRatingCode() ?></strong>:</td>
26
+ <td>
27
+ <div class="rating-box">
28
+ <div class="rating" style="width: <?php echo $_vote->getPercent() ?>%;"></div>
29
+ </div>
30
+ </td>
31
+ </tr>
32
+ <?php endforeach ?>
33
+ </tbody>
34
+ </table>
35
+ <?php else: ?>
36
+ <br />
37
+ <?php endif;?>
38
+ <strong><?php echo $this->htmlEscape($review->getTitle())?></strong>.<br/>
39
+ <?php echo $this->htmlEscape($review->getDetail())?>
40
+ <br />
41
+ <?php endforeach ?>
42
+ </div>
43
+ </div>
44
+ <?php endif ?>
package.xml CHANGED
@@ -1,18 +1,19 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Reviews_Sidebar</name>
4
- <version>1.0.5</version>
5
  <stability>stable</stability>
6
  <license>AFL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Reviews sidebar block</summary>
10
  <description>Reviews sidebar block</description>
11
- <notes>None</notes>
 
12
  <authors><author><name>Amasty Team</name><user>auto-converted</user><email>amastysupport@gmail.com</email></author></authors>
13
- <date>2011-03-05</date>
14
- <time>15:31:41</time>
15
- <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="ambase"><file name="bad.gif" hash="b8379f1ba7ab552ca46b9d5fd0452345"/><file name="ok.gif" hash="a38bc2ee6e116e39c6e2e3013ee50f5e"/><file name="update.gif" hash="8342e11f7739fcfa25134707f0536ed6"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Amasty"><dir name="Base"><dir name="Block"><file name="Extensions.php" hash="e0f76a6c0e9d3db6f634562cbb0266bc"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2134fcecc3d5cb639a2446dded0032d5"/><file name="config.xml" hash="d4da2c9935b894c6362576209905ff89"/><file name="system.xml" hash="d7e5cda7d0b09152931039fdf1d4b2bc"/></dir><dir name="Helper"><file name="Data.php" hash="dd3a5d1f14acb20f3a86c43d50fe0dd4"/></dir><dir name="Model"><file name="Feed.php" hash="eac82b4e6093caaeee75ed815974e95f"/><dir name="Source"><dir name="Updates"><file name="Type.php" hash="dbb958c4aa01c61578cfb22a1c88a482"/></dir></dir></dir><dir name="sql"><dir name="ambase_setup"><file name="mysql4-install-1.0.0.php" hash="ba30c778afd0f4a959ec9f86d439ea0a"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="f3190a47b20973b8526213c60c96b304"/></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Amasty"><dir name="Review"><dir name="Block"><file name="Sidebar.php" hash="728917213d55a4e0878a1adf7560beda"/></dir><dir name="etc"><file name="adminhtml.xml" hash="95bdba467b5adbf7920b239fc0e1a003"/><file name="config.xml" hash="48b83a8848431c3f26edd01b4ab54f6b"/><file name="system.xml" hash="9416b00448bcd2e251196088b3175e4e"/></dir><dir name="Helper"><file name="Data.php" hash="e21dbd2eb8bbbb330f01d9f1c0c6785a"/></dir><dir name="Model"><dir name="Mysql4"><file name="Collection.php" hash="92d8ff7b807bf3fc9aa23be784dc7414"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="amreview.xml" hash="bb51db7e5319681cbcdb30818cafb9d1"/></dir><dir name="template"><dir name="amreview"><file name="sidebar.phtml" hash="59fa56389faa85d68468caa7351f7cf8"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amasty_Base.xml" hash="651f99cee7568ab645fdef118f7933ca"/><file name="Amasty_Review.xml" hash="84f047ff01bce56c789217157cdcfd53"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies/>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Reviews_Sidebar</name>
4
+ <version>1.0.7</version>
5
  <stability>stable</stability>
6
  <license>AFL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Reviews sidebar block</summary>
10
  <description>Reviews sidebar block</description>
11
+ <notes>Bugfix
12
+ * Product images</notes>
13
  <authors><author><name>Amasty Team</name><user>auto-converted</user><email>amastysupport@gmail.com</email></author></authors>
14
+ <date>2011-06-06</date>
15
+ <time>10:20:01</time>
16
+ <contents><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="images"><dir name="ambase"><file name="bad.gif" hash="b8379f1ba7ab552ca46b9d5fd0452345"/><file name="ok.gif" hash="a38bc2ee6e116e39c6e2e3013ee50f5e"/><file name="update.gif" hash="8342e11f7739fcfa25134707f0536ed6"/></dir></dir></dir></dir></dir></target><target name="magelocal"><dir name="Amasty"><dir name="Base"><dir name="Block"><file name="Extensions.php" hash="e0f76a6c0e9d3db6f634562cbb0266bc"/></dir><dir name="etc"><file name="adminhtml.xml" hash="2134fcecc3d5cb639a2446dded0032d5"/><file name="config.xml" hash="d4da2c9935b894c6362576209905ff89"/><file name="system.xml" hash="d7e5cda7d0b09152931039fdf1d4b2bc"/></dir><dir name="Helper"><file name="Data.php" hash="dd3a5d1f14acb20f3a86c43d50fe0dd4"/></dir><dir name="Model"><file name="Feed.php" hash="86fb0e24d6b1c9706caf69c908e710ad"/><dir name="Source"><dir name="Updates"><file name="Type.php" hash="dbb958c4aa01c61578cfb22a1c88a482"/></dir></dir></dir><dir name="sql"><dir name="ambase_setup"><file name="mysql4-install-1.0.0.php" hash="ba30c778afd0f4a959ec9f86d439ea0a"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="f3190a47b20973b8526213c60c96b304"/></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Amasty"><dir name="Review"><dir name="Block"><file name="Sidebar.php" hash="c464d4b8fd7c8a74f3ce4f7f8a2c5562"/></dir><dir name="etc"><file name="adminhtml.xml" hash="95bdba467b5adbf7920b239fc0e1a003"/><file name="config.xml" hash="1d233517e4695870ba93c46123e4760a"/><file name="system.xml" hash="2092043aa2bbe5a673319f9d3bbac1a1"/></dir><dir name="Helper"><file name="Data.php" hash="e21dbd2eb8bbbb330f01d9f1c0c6785a"/></dir><dir name="Model"><dir name="Mysql4"><file name="Collection.php" hash="f5efffbf317f19b6e949a084075bde7b"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="amreview.xml" hash="df5b539c074f466e863cff47a4c98ac5"/></dir><dir name="template"><dir name="amreview"><file name="sidebar.phtml" hash="9012ef6ac60dedc69c70c03439a0d506"/><file name="sidebar_images.phtml" hash="be4ff35b0a3e092f5c9f5bfdeb1f2e0c"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Amasty_Base.xml" hash="651f99cee7568ab645fdef118f7933ca"/><file name="Amasty_Review.xml" hash="84f047ff01bce56c789217157cdcfd53"/></dir></target></contents>
17
  <compatible/>
18
  <dependencies/>
19
  </package>