Clarion_Reviewimage - Version 1.0.2

Version Notes

1.0.2

Download this release

Release Info

Developer kushagra daharwal
Extension Clarion_Reviewimage
Version 1.0.2
Comparing to
See all releases


Code changes from version 1.0.1 to 1.0.2

app/design/frontend/{base → default}/default/layout/reviewimage.xml RENAMED
File without changes
app/design/frontend/{base → default}/default/template/review/form.phtml RENAMED
@@ -20,14 +20,14 @@
20
  *
21
  * @category design
22
  * @package base_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
27
  <div class="form-add">
28
- <h2><?php echo $this->__('Write Your Own Review') ?></h2>
29
  <?php if ($this->getAllowWriteReviewFlag()): ?>
30
- <form action="<?php echo $this->getAction() ?>" method="post" id="review-form">
31
  <?php echo $this->getBlockHtml('formkey'); ?>
32
  <fieldset>
33
  <?php echo $this->getChildHtml('form_fields_before')?>
@@ -79,6 +79,15 @@
79
  <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getTitle()) ?>" />
80
  </div>
81
  </li>
 
 
 
 
 
 
 
 
 
82
  <li>
83
  <label for="review_field" class="required"><em>*</em><?php echo $this->__('Review') ?></label>
84
  <div class="input-box">
20
  *
21
  * @category design
22
  * @package base_default
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
27
  <div class="form-add">
28
+ <h2><?php echo $this->__('Write Your Own Reviews') ?></h2>
29
  <?php if ($this->getAllowWriteReviewFlag()): ?>
30
+ <form action="<?php echo $this->getAction() ?>" method="post" id="review-form" enctype="multipart/form-data">
31
  <?php echo $this->getBlockHtml('formkey'); ?>
32
  <fieldset>
33
  <?php echo $this->getChildHtml('form_fields_before')?>
79
  <input type="text" name="title" id="summary_field" class="input-text required-entry" value="<?php echo $this->escapeHtml($data->getTitle()) ?>" />
80
  </div>
81
  </li>
82
+ <?php if(Mage::helper("reviewimage")->getActive() == '1'):?>
83
+ <li>
84
+ <label for="reviewimage" class="required"><em>*</em><?php echo $this->__('Review Image') ?></label>
85
+ <div class="input-box">
86
+ <input type="file" name="reviewimage" class="input-text required-entry"/>
87
+ </div>
88
+
89
+ </li>
90
+ <?php endif;?>
91
  <li>
92
  <label for="review_field" class="required"><em>*</em><?php echo $this->__('Review') ?></label>
93
  <div class="input-box">
app/design/frontend/{base → default}/default/template/review/product/view/list.phtml RENAMED
@@ -20,7 +20,7 @@
20
  *
21
  * @category design
22
  * @package base_default
23
- * @copyright Copyright (c) 2014 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
@@ -32,9 +32,40 @@
32
  <?php echo $this->getChildHtml('toolbar') ?>
33
  <dl>
34
  <?php foreach ($_items as $_review):?>
 
 
35
  <dt>
36
  <a href="<?php echo $this->getReviewUrl($_review->getId()) ?>"><?php echo $this->escapeHtml($_review->getTitle()) ?></a> <?php echo $this->__('Review by <span>%s</span>', $this->escapeHtml($_review->getNickname())) ?>
37
  </dt>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  <dd>
39
  <?php $_votes = $_review->getRatingVotes(); ?>
40
  <?php if (count($_votes)): ?>
@@ -50,6 +81,7 @@
50
  <div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;"></div>
51
  </div>
52
  </td>
 
53
  </tr>
54
  <?php endforeach; ?>
55
  </tbody>
20
  *
21
  * @category design
22
  * @package base_default
23
+ * @copyright Copyright (c) 2013 Magento Inc. (http://www.magentocommerce.com)
24
  * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
25
  */
26
  ?>
32
  <?php echo $this->getChildHtml('toolbar') ?>
33
  <dl>
34
  <?php foreach ($_items as $_review):?>
35
+
36
+
37
  <dt>
38
  <a href="<?php echo $this->getReviewUrl($_review->getId()) ?>"><?php echo $this->escapeHtml($_review->getTitle()) ?></a> <?php echo $this->__('Review by <span>%s</span>', $this->escapeHtml($_review->getNickname())) ?>
39
  </dt>
40
+ <?php if(Mage::helper("reviewimage")->getActive() == '1'):?>
41
+ <?php if($_review->getReviewimage()):?>
42
+ <?php
43
+ /*
44
+ * image resize function
45
+ */
46
+ $imageUrl = Mage::getBaseUrl("media").'reviewimages/'.$_review->getReviewimage();
47
+
48
+ $imageName = $_review->getReviewimage();
49
+ $imageResized = Mage::getBaseDir('media').DS."creviewimages".DS.$imageName;
50
+ $dirImg = Mage::getBaseDir().str_replace("/",DS,strstr($imageUrl,'/media'));
51
+
52
+ if (!file_exists($imageResized)&&file_exists($dirImg)) :
53
+ $imageObj = new Varien_Image($dirImg);
54
+ $imageObj->constrainOnly(TRUE);
55
+ $imageObj->keepAspectRatio(TRUE);
56
+ $imageObj->keepFrame(FALSE);
57
+ $Resolution = Mage::helper("reviewimage")->getResolution();
58
+ $imageObj->resize($Resolution);
59
+ $imageObj->save($imageResized);
60
+ endif;
61
+ $newImageUrl = Mage::getBaseUrl('media')."creviewimages/".$imageName;
62
+ /*
63
+ * image resize function
64
+ */
65
+ ?>
66
+ <dt style="margin:5px 5px;"><image src="<?php echo $newImageUrl;?>"/></dt>
67
+ <?php endif;?>
68
+ <?php endif;?>
69
  <dd>
70
  <?php $_votes = $_review->getRatingVotes(); ?>
71
  <?php if (count($_votes)): ?>
81
  <div class="rating" style="width:<?php echo $_vote->getPercent() ?>%;"></div>
82
  </div>
83
  </td>
84
+
85
  </tr>
86
  <?php endforeach; ?>
87
  </tbody>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Clarion_Reviewimage</name>
4
- <version>1.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Review Form With Image Field</summary>
10
  <description>Default magento dosent give this after installing this image upload field will display in review form.</description>
11
- <notes>1.0.1</notes>
12
  <authors><author><name>kushagra daharwal</name><user>kushagra</user><email>kushagra.daharwal@clariontechnologies.co.in</email></author></authors>
13
  <date>2014-06-12</date>
14
- <time>09:37:47</time>
15
- <contents><target name="magelocal"><dir name="Kush"><dir name="Reviewimage"><dir name="Block"><dir name="Adminhtml"><dir name="Review"><dir name="Edit"><file name="Form.php" hash="1d5ce08ce9547f7a4b5c02cb68d0b04c"/></dir></dir></dir><dir name="Review"><dir name="Edit"><file name="Form.php" hash="d94a56d39dc949bb82aef696565ac5a6"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="41e8f40134c803ca913ad26fb4dd21b9"/></dir><dir name="Model"><dir name="Resource"><dir name="Review"><file name="Collection.php" hash="04904bf97bcc293539e9af4d41323d4a"/></dir><file name="Review.php" hash="e796a0da2784ab890ca3de241b740c1f"/></dir><file name="Review.php" hash="382edade68e65d3b792536bc3895ef8d"/></dir><dir name="controllers"><file name="ProductController.php" hash="fbd9b2f22257170a069e1a7a3d6f5917"/></dir><dir name="etc"><file name="adminhtml.xml" hash="1510baa86869c3695fd1b0e9fad493f7"/><file name="config.xml" hash="17c37262d9d7cc7da7b7014a67413696"/><file name="system.xml" hash="0892252f2a519280b2ff61a831cc488b"/></dir><dir name="sql"><dir name="reviewimage_setup"><file name="mysql4-install-1.0.3.php" hash="c3f1b161b4c528d2e320fa40c7eb24a7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kush_Reviewimage.xml" hash="f79cca862b46da9a0dde3f29d81d2cfd"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="reviewimage.xml" hash="08d96b4a4ae63ccc9ac1faa38e153476"/></dir><dir name="template"><dir name="review"><file name="form.phtml" hash="73892e91dc2d271c092b501f304b2b2b"/><dir name="product"><dir name="view"><file name="list.phtml" hash="dac4187e1b466b50185e041e40c819b1"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="reviewimages"><file name="4.jpg" hash="78cd090d4be6f1b89c38873a7aeb93f5"/><file name="Installation_guide.pdf" hash="5c378e29f6ab6d72c10316ea342ffc93"/><file name="above-sale-n.jpg" hash="f7a71328ad4749a3daa21164fc197517"/><file name="adasadad.jpg" hash="680953cf98773d0ff4df81fdd0e681e2"/><file name="bxshowfuikles.jpg" hash="9142bbd5054368a9977725795c0050e4"/><file name="camra1.jpg" hash="78cd090d4be6f1b89c38873a7aeb93f5"/><file name="cannon1.jpg" hash="8c654988a51ff444ac1d6a0af8ca53dc"/><file name="canonmagenta_1.jpg" hash="16d262361b5cc28c84cfe4ede5c1f84b"/><file name="firstyw.jpg" hash="7554095a0e5510f6b1859915be703daf"/><file name="graphic-tee-creative-2.jpg" hash="19b8013fc20b5df3ececb36c15b0dee7"/><file name="men-1.jpg" hash="d6252cdedd1a333bff1a227b16a54fb2"/><file name="modern_d.jpg" hash="a2bf0aa46b09983c3c2fa60bf7ccb17d"/><file name="modern_y.jpg" hash="7186bf8894d6e2eeea8ae7283bc5fb09"/><file name="new-hp-kurti-banner.jpg" hash="aa0e5948c84c32f1391dcd0756c1a1e0"/><file name="r3-jeans-1.jpg" hash="2b0dd77b6fe04cd86d39159f5509a31b"/><file name="saw2w12w.jpg" hash="d5ae4e36ed288f803ee5bd8d980df1a3"/><file name="secondww_lion.jpg" hash="1b23c13c6891937b32302f84d8dc6f63"/><file name="shaden-3final.jpg" hash="3f353029307a587c600f90d5e1089848"/><file name="we-12.jpg" hash="5a3d34f5e41b8805f758e3b9db8a888a"/><file name="web-11-a.jpg" hash="77810c7e72f84860aaa4e8972ca5149e"/><file name="womens-offer-new.jpg" hash="0814e516f0fc998db925fe2ec5026173"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>kush_reviewimage</name><channel>community</channel><min>1.0.0</min><max>8.0.0</max></package><extension><name>gd</name><min>2.0.0</min><max>2.4</max></extension></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Clarion_Reviewimage</name>
4
+ <version>1.0.2</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Review Form With Image Field</summary>
10
  <description>Default magento dosent give this after installing this image upload field will display in review form.</description>
11
+ <notes>1.0.2</notes>
12
  <authors><author><name>kushagra daharwal</name><user>kushagra</user><email>kushagra.daharwal@clariontechnologies.co.in</email></author></authors>
13
  <date>2014-06-12</date>
14
+ <time>10:07:16</time>
15
+ <contents><target name="magelocal"><dir name="Kush"><dir name="Reviewimage"><dir name="Block"><dir name="Adminhtml"><dir name="Review"><dir name="Edit"><file name="Form.php" hash="1d5ce08ce9547f7a4b5c02cb68d0b04c"/></dir></dir></dir><dir name="Review"><dir name="Edit"><file name="Form.php" hash="d94a56d39dc949bb82aef696565ac5a6"/></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="41e8f40134c803ca913ad26fb4dd21b9"/></dir><dir name="Model"><dir name="Resource"><dir name="Review"><file name="Collection.php" hash="04904bf97bcc293539e9af4d41323d4a"/></dir><file name="Review.php" hash="e796a0da2784ab890ca3de241b740c1f"/></dir><file name="Review.php" hash="382edade68e65d3b792536bc3895ef8d"/></dir><dir name="controllers"><file name="ProductController.php" hash="fbd9b2f22257170a069e1a7a3d6f5917"/></dir><dir name="etc"><file name="adminhtml.xml" hash="1510baa86869c3695fd1b0e9fad493f7"/><file name="config.xml" hash="17c37262d9d7cc7da7b7014a67413696"/><file name="system.xml" hash="0892252f2a519280b2ff61a831cc488b"/></dir><dir name="sql"><dir name="reviewimage_setup"><file name="mysql4-install-1.0.3.php" hash="c3f1b161b4c528d2e320fa40c7eb24a7"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Kush_Reviewimage.xml" hash="f79cca862b46da9a0dde3f29d81d2cfd"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="default"><dir name="default"><dir name="layout"><file name="reviewimage.xml" hash="08d96b4a4ae63ccc9ac1faa38e153476"/></dir><dir name="template"><dir name="review"><file name="form.phtml" hash="858e5ba31252de3dc98de93d08e658c4"/><dir><dir name="product"><dir name="view"><file name="list.phtml" hash="b430aa6419bd76c3aa0e78ab83718d6b"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="magemedia"><dir name="reviewimages"><file name="4.jpg" hash="78cd090d4be6f1b89c38873a7aeb93f5"/><file name="Installation_guide.pdf" hash="5c378e29f6ab6d72c10316ea342ffc93"/><file name="above-sale-n.jpg" hash="f7a71328ad4749a3daa21164fc197517"/><file name="adasadad.jpg" hash="680953cf98773d0ff4df81fdd0e681e2"/><file name="bxshowfuikles.jpg" hash="9142bbd5054368a9977725795c0050e4"/><file name="camra1.jpg" hash="78cd090d4be6f1b89c38873a7aeb93f5"/><file name="cannon1.jpg" hash="8c654988a51ff444ac1d6a0af8ca53dc"/><file name="canonmagenta_1.jpg" hash="16d262361b5cc28c84cfe4ede5c1f84b"/><file name="firstyw.jpg" hash="7554095a0e5510f6b1859915be703daf"/><file name="graphic-tee-creative-2.jpg" hash="19b8013fc20b5df3ececb36c15b0dee7"/><file name="men-1.jpg" hash="d6252cdedd1a333bff1a227b16a54fb2"/><file name="modern_d.jpg" hash="a2bf0aa46b09983c3c2fa60bf7ccb17d"/><file name="modern_y.jpg" hash="7186bf8894d6e2eeea8ae7283bc5fb09"/><file name="new-hp-kurti-banner.jpg" hash="aa0e5948c84c32f1391dcd0756c1a1e0"/><file name="r3-jeans-1.jpg" hash="2b0dd77b6fe04cd86d39159f5509a31b"/><file name="saw2w12w.jpg" hash="d5ae4e36ed288f803ee5bd8d980df1a3"/><file name="secondww_lion.jpg" hash="1b23c13c6891937b32302f84d8dc6f63"/><file name="shaden-3final.jpg" hash="3f353029307a587c600f90d5e1089848"/><file name="we-12.jpg" hash="5a3d34f5e41b8805f758e3b9db8a888a"/><file name="web-11-a.jpg" hash="77810c7e72f84860aaa4e8972ca5149e"/><file name="womens-offer-new.jpg" hash="0814e516f0fc998db925fe2ec5026173"/></dir></target></contents>
16
  <compatible/>
17
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>kush_reviewimage</name><channel>community</channel><min>1.0.0</min><max>8.0.0</max></package><extension><name>gd</name><min>2.0.0</min><max>2.4</max></extension></required></dependencies>
18
  </package>