PPLSAY_Social_Discussions - Version 1.1.3

Version Notes

- Fixed performance issues

Download this release

Release Info

Developer PPLSAY Commerce Ltd
Extension PPLSAY_Social_Discussions
Version 1.1.3
Comparing to
See all releases


Code changes from version 1.1.2 to 1.1.3

Files changed (25) hide show
  1. app/code/community/PPLS/Discussions/Block/Discussions.php +9 -4
  2. app/code/community/PPLS/Discussions/Block/Discussions.php~ +16 -4
  3. app/code/community/PPLS/Discussions/Block/Virality.php +5 -43
  4. app/code/community/PPLS/Discussions/Block/Virality.php~ +5 -44
  5. app/code/community/PPLS/Discussions/Model/Discussions.php +58 -2
  6. app/code/community/PPLS/Discussions/Model/Discussions.php~ +58 -2
  7. app/code/community/PPLS/Discussions/Model/Observer.php +15 -1
  8. app/code/community/PPLS/Discussions/Model/Observer.php~ +6 -2
  9. app/code/community/PPLS/Discussions/Model/Virality.php +1 -33
  10. app/code/community/PPLS/Discussions/Model/Virality.php~ +3 -2
  11. app/code/community/PPLS/Discussions/controllers/AjaxController.php +18 -0
  12. app/code/community/PPLS/Discussions/controllers/AjaxController.php~ +54 -0
  13. app/design/frontend/base/default/layout/discussions.xml +6 -0
  14. app/design/frontend/base/default/template/discussions/discoverajax.phtml +3 -0
  15. app/design/frontend/base/default/template/discussions/discoverajax.phtml~ +3 -0
  16. app/design/frontend/base/default/template/discussions/discussions.phtml +8 -12
  17. app/design/frontend/base/default/template/discussions/discussions.phtml~ +8 -12
  18. app/design/frontend/base/default/template/discussions/pviewajax.phtml +3 -0
  19. app/design/frontend/base/default/template/discussions/pviewajax.phtml~ +3 -0
  20. app/design/frontend/base/default/template/discussions/virality.phtml~ +1 -1
  21. app/design/frontend/default/default/template/discussions/discussions.phtml +8 -12
  22. app/design/frontend/default/default/template/discussions/discussions.phtml~ +7 -11
  23. app/design/frontend/rwd/default/template/discussions/discussions.phtml +10 -13
  24. app/design/frontend/rwd/default/template/discussions/discussions.phtml~ +9 -12
  25. package.xml +5 -5
app/code/community/PPLS/Discussions/Block/Discussions.php CHANGED
@@ -71,15 +71,12 @@ class PPLS_Discussions_Block_Discussions extends Mage_Core_Block_Template
71
 
72
  }
73
 
74
- public function getProductId()
75
  {
76
  $model = Mage::getSingleton('discussions/discussions');
77
-
78
  $myProductId =$model->getProductId();
79
-
80
  if($myProductId==null && $this->getParentBlock()->getProduct()!=null)
81
  {
82
-
83
  $myProductId=$this->getParentBlock()->getProduct()->getId();
84
  }
85
 
@@ -116,6 +113,14 @@ class PPLS_Discussions_Block_Discussions extends Mage_Core_Block_Template
116
 
117
  }
118
 
 
 
 
 
 
 
 
 
119
 
120
  }
121
 
71
 
72
  }
73
 
74
+ public function getProductId()
75
  {
76
  $model = Mage::getSingleton('discussions/discussions');
 
77
  $myProductId =$model->getProductId();
 
78
  if($myProductId==null && $this->getParentBlock()->getProduct()!=null)
79
  {
 
80
  $myProductId=$this->getParentBlock()->getProduct()->getId();
81
  }
82
 
113
 
114
  }
115
 
116
+ public function sendToDiscovery()
117
+ {
118
+ $model = Mage::getSingleton('discussions/discussions');
119
+ $myProductId = $model->getProductId();
120
+ $locale = $model->getLocale();
121
+ return $model->sendToDiscovery($myProductId,$locale);
122
+ }
123
+
124
 
125
  }
126
 
app/code/community/PPLS/Discussions/Block/Discussions.php~ CHANGED
@@ -71,15 +71,12 @@ class PPLS_Discussions_Block_Discussions extends Mage_Core_Block_Template
71
 
72
  }
73
 
74
- public function getProductId()
75
  {
76
  $model = Mage::getSingleton('discussions/discussions');
77
-
78
  $myProductId =$model->getProductId();
79
-
80
  if($myProductId==null && $this->getParentBlock()->getProduct()!=null)
81
  {
82
-
83
  $myProductId=$this->getParentBlock()->getProduct()->getId();
84
  }
85
 
@@ -108,6 +105,21 @@ class PPLS_Discussions_Block_Discussions extends Mage_Core_Block_Template
108
 
109
  }
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
 
112
 
113
  }
71
 
72
  }
73
 
74
+ public function getProductId()
75
  {
76
  $model = Mage::getSingleton('discussions/discussions');
 
77
  $myProductId =$model->getProductId();
 
78
  if($myProductId==null && $this->getParentBlock()->getProduct()!=null)
79
  {
 
80
  $myProductId=$this->getParentBlock()->getProduct()->getId();
81
  }
82
 
105
 
106
  }
107
 
108
+ public function getPPLSayCdnURL()
109
+ {
110
+ $model = Mage::getSingleton('discussions/discussions');
111
+
112
+ return $model->getPPLSayCDNBaseURL();
113
+
114
+ }
115
+
116
+ public function sendToDiscovery()
117
+ {
118
+ $model = Mage::getSingleton('discussions/discussions');
119
+ $myProductId = $this->getProductId();
120
+ $locale = $this->getLocale();
121
+ return $model->sendToDiscovery($myProductId,$locale);
122
+ }
123
 
124
 
125
  }
app/code/community/PPLS/Discussions/Block/Virality.php CHANGED
@@ -15,36 +15,23 @@ class PPLS_Discussions_Block_Virality extends Mage_Core_Block_Template
15
 
16
 
17
  public function getLink()
18
- {
 
19
  return "$this->virality_base_url{$this->power}.png";
20
  }
21
 
22
  public function initVirality($product)
23
  {
24
  $productID = $product->getId();
25
- $model = Mage::getModel('discussions/virality');
26
- $this->virality_base_url = Mage::getModel('core/variable')->loadByCode('ppls_cdn_url')->getData('store_plain_value')."/images/virality_";
27
  $thisProductDiscussionCount=null;
28
  $discussionCounts = Mage::getSingleton('core/session')->getDisccussionCounts();
29
- if($discussionCounts==null)
30
- {
31
- $thisProductDiscussionCount= $model->initVirality($product);
32
- }
33
- else
34
  {
35
  $countsContent = $discussionCounts["content"];
36
  $thisProductDiscussionCount = $countsContent[$productID];
37
 
38
- }
39
-
40
- if($thisProductDiscussionCount["status"]=="NOT_FOUND_ITEM" && $discussionCounts==null)
41
- {
42
- $this->sendToDiscovery($product,$model);
43
- return;
44
-
45
- }
46
- else
47
- {
48
  if($thisProductDiscussionCount["status"]=="SUCCESS")
49
  {
50
  $content = $thisProductDiscussionCount["content"];
@@ -52,31 +39,6 @@ class PPLS_Discussions_Block_Virality extends Mage_Core_Block_Template
52
  $this->power=$content["power"];
53
  }
54
  }
55
- }
56
-
57
- private function sendToDiscovery($product,$model)
58
- {
59
-
60
- $productID = $product->getId();
61
-
62
- //check if the item was already sent for discovery.
63
- //After sending to discovery we will store it on cookie
64
- if(Mage::getModel('core/cookie')->get($productID)==null)
65
- {
66
- $productBrand = $product->getAttributeText('manufacturer');
67
- $productCategory = "";
68
- $productName = $product->getName();
69
-
70
- $categoryIds = $product->getCategoryIds();
71
- if(count($categoryIds) ){
72
- $firstCategoryId = $categoryIds[0];
73
- $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
74
- $productCategory=$_category->getName();
75
- }
76
- $model->discoverItem($productID,$productName,$productBrand,$productCategory);
77
- // $this->debug = $model->discoverItem($productID,$productName,$productBrand,$productCategory);
78
- Mage::getModel('core/cookie')->set($productID,1);
79
- }
80
 
81
  }
82
 
15
 
16
 
17
  public function getLink()
18
+ {
19
+
20
  return "$this->virality_base_url{$this->power}.png";
21
  }
22
 
23
  public function initVirality($product)
24
  {
25
  $productID = $product->getId();
26
+ $discussionsModel = Mage::getSingleton('discussions/discussions');
27
+ $this->virality_base_url = $discussionsModel->getPPLSayCDNBaseURL()."/images/virality_";
28
  $thisProductDiscussionCount=null;
29
  $discussionCounts = Mage::getSingleton('core/session')->getDisccussionCounts();
30
+ if($discussionCounts!=null)
 
 
 
 
31
  {
32
  $countsContent = $discussionCounts["content"];
33
  $thisProductDiscussionCount = $countsContent[$productID];
34
 
 
 
 
 
 
 
 
 
 
 
35
  if($thisProductDiscussionCount["status"]=="SUCCESS")
36
  {
37
  $content = $thisProductDiscussionCount["content"];
39
  $this->power=$content["power"];
40
  }
41
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  }
44
 
app/code/community/PPLS/Discussions/Block/Virality.php~ CHANGED
@@ -15,36 +15,23 @@ class PPLS_Discussions_Block_Virality extends Mage_Core_Block_Template
15
 
16
 
17
  public function getLink()
18
- {
 
19
  return "$this->virality_base_url{$this->power}.png";
20
  }
21
 
22
  public function initVirality($product)
23
  {
24
  $productID = $product->getId();
25
- $model = Mage::getModel('discussions/virality');
26
- $this->virality_base_url = Mage::getModel('core/variable')->loadByCode('ppls_cdn_url')->getData('store_plain_value')."/images/virality_";
27
  $thisProductDiscussionCount=null;
28
  $discussionCounts = Mage::getSingleton('core/session')->getDisccussionCounts();
29
- if($discussionCounts==null)
30
- {
31
- $thisProductDiscussionCount= $model->initVirality($product);
32
- }
33
- else
34
  {
35
  $countsContent = $discussionCounts["content"];
36
  $thisProductDiscussionCount = $countsContent[$productID];
37
 
38
- }
39
-
40
- if($thisProductDiscussionCount["status"]=="NOT_FOUND_ITEM" && $discussionCounts==null)
41
- {
42
- $this->sendToDiscovery($product,$model);
43
- return;
44
-
45
- }
46
- else
47
- {
48
  if($thisProductDiscussionCount["status"]=="SUCCESS")
49
  {
50
  $content = $thisProductDiscussionCount["content"];
@@ -52,38 +39,12 @@ class PPLS_Discussions_Block_Virality extends Mage_Core_Block_Template
52
  $this->power=$content["power"];
53
  }
54
  }
55
- }
56
-
57
- private function sendToDiscovery($product,$model)
58
- {
59
-
60
- $productID = $product->getId();
61
-
62
- //check if the item was already sent for discovery.
63
- //After sending to discovery we will store it on cookie
64
- if(Mage::getModel('core/cookie')->get($productID)==null)
65
- {
66
- $productBrand = $product->getAttributeText('manufacturer');
67
- $productCategory = "";
68
- $productName = $product->getName();
69
-
70
- $categoryIds = $product->getCategoryIds();
71
- if(count($categoryIds) ){
72
- $firstCategoryId = $categoryIds[0];
73
- $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
74
- $productCategory=$_category->getName();
75
- }
76
- $model->discoverItem($productID,$productName,$productBrand,$productCategory);
77
- // $this->debug = $model->discoverItem($productID,$productName,$productBrand,$productCategory);
78
- Mage::getModel('core/cookie')->set($productID,1);
79
- }
80
 
81
  }
82
 
83
  public function getProductUrl($productId)
84
  {
85
  $_product = Mage::getModel('catalog/product')->load($productId);
86
- //$_categories = $_product->getCategoryIds();
87
  return $_product->getProductUrl();
88
  }
89
  }
15
 
16
 
17
  public function getLink()
18
+ {
19
+
20
  return "$this->virality_base_url{$this->power}.png";
21
  }
22
 
23
  public function initVirality($product)
24
  {
25
  $productID = $product->getId();
26
+ $discussionsModel = Mage::getSingleton('discussions/discussions');
27
+ $this->virality_base_url = $discussionsModel->getPPLSayCDNBaseURL()."/images/virality_";
28
  $thisProductDiscussionCount=null;
29
  $discussionCounts = Mage::getSingleton('core/session')->getDisccussionCounts();
30
+ if($discussionCounts!=null)
 
 
 
 
31
  {
32
  $countsContent = $discussionCounts["content"];
33
  $thisProductDiscussionCount = $countsContent[$productID];
34
 
 
 
 
 
 
 
 
 
 
 
35
  if($thisProductDiscussionCount["status"]=="SUCCESS")
36
  {
37
  $content = $thisProductDiscussionCount["content"];
39
  $this->power=$content["power"];
40
  }
41
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  }
44
 
45
  public function getProductUrl($productId)
46
  {
47
  $_product = Mage::getModel('catalog/product')->load($productId);
 
48
  return $_product->getProductUrl();
49
  }
50
  }
app/code/community/PPLS/Discussions/Model/Discussions.php CHANGED
@@ -24,7 +24,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
24
 
25
  $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/'.$callName;
26
 
27
- $searchParams = "{\"account_id\":\"".$account_id."\" ,\"locale\":\"".$local."\",".substr($searchParams, 1);
28
 
29
 
30
 
@@ -33,6 +33,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
33
  curl_setopt($ch, CURLOPT_POSTFIELDS,$searchParams);
34
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
35
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($searchParams)));
 
36
 
37
  $result = curl_exec($ch);
38
  curl_close($ch);
@@ -55,6 +56,11 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
55
  //Note session in this case (php limit) is request limited => each request will refresh counts even if it's pagenation
56
  public function generateDiscussionCounts($collection)
57
  {
 
 
 
 
 
58
  $counts = array();
59
  $productNames = array();
60
  foreach ($collection->getItems() as $_itemId => $_item) {
@@ -64,7 +70,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
64
  $productNamesStr = json_encode($productNames);
65
  $account_id=$this->getPPLSayAccount();
66
 
67
- $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/multi-count-by-id/'.$account_id;
68
 
69
 
70
 
@@ -73,6 +79,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
73
  curl_setopt($ch, CURLOPT_POSTFIELDS,$productNamesStr);
74
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
75
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($productNamesStr)));
 
76
 
77
  $result = curl_exec($ch);
78
  $jsonResult = json_decode($result,true);
@@ -102,6 +109,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
102
  curl_setopt($ch, CURLOPT_POSTFIELDS,$discussionParams);
103
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
104
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($discussionParams)));
 
105
 
106
  $result = curl_exec($ch);
107
  curl_close($ch);
@@ -139,6 +147,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
139
  curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
140
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
141
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' .$postlength));
 
142
  $response = curl_exec($ch);
143
 
144
  //close connection
@@ -195,4 +204,51 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
195
  return $accountID;
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  }
24
 
25
  $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/'.$callName;
26
 
27
+ $searchParams = "{\"account_id\":\"".$account_id."\",".substr($searchParams, 1);
28
 
29
 
30
 
33
  curl_setopt($ch, CURLOPT_POSTFIELDS,$searchParams);
34
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
35
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($searchParams)));
36
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
37
 
38
  $result = curl_exec($ch);
39
  curl_close($ch);
56
  //Note session in this case (php limit) is request limited => each request will refresh counts even if it's pagenation
57
  public function generateDiscussionCounts($collection)
58
  {
59
+ $virality_flag = Mage::getModel('core/variable')->loadByCode('ppls_virality_flag')->getData('store_plain_value');
60
+ if($virality_flag!="off" && $virality_flag!="on")
61
+ {
62
+ $virality_flag="default";
63
+ }
64
  $counts = array();
65
  $productNames = array();
66
  foreach ($collection->getItems() as $_itemId => $_item) {
70
  $productNamesStr = json_encode($productNames);
71
  $account_id=$this->getPPLSayAccount();
72
 
73
+ $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/multi-count-by-id/'.$account_id."?showvirality=".$virality_flag;
74
 
75
 
76
 
79
  curl_setopt($ch, CURLOPT_POSTFIELDS,$productNamesStr);
80
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
81
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($productNamesStr)));
82
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
83
 
84
  $result = curl_exec($ch);
85
  $jsonResult = json_decode($result,true);
109
  curl_setopt($ch, CURLOPT_POSTFIELDS,$discussionParams);
110
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
111
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($discussionParams)));
112
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
113
 
114
  $result = curl_exec($ch);
115
  curl_close($ch);
147
  curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
148
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
149
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' .$postlength));
150
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
151
  $response = curl_exec($ch);
152
 
153
  //close connection
204
  return $accountID;
205
  }
206
 
207
+
208
+
209
+
210
+
211
+ public function sendToDiscovery($productId,$locale)
212
+ {
213
+
214
+
215
+ try{
216
+ $product = Mage::getModel('catalog/product')->load($productId);
217
+ $productBrand = $product->getAttributeText('manufacturer');
218
+ $productCategory = "";
219
+ $productName = $product->getName();
220
+
221
+ $categoryIds = $product->getCategoryIds();
222
+ if(count($categoryIds) ){
223
+ $firstCategoryId = $categoryIds[0];
224
+ $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
225
+ $productCategory=$_category->getName();
226
+ }
227
+
228
+ $accountID= $this->getPPLSayAccount();
229
+ $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/discoverItems/'.$accountID;
230
+
231
+ $itemParams = "[{\"accountItemID\":\"$productId\",\"accountItemName\":\"$productName\",\"accountBrand\":\"$productBrand\",\"accountCategory\":\"$productCategory\",\"locale\":\"$locale\"}]";
232
+
233
+ $ch = curl_init($client_url);
234
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
235
+ curl_setopt($ch, CURLOPT_POSTFIELDS,$itemParams);
236
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
237
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
238
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($itemParams)));
239
+
240
+ $result = curl_exec($ch);
241
+ curl_close($ch);
242
+ return $result;
243
+
244
+ } catch (Exception $e) {
245
+ return "Sdfsdfdsfsdfsdf";
246
+ }
247
+
248
+
249
+ return null;
250
+
251
+ }
252
+
253
+
254
  }
app/code/community/PPLS/Discussions/Model/Discussions.php~ CHANGED
@@ -24,7 +24,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
24
 
25
  $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/'.$callName;
26
 
27
- $searchParams = "{\"account_id\":\"".$account_id."\" ,\"locale\":\"".$local."\",".substr($searchParams, 1);
28
 
29
 
30
 
@@ -33,6 +33,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
33
  curl_setopt($ch, CURLOPT_POSTFIELDS,$searchParams);
34
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
35
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($searchParams)));
 
36
 
37
  $result = curl_exec($ch);
38
  curl_close($ch);
@@ -55,6 +56,11 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
55
  //Note session in this case (php limit) is request limited => each request will refresh counts even if it's pagenation
56
  public function generateDiscussionCounts($collection)
57
  {
 
 
 
 
 
58
  $counts = array();
59
  $productNames = array();
60
  foreach ($collection->getItems() as $_itemId => $_item) {
@@ -64,7 +70,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
64
  $productNamesStr = json_encode($productNames);
65
  $account_id=$this->getPPLSayAccount();
66
 
67
- $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/multi_count_by_id/'.$account_id;
68
 
69
 
70
 
@@ -73,6 +79,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
73
  curl_setopt($ch, CURLOPT_POSTFIELDS,$productNamesStr);
74
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
75
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($productNamesStr)));
 
76
 
77
  $result = curl_exec($ch);
78
  $jsonResult = json_decode($result,true);
@@ -102,6 +109,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
102
  curl_setopt($ch, CURLOPT_POSTFIELDS,$discussionParams);
103
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
104
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($discussionParams)));
 
105
 
106
  $result = curl_exec($ch);
107
  curl_close($ch);
@@ -139,6 +147,7 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
139
  curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
140
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
141
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' .$postlength));
 
142
  $response = curl_exec($ch);
143
 
144
  //close connection
@@ -195,4 +204,51 @@ class PPLS_Discussions_Model_Discussions extends Mage_Core_Model_Abstract
195
  return $accountID;
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  }
24
 
25
  $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/'.$callName;
26
 
27
+ $searchParams = "{\"account_id\":\"".$account_id."\",".substr($searchParams, 1);
28
 
29
 
30
 
33
  curl_setopt($ch, CURLOPT_POSTFIELDS,$searchParams);
34
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
35
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($searchParams)));
36
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
37
 
38
  $result = curl_exec($ch);
39
  curl_close($ch);
56
  //Note session in this case (php limit) is request limited => each request will refresh counts even if it's pagenation
57
  public function generateDiscussionCounts($collection)
58
  {
59
+ $virality_flag = Mage::getModel('core/variable')->loadByCode('ppls_virality_flag')->getData('store_plain_value');
60
+ if($virality_flag!="off" && $virality_flag!="on")
61
+ {
62
+ $virality_flag="on";
63
+ }
64
  $counts = array();
65
  $productNames = array();
66
  foreach ($collection->getItems() as $_itemId => $_item) {
70
  $productNamesStr = json_encode($productNames);
71
  $account_id=$this->getPPLSayAccount();
72
 
73
+ $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/multi-count-by-id/'.$account_id."?showvirality=".$virality_flag;
74
 
75
 
76
 
79
  curl_setopt($ch, CURLOPT_POSTFIELDS,$productNamesStr);
80
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
81
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($productNamesStr)));
82
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
83
 
84
  $result = curl_exec($ch);
85
  $jsonResult = json_decode($result,true);
109
  curl_setopt($ch, CURLOPT_POSTFIELDS,$discussionParams);
110
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
111
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($discussionParams)));
112
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
113
 
114
  $result = curl_exec($ch);
115
  curl_close($ch);
147
  curl_setopt($ch,CURLOPT_POSTFIELDS,$postData);
148
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
149
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' .$postlength));
150
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
151
  $response = curl_exec($ch);
152
 
153
  //close connection
204
  return $accountID;
205
  }
206
 
207
+
208
+
209
+
210
+
211
+ public function sendToDiscovery($productId,$locale)
212
+ {
213
+
214
+
215
+ try{
216
+ $product = Mage::getModel('catalog/product')->load($productId);
217
+ $productBrand = $product->getAttributeText('manufacturer');
218
+ $productCategory = "";
219
+ $productName = $product->getName();
220
+
221
+ $categoryIds = $product->getCategoryIds();
222
+ if(count($categoryIds) ){
223
+ $firstCategoryId = $categoryIds[0];
224
+ $_category = Mage::getModel('catalog/category')->load($firstCategoryId);
225
+ $productCategory=$_category->getName();
226
+ }
227
+
228
+ $accountID= $this->getPPLSayAccount();
229
+ $client_url = $this->getPPLSayBaseURL().'/rest/conversations/ver1/discoverItems/'.$accountID;
230
+
231
+ $itemParams = "[{\"accountItemID\":\"$productId\",\"accountItemName\":\"$productName\",\"accountBrand\":\"$productBrand\",\"accountCategory\":\"$productCategory\",\"locale\":\"$locale\"}]";
232
+
233
+ $ch = curl_init($client_url);
234
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
235
+ curl_setopt($ch, CURLOPT_POSTFIELDS,$itemParams);
236
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
237
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
238
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($itemParams)));
239
+
240
+ $result = curl_exec($ch);
241
+ curl_close($ch);
242
+ return $result;
243
+
244
+ } catch (Exception $e) {
245
+ return "Sdfsdfdsfsdfsdf";
246
+ }
247
+
248
+
249
+ return null;
250
+
251
+ }
252
+
253
+
254
  }
app/code/community/PPLS/Discussions/Model/Observer.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  class PPLS_Discussions_Model_Observer
4
  {
 
 
5
  /*This observer listening to event of loading product price block , could be on catalog/product page
6
  The flow: product_price load event=> insertBlock observer => virality.phtml => initVirality of virality block=> get virality counts from session stored by getDiscussionCounts (see below function)
7
  */
@@ -18,7 +20,7 @@ The flow: product_price load event=> insertBlock observer => virality.phtml =>
18
  $_type = $_block->getType();
19
  $_template = $_block->getTemplate();
20
  /*Check block type*/
21
- if ($_type == 'catalog/product_price' && $_template!='catalog/product/view/tierprices.phtml') {
22
  $virality_block=$_block->getLayout()->createBlock('discussions/virality');
23
  $virality_block->setTemplate('discussions/virality.phtml');
24
  /*Clone block instance*/
@@ -70,6 +72,17 @@ Note:session in this case (php limit) is stateless and request limited => each r
70
  {
71
  return;
72
  }
 
 
 
 
 
 
 
 
 
 
 
73
  $productCollection = $observer->getEvent()->getCollection();
74
  if ($productCollection instanceof Varien_Data_Collection) {
75
  $productCollection->load();
@@ -80,3 +93,4 @@ Note:session in this case (php limit) is stateless and request limited => each r
80
 
81
  }
82
  }
 
2
 
3
  class PPLS_Discussions_Model_Observer
4
  {
5
+ public $virality_flag="default";
6
+
7
  /*This observer listening to event of loading product price block , could be on catalog/product page
8
  The flow: product_price load event=> insertBlock observer => virality.phtml => initVirality of virality block=> get virality counts from session stored by getDiscussionCounts (see below function)
9
  */
20
  $_type = $_block->getType();
21
  $_template = $_block->getTemplate();
22
  /*Check block type*/
23
+ if ($this->virality_flag!="off" && $_type == 'catalog/product_price' && $_template!='catalog/product/view/tierprices.phtml') {
24
  $virality_block=$_block->getLayout()->createBlock('discussions/virality');
25
  $virality_block->setTemplate('discussions/virality.phtml');
26
  /*Clone block instance*/
72
  {
73
  return;
74
  }
75
+ $this->virality_flag = Mage::getModel('core/variable')->loadByCode('ppls_virality_flag')->getData('store_plain_value');
76
+ if($this->virality_flag!="off" && $this->virality_flag!="on")
77
+ {
78
+ $this->virality_flag="default";
79
+ }
80
+ else if($this->virality_flag=="off")
81
+ {
82
+ return;
83
+ }
84
+
85
+
86
  $productCollection = $observer->getEvent()->getCollection();
87
  if ($productCollection instanceof Varien_Data_Collection) {
88
  $productCollection->load();
93
 
94
  }
95
  }
96
+
app/code/community/PPLS/Discussions/Model/Observer.php~ CHANGED
@@ -2,6 +2,7 @@
2
 
3
  class PPLS_Discussions_Model_Observer
4
  {
 
5
  /*This observer listening to event of loading product price block , could be on catalog/product page
6
  The flow: product_price load event=> insertBlock observer => virality.phtml => initVirality of virality block=> get virality counts from session stored by getDiscussionCounts (see below function)
7
  */
@@ -40,7 +41,7 @@ The flow: product_price load event=> insertBlock observer => virality.phtml =>
40
  $model->setProductId($product->getId());
41
 
42
  $discussions_block=$_block->getLayout()->createBlock('discussions/discussions');
43
- $discussions_block->setTemplate('discussions/prod_discussions.phtml');
44
  /*Clone block instance*/
45
  $_child = clone $_block;
46
  /*set another type for block*/
@@ -48,7 +49,7 @@ The flow: product_price load event=> insertBlock observer => virality.phtml =>
48
  /*set child for block*/
49
  $_block->setChild('child', $_child);
50
  /*set our template*/
51
- $_block->setTemplate('discussions/prod_discussions.phtml');
52
  $_block->setChild('discussions',$discussions_block);
53
 
54
  }
@@ -70,6 +71,8 @@ Note:session in this case (php limit) is stateless and request limited => each r
70
  {
71
  return;
72
  }
 
 
73
  $productCollection = $observer->getEvent()->getCollection();
74
  if ($productCollection instanceof Varien_Data_Collection) {
75
  $productCollection->load();
@@ -80,3 +83,4 @@ Note:session in this case (php limit) is stateless and request limited => each r
80
 
81
  }
82
  }
 
2
 
3
  class PPLS_Discussions_Model_Observer
4
  {
5
+
6
  /*This observer listening to event of loading product price block , could be on catalog/product page
7
  The flow: product_price load event=> insertBlock observer => virality.phtml => initVirality of virality block=> get virality counts from session stored by getDiscussionCounts (see below function)
8
  */
41
  $model->setProductId($product->getId());
42
 
43
  $discussions_block=$_block->getLayout()->createBlock('discussions/discussions');
44
+ $discussions_block->setTemplate('discussions/discussions_tab.phtml');
45
  /*Clone block instance*/
46
  $_child = clone $_block;
47
  /*set another type for block*/
49
  /*set child for block*/
50
  $_block->setChild('child', $_child);
51
  /*set our template*/
52
+ $_block->setTemplate('discussions/discussions_tab.phtml');
53
  $_block->setChild('discussions',$discussions_block);
54
 
55
  }
71
  {
72
  return;
73
  }
74
+
75
+
76
  $productCollection = $observer->getEvent()->getCollection();
77
  if ($productCollection instanceof Varien_Data_Collection) {
78
  $productCollection->load();
83
 
84
  }
85
  }
86
+
app/code/community/PPLS/Discussions/Model/Virality.php CHANGED
@@ -7,38 +7,6 @@ class PPLS_Discussions_Model_Virality extends Mage_Core_Model_Abstract
7
  $this->_init('discussions/virality');
8
  }
9
 
10
- public function discoverItem($productID,$productName,$productBrand,$productCategory)
11
- {
12
- try{
13
- $discussionsModel = Mage::getSingleton('discussions/discussions');
14
-
15
- $accountID= $discussionsModel->getPPLSayAccount();
16
- $client_url = $discussionsModel->getPPLSayBaseURL().'/rest/conversations/ver1/discoverItems/'.$accountID;
17
-
18
- $itemParams = "[{\"accountItemID\":\"$productID\",\"accountItemName\":\"$productName\",\"accountBrand\":\"$productBrand\",\"accountCategory\":\"$productCategory\"}]";
19
-
20
-
21
-
22
-
23
-
24
- $ch = curl_init($client_url);
25
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
26
- curl_setopt($ch, CURLOPT_POSTFIELDS,$itemParams);
27
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
28
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($itemParams)));
29
-
30
- $result = curl_exec($ch);
31
- curl_close($ch);
32
- return $result;
33
-
34
- } catch (Exception $e) {
35
- return null;
36
- }
37
-
38
-
39
- return null;
40
- }
41
-
42
 
43
  public function initVirality($product)
44
  {
@@ -50,7 +18,7 @@ class PPLS_Discussions_Model_Virality extends Mage_Core_Model_Abstract
50
 
51
  curl_setopt($ch, CURLOPT_HEADER, 0);
52
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
53
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,10); # timeout after 10 seconds, you can increase it
54
 
55
  $response = curl_exec($ch);
56
  curl_close($ch);
7
  $this->_init('discussions/virality');
8
  }
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
 
11
  public function initVirality($product)
12
  {
18
 
19
  curl_setopt($ch, CURLOPT_HEADER, 0);
20
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
21
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2); # timeout after 10 seconds, you can increase it
22
 
23
  $response = curl_exec($ch);
24
  curl_close($ch);
app/code/community/PPLS/Discussions/Model/Virality.php~ CHANGED
@@ -24,7 +24,8 @@ class PPLS_Discussions_Model_Virality extends Mage_Core_Model_Abstract
24
  $ch = curl_init($client_url);
25
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
26
  curl_setopt($ch, CURLOPT_POSTFIELDS,$itemParams);
27
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 
28
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($itemParams)));
29
 
30
  $result = curl_exec($ch);
@@ -50,7 +51,7 @@ class PPLS_Discussions_Model_Virality extends Mage_Core_Model_Abstract
50
 
51
  curl_setopt($ch, CURLOPT_HEADER, 0);
52
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
53
- curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,10); # timeout after 10 seconds, you can increase it
54
 
55
  $response = curl_exec($ch);
56
  curl_close($ch);
24
  $ch = curl_init($client_url);
25
  curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
26
  curl_setopt($ch, CURLOPT_POSTFIELDS,$itemParams);
27
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
28
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2);
29
  curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($itemParams)));
30
 
31
  $result = curl_exec($ch);
51
 
52
  curl_setopt($ch, CURLOPT_HEADER, 0);
53
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //Set curl to return the data instead of printing it to the browser.
54
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT,2); # timeout after 10 seconds, you can increase it
55
 
56
  $response = curl_exec($ch);
57
  curl_close($ch);
app/code/community/PPLS/Discussions/controllers/AjaxController.php CHANGED
@@ -20,7 +20,25 @@ class PPLS_Discussions_AjaxController extends Mage_Core_Controller_Front_Action
20
  $this->renderLayout();
21
  }
22
 
 
 
 
 
 
 
 
 
23
 
 
 
 
 
 
 
 
 
 
 
24
 
25
  public function feedbackAction()
26
  {
20
  $this->renderLayout();
21
  }
22
 
23
+ public function pviewAction()
24
+ {
25
+ $this->loadLayout();
26
+ $model = Mage::getSingleton('discussions/discussions');
27
+ $data = $this->getRequest()->getPost("searchParams");
28
+ $model->setSearchParams($data);
29
+ $this->renderLayout();
30
+ }
31
 
32
+ public function discoverAction()
33
+ {
34
+ $this->loadLayout();
35
+ $model = Mage::getSingleton('discussions/discussions');
36
+ $productId = $this->getRequest()->getParam("productId");
37
+ $locale = $this->getRequest()->getParam("locale");
38
+ $model->setProductId($productId);
39
+ $model->setLocale($locale);
40
+ $this->renderLayout();
41
+ }
42
 
43
  public function feedbackAction()
44
  {
app/code/community/PPLS/Discussions/controllers/AjaxController.php~ ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class PPLS_Discussions_AjaxController extends Mage_Core_Controller_Front_Action
3
+ {
4
+
5
+ public function indexAction()
6
+ {
7
+ $this->loadLayout();
8
+ $model = Mage::getSingleton('discussions/discussions');
9
+ $data = $this->getRequest()->getPost("searchParams");
10
+ $model->setSearchParams($data);
11
+ $this->renderLayout();
12
+ }
13
+
14
+ public function getDiscussionAction()
15
+ {
16
+ $this->loadLayout();
17
+ $model = Mage::getSingleton('discussions/discussions');
18
+ $data = $this->getRequest()->getPost("discussionParams");
19
+ $model->setDiscussionParams($data);
20
+ $this->renderLayout();
21
+ }
22
+
23
+ public function pviewAction()
24
+ {
25
+ $this->loadLayout();
26
+ $model = Mage::getSingleton('discussions/discussions');
27
+ $data = $this->getRequest()->getPost("searchParams");
28
+ $model->setSearchParams($data);
29
+ $this->renderLayout();
30
+ }
31
+
32
+ public function discoverAction()
33
+ {
34
+ $this->loadLayout();
35
+ $model = Mage::getSingleton('discussions/discussions');
36
+ $productId = $this->getRequest()->getParam("productId");
37
+ $locale = $this->getRequest()->getParam("locale");
38
+ $model->setProductId($locale);
39
+ $this->renderLayout();
40
+ }
41
+
42
+ public function feedbackAction()
43
+ {
44
+ $this->loadLayout();
45
+ $model = Mage::getSingleton('discussions/discussions');
46
+
47
+ $data = $this->getRequest()->getPost("feedbackParams");
48
+ $model->setFeedbackParams($data);
49
+ $this->renderLayout();
50
+ }
51
+
52
+ }
53
+
54
+
app/design/frontend/base/default/layout/discussions.xml CHANGED
@@ -12,6 +12,12 @@
12
  <discussions_ajax_feedback>
13
  <block type="discussions/discussions" name="root" output="toHtml" template="discussions/feedbackajax.phtml" />
14
  </discussions_ajax_feedback>
 
 
 
 
 
 
15
 
16
  <catalog_product_view>
17
  <reference name="product.info">
12
  <discussions_ajax_feedback>
13
  <block type="discussions/discussions" name="root" output="toHtml" template="discussions/feedbackajax.phtml" />
14
  </discussions_ajax_feedback>
15
+ <discussions_ajax_pview>
16
+ <block type="discussions/discussions" name="root" output="toHtml" template="discussions/pviewajax.phtml" />
17
+ </discussions_ajax_pview>
18
+ <discussions_ajax_discover>
19
+ <block type="discussions/discussions" name="root" output="toHtml" template="discussions/discoverajax.phtml" />
20
+ </discussions_ajax_discover>
21
 
22
  <catalog_product_view>
23
  <reference name="product.info">
app/design/frontend/base/default/template/discussions/discoverajax.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div id='DiscussionsAjaxResult'>
2
+ <?php echo $this->sendToDiscovery(); ?>
3
+ </div>
app/design/frontend/base/default/template/discussions/discoverajax.phtml~ ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div id='DiscussionsAjaxResult'>
2
+ <?php echo $this->sendToDiscovery(); ?>
3
+ </div>
app/design/frontend/base/default/template/discussions/discussions.phtml CHANGED
@@ -1,7 +1,7 @@
1
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
2
  <script type="text/javascript">
3
  //uploading ppls js and css
4
- var ppls_cdn_url = "<?php echo Mage::getModel('core/variable')->loadByCode('ppls_cdn_url')->getData('store_plain_value') ?>";
5
  var productName = "<?php echo $this->getProductName();?>";
6
  var productID = "<?php echo $this->getProductId();?>";
7
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
@@ -9,6 +9,8 @@
9
  var headElem = document.getElementsByTagName("head")[0];
10
  var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
11
  var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
 
 
12
  pplsCSS.setAttribute("rel", "stylesheet");
13
  pplsCSS.setAttribute("type", "text/css");
14
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
@@ -18,21 +20,15 @@
18
  bsCSS.setAttribute("type", "text/css");
19
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
20
  headElem.insertBefore(bsCSS,headElem.firstChild);
21
- jQuery(document).ready(function() {
22
- conversationsObj = <?php echo $this->productView(); ?>;
23
- var pplsJS=document.createElement('script');
24
- pplsJS.setAttribute("type","text/javascript");
25
- pplsJS.setAttribute("src", ppls_cdn_url+ "/js/default/conversationsRenderer.js");
26
- document.getElementsByTagName("head")[0].appendChild(pplsJS);
27
-
28
- });
29
-
30
-
31
  </script>
32
  </div>
33
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
34
  <a href="http://pplsay.com" onclick = "window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
35
- <span class="pplsay-label" style="font-weight:bold;font-size:13px">Powered by:</span>
36
  <img style="" src="<?php echo $this->getPPLSayCdnURL();?>/images/logoLink.png" style="border:0;" alt="PPLSAY - Connecting to Crowd Voice">
37
  </a>
38
  </div>
1
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
2
  <script type="text/javascript">
3
  //uploading ppls js and css
4
+ var ppls_cdn_url = "<?php echo $this->getPPLSayCdnURL(); ?>";
5
  var productName = "<?php echo $this->getProductName();?>";
6
  var productID = "<?php echo $this->getProductId();?>";
7
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
9
  var headElem = document.getElementsByTagName("head")[0];
10
  var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
11
  var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
12
+ var lang = "<?php echo Mage::app()->getLocale()->getLocaleCode();?>";
13
+ var pplsVer = "<?php echo Mage::getConfig()->getNode()->modules->PPLS_Discussions->version;?>";
14
  pplsCSS.setAttribute("rel", "stylesheet");
15
  pplsCSS.setAttribute("type", "text/css");
16
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
20
  bsCSS.setAttribute("type", "text/css");
21
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
22
  headElem.insertBefore(bsCSS,headElem.firstChild);
23
+ var pplsJS=document.createElement('script');
24
+ pplsJS.setAttribute("type","text/javascript");
25
+ pplsJS.setAttribute("src", ppls_cdn_url+ "/js/default/conversationsRenderer.js");
26
+ document.getElementsByTagName("head")[0].appendChild(pplsJS);
 
 
 
 
 
 
27
  </script>
28
  </div>
29
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
30
  <a href="http://pplsay.com" onclick = "window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
31
+ <span class="pplsay-label" style="font-weight:bold;font-size:13px;float:left">Powered by:</span>
32
  <img style="" src="<?php echo $this->getPPLSayCdnURL();?>/images/logoLink.png" style="border:0;" alt="PPLSAY - Connecting to Crowd Voice">
33
  </a>
34
  </div>
app/design/frontend/base/default/template/discussions/discussions.phtml~ CHANGED
@@ -1,7 +1,7 @@
1
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
2
  <script type="text/javascript">
3
  //uploading ppls js and css
4
- var ppls_cdn_url = "<?php echo Mage::getModel('core/variable')->loadByCode('ppls_cdn_url')->getData('store_plain_value') ?>";
5
  var productName = "<?php echo $this->getProductName();?>";
6
  var productID = "<?php echo $this->getProductId();?>";
7
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
@@ -9,6 +9,8 @@
9
  var headElem = document.getElementsByTagName("head")[0];
10
  var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
11
  var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
 
 
12
  pplsCSS.setAttribute("rel", "stylesheet");
13
  pplsCSS.setAttribute("type", "text/css");
14
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
@@ -18,22 +20,16 @@
18
  bsCSS.setAttribute("type", "text/css");
19
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
20
  headElem.insertBefore(bsCSS,headElem.firstChild);
21
- jQuery(document).ready(function() {
22
- conversationsObj = <?php echo $this->productView(); ?>;
23
- var pplsJS=document.createElement('script');
24
- pplsJS.setAttribute("type","text/javascript");
25
- pplsJS.setAttribute("src", ppls_cdn_url+ "/js/default/conversationsRenderer.js");
26
- document.getElementsByTagName("head")[0].appendChild(pplsJS);
27
-
28
- });
29
-
30
-
31
  </script>
32
  </div>
33
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
34
  <a href="http://pplsay.com" onclick = "window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
35
  <span class="pplsay-label" style="font-weight:bold;font-size:13px">Powered by:</span>
36
- <img style="" src="<?php echo $this->getPPLSayCdnURL();?>/images/logoBigger.png" style="border:0;" alt="PPLSAY - Connecting to Crowd Voice">
37
  </a>
38
  </div>
39
  </div>
1
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
2
  <script type="text/javascript">
3
  //uploading ppls js and css
4
+ var ppls_cdn_url = "<?php echo $this->getPPLSayCdnURL(); ?>";
5
  var productName = "<?php echo $this->getProductName();?>";
6
  var productID = "<?php echo $this->getProductId();?>";
7
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
9
  var headElem = document.getElementsByTagName("head")[0];
10
  var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
11
  var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
12
+ var lang = "<?php echo Mage::app()->getLocale()->getLocaleCode();?>";
13
+ var pplsVer = "<?php echo Mage::getConfig()->getNode()->modules->PPLS_Discussions->version;?>";
14
  pplsCSS.setAttribute("rel", "stylesheet");
15
  pplsCSS.setAttribute("type", "text/css");
16
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
20
  bsCSS.setAttribute("type", "text/css");
21
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
22
  headElem.insertBefore(bsCSS,headElem.firstChild);
23
+ var pplsJS=document.createElement('script');
24
+ pplsJS.setAttribute("type","text/javascript");
25
+ pplsJS.setAttribute("src", ppls_cdn_url+ "/js/default/conversationsRenderer.js");
26
+ document.getElementsByTagName("head")[0].appendChild(pplsJS);
 
 
 
 
 
 
27
  </script>
28
  </div>
29
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
30
  <a href="http://pplsay.com" onclick = "window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
31
  <span class="pplsay-label" style="font-weight:bold;font-size:13px">Powered by:</span>
32
+ <img style="" src="<?php echo $this->getPPLSayCdnURL();?>/images/logoLink.png" style="border:0;" alt="PPLSAY - Connecting to Crowd Voice">
33
  </a>
34
  </div>
35
  </div>
app/design/frontend/base/default/template/discussions/pviewajax.phtml ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div id='DiscussionsAjaxResult'>
2
+ <?php echo $this->productView(); ?>
3
+ </div>
app/design/frontend/base/default/template/discussions/pviewajax.phtml~ ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ <div id='PViewAjaxResult'>
2
+ <?php echo $this->productView(); ?>
3
+ </div>
app/design/frontend/base/default/template/discussions/virality.phtml~ CHANGED
@@ -1,6 +1,6 @@
1
  <?php $this->getChild('virality')->initVirality($this->getChild('child')->getProduct())?>
2
  <?php if ($this->getChild('virality')->count!=0): ?>
3
- <div class="ppls_virality" style="height:20px;line-height: normal;" title="Click to see product discussions from socila networks">
4
  <a id="PPLSayDiscussionsLink" href="<?php echo $this->getChild('virality')->getProductUrl($this->getChild('child')->getProduct()->getId())?>#PPLSAYContainer">
5
  <img style="max-width:65px;width:60%;height:14px;float:left" src="<?php echo $this->getChild('virality')->getLink() ?>"><span style="float:left;margin-left:0.5em;width:30%;max-width:50px;line-height: normal;font-size:13px">(<?php echo $this->getChild('virality')->count?>)</span></a>
6
  </div>
1
  <?php $this->getChild('virality')->initVirality($this->getChild('child')->getProduct())?>
2
  <?php if ($this->getChild('virality')->count!=0): ?>
3
+ <div class="ppls_virality" style="height:20px;line-height: normal;" title="Click to see product discussions from social networks">
4
  <a id="PPLSayDiscussionsLink" href="<?php echo $this->getChild('virality')->getProductUrl($this->getChild('child')->getProduct()->getId())?>#PPLSAYContainer">
5
  <img style="max-width:65px;width:60%;height:14px;float:left" src="<?php echo $this->getChild('virality')->getLink() ?>"><span style="float:left;margin-left:0.5em;width:30%;max-width:50px;line-height: normal;font-size:13px">(<?php echo $this->getChild('virality')->count?>)</span></a>
6
  </div>
app/design/frontend/default/default/template/discussions/discussions.phtml CHANGED
@@ -8,7 +8,7 @@
8
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
9
  <script type="text/javascript">
10
  //uploading ppls js and css
11
- var ppls_cdn_url = "<?php echo Mage::getModel('core/variable')->loadByCode('ppls_cdn_url')->getData('store_plain_value') ?>";
12
  var productName = "<?php echo $this->getProductName();?>";
13
  var productID = "<?php echo $this->getProductId();?>";
14
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
@@ -16,6 +16,8 @@
16
  var headElem = document.getElementsByTagName("head")[0];
17
  var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
18
  var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
 
 
19
  pplsCSS.setAttribute("rel", "stylesheet");
20
  pplsCSS.setAttribute("type", "text/css");
21
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
@@ -25,22 +27,16 @@
25
  bsCSS.setAttribute("type", "text/css");
26
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
27
  headElem.insertBefore(bsCSS,headElem.firstChild);
 
 
 
 
28
 
29
- jQuery(document).ready(function() {
30
- conversationsObj = <?php echo $this->productView(); ?>;
31
- var pplsJS=document.createElement('script');
32
- pplsJS.setAttribute("type","text/javascript");
33
- pplsJS.setAttribute("src", ppls_cdn_url+ "/js/default/conversationsRenderer.js");
34
- headElem.appendChild(pplsJS);
35
-
36
- });
37
-
38
-
39
  </script>
40
  </div>
41
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
42
  <a href="http://pplsay.com" onclick = "window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
43
- <span class="pplsay-label" style="font-weight: bold;font-size:13px">Powered by:</span>
44
  <img style="" src="<?php echo $this->getPPLSayCdnURL();?>/images/logoLink.png" style="border:0;" alt="PPLSAY - Connecting to Crowd Voice">
45
  </a>
46
  </div>
8
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
9
  <script type="text/javascript">
10
  //uploading ppls js and css
11
+ var ppls_cdn_url = "<?php echo $this->getPPLSayCdnURL();?>";
12
  var productName = "<?php echo $this->getProductName();?>";
13
  var productID = "<?php echo $this->getProductId();?>";
14
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
16
  var headElem = document.getElementsByTagName("head")[0];
17
  var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
18
  var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
19
+ var lang = "<?php echo Mage::app()->getLocale()->getLocaleCode();?>";
20
+ var pplsVer = "<?php echo Mage::getConfig()->getNode()->modules->PPLS_Discussions->version;?>";
21
  pplsCSS.setAttribute("rel", "stylesheet");
22
  pplsCSS.setAttribute("type", "text/css");
23
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
27
  bsCSS.setAttribute("type", "text/css");
28
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
29
  headElem.insertBefore(bsCSS,headElem.firstChild);
30
+ var pplsJS=document.createElement('script');
31
+ pplsJS.setAttribute("type","text/javascript");
32
+ pplsJS.setAttribute("src", ppls_cdn_url+ "/js/default/conversationsRenderer.js");
33
+ headElem.appendChild(pplsJS);
34
 
 
 
 
 
 
 
 
 
 
 
35
  </script>
36
  </div>
37
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
38
  <a href="http://pplsay.com" onclick = "window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
39
+ <span class="pplsay-label" style="font-weight: bold;font-size:13px;float: left">Powered by:</span>
40
  <img style="" src="<?php echo $this->getPPLSayCdnURL();?>/images/logoLink.png" style="border:0;" alt="PPLSAY - Connecting to Crowd Voice">
41
  </a>
42
  </div>
app/design/frontend/default/default/template/discussions/discussions.phtml~ CHANGED
@@ -8,7 +8,7 @@
8
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
9
  <script type="text/javascript">
10
  //uploading ppls js and css
11
- var ppls_cdn_url = "<?php echo Mage::getModel('core/variable')->loadByCode('ppls_cdn_url')->getData('store_plain_value') ?>";
12
  var productName = "<?php echo $this->getProductName();?>";
13
  var productID = "<?php echo $this->getProductId();?>";
14
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
@@ -16,6 +16,8 @@
16
  var headElem = document.getElementsByTagName("head")[0];
17
  var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
18
  var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
 
 
19
  pplsCSS.setAttribute("rel", "stylesheet");
20
  pplsCSS.setAttribute("type", "text/css");
21
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
@@ -25,17 +27,11 @@
25
  bsCSS.setAttribute("type", "text/css");
26
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
27
  headElem.insertBefore(bsCSS,headElem.firstChild);
 
 
 
 
28
 
29
- jQuery(document).ready(function() {
30
- conversationsObj = <?php echo $this->productView(); ?>;
31
- var pplsJS=document.createElement('script');
32
- pplsJS.setAttribute("type","text/javascript");
33
- pplsJS.setAttribute("src", ppls_cdn_url+ "/js/default/conversationsRenderer.js");
34
- headElem.appendChild(pplsJS);
35
-
36
- });
37
-
38
-
39
  </script>
40
  </div>
41
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
8
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
9
  <script type="text/javascript">
10
  //uploading ppls js and css
11
+ var ppls_cdn_url = "<?php echo $this->getPPLSayCdnURL();?>";
12
  var productName = "<?php echo $this->getProductName();?>";
13
  var productID = "<?php echo $this->getProductId();?>";
14
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
16
  var headElem = document.getElementsByTagName("head")[0];
17
  var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
18
  var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
19
+ var lang = "<?php echo Mage::app()->getLocale()->getLocaleCode();?>";
20
+ var pplsVer = "<?php echo Mage::getConfig()->getNode()->modules->PPLS_Discussions->version;?>";
21
  pplsCSS.setAttribute("rel", "stylesheet");
22
  pplsCSS.setAttribute("type", "text/css");
23
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
27
  bsCSS.setAttribute("type", "text/css");
28
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
29
  headElem.insertBefore(bsCSS,headElem.firstChild);
30
+ var pplsJS=document.createElement('script');
31
+ pplsJS.setAttribute("type","text/javascript");
32
+ pplsJS.setAttribute("src", ppls_cdn_url+ "/js/default/conversationsRenderer.js");
33
+ headElem.appendChild(pplsJS);
34
 
 
 
 
 
 
 
 
 
 
 
35
  </script>
36
  </div>
37
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
app/design/frontend/rwd/default/template/discussions/discussions.phtml CHANGED
@@ -1,12 +1,16 @@
1
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
2
  <script type="text/javascript">
3
  //uploading ppls js and css
4
- var ppls_cdn_url = "<?php echo Mage::getModel('core/variable')->loadByCode('ppls_cdn_url')->getData('store_plain_value') ?>";
5
  var productName = "<?php echo $this->getProductName();?>";
6
  var productID = "<?php echo $this->getProductId();?>";
7
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
8
  var pplsCSS=document.createElement('link');
 
 
9
  var headElem = document.getElementsByTagName("head")[0];
 
 
10
  pplsCSS.setAttribute("rel", "stylesheet");
11
  pplsCSS.setAttribute("type", "text/css");
12
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
@@ -16,22 +20,15 @@
16
  bsCSS.setAttribute("type", "text/css");
17
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
18
  headElem.insertBefore(bsCSS,headElem.firstChild);
19
-
20
- jQuery(document).ready(function() {
21
- conversationsObj = <?php echo $this->productView(); ?>;
22
- var pplsJS=document.createElement('script');
23
- pplsJS.setAttribute("type","text/javascript");
24
- pplsJS.setAttribute("src", ppls_cdn_url+ "/js/rwd/conversationsRenderer.js");
25
- document.getElementsByTagName("head")[0].appendChild(pplsJS);
26
-
27
- });
28
-
29
-
30
  </script>
31
  </div>
32
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
33
  <a href="http://pplsay.com" onclick = "window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
34
- <span class="pplsay-label" style="font-weight: bold;font-size:13px">Powered by:</span>
35
  <img style="" src="<?php echo $this->getPPLSayCdnURL();?>/images/logoLink.png" style="border:0;" alt="PPLSAY - Connecting to Crowd Voice">
36
  </a>
37
  </div>
1
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
2
  <script type="text/javascript">
3
  //uploading ppls js and css
4
+ var ppls_cdn_url = "<?php echo $this->getPPLSayCdnURL();?>";
5
  var productName = "<?php echo $this->getProductName();?>";
6
  var productID = "<?php echo $this->getProductId();?>";
7
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
8
  var pplsCSS=document.createElement('link');
9
+ var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
10
+ var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
11
  var headElem = document.getElementsByTagName("head")[0];
12
+ var lang = "<?php echo Mage::app()->getLocale()->getLocaleCode();?>";
13
+ var pplsVer = "<?php echo Mage::getConfig()->getNode()->modules->PPLS_Discussions->version;?>";
14
  pplsCSS.setAttribute("rel", "stylesheet");
15
  pplsCSS.setAttribute("type", "text/css");
16
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
20
  bsCSS.setAttribute("type", "text/css");
21
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
22
  headElem.insertBefore(bsCSS,headElem.firstChild);
23
+ var pplsJS=document.createElement('script');
24
+ pplsJS.setAttribute("type","text/javascript");
25
+ pplsJS.setAttribute("src", ppls_cdn_url+ "/js/rwd/conversationsRenderer.js");
26
+ document.getElementsByTagName("head")[0].appendChild(pplsJS);
 
 
 
 
 
 
 
27
  </script>
28
  </div>
29
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
30
  <a href="http://pplsay.com" onclick = "window.open(this.href, 'mywin','left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
31
+ <span class="pplsay-label" style="font-weight: bold;font-size:13px;float: left">Powered by:</span>
32
  <img style="" src="<?php echo $this->getPPLSayCdnURL();?>/images/logoLink.png" style="border:0;" alt="PPLSAY - Connecting to Crowd Voice">
33
  </a>
34
  </div>
app/design/frontend/rwd/default/template/discussions/discussions.phtml~ CHANGED
@@ -1,12 +1,16 @@
1
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
2
  <script type="text/javascript">
3
  //uploading ppls js and css
4
- var ppls_cdn_url = "<?php echo Mage::getModel('core/variable')->loadByCode('ppls_cdn_url')->getData('store_plain_value') ?>";
5
  var productName = "<?php echo $this->getProductName();?>";
6
  var productID = "<?php echo $this->getProductId();?>";
7
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
8
  var pplsCSS=document.createElement('link');
 
 
9
  var headElem = document.getElementsByTagName("head")[0];
 
 
10
  pplsCSS.setAttribute("rel", "stylesheet");
11
  pplsCSS.setAttribute("type", "text/css");
12
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
@@ -16,17 +20,10 @@
16
  bsCSS.setAttribute("type", "text/css");
17
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
18
  headElem.insertBefore(bsCSS,headElem.firstChild);
19
-
20
- jQuery(document).ready(function() {
21
- conversationsObj = <?php echo $this->productView(); ?>;
22
- var pplsJS=document.createElement('script');
23
- pplsJS.setAttribute("type","text/javascript");
24
- pplsJS.setAttribute("src", ppls_cdn_url+ "/js/rwd/conversationsRenderer.js");
25
- document.getElementsByTagName("head")[0].appendChild(pplsJS);
26
-
27
- });
28
-
29
-
30
  </script>
31
  </div>
32
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
1
  <div class="container-fluid"><div id="PPLSAYContainer" class="row">
2
  <script type="text/javascript">
3
  //uploading ppls js and css
4
+ var ppls_cdn_url = "<?php echo $this->getPPLSayCdnURL();?>";
5
  var productName = "<?php echo $this->getProductName();?>";
6
  var productID = "<?php echo $this->getProductId();?>";
7
  var baseUrl = "<?php echo Mage::getBaseUrl(); ?>";
8
  var pplsCSS=document.createElement('link');
9
+ var packageName = "<?php echo Mage::getSingleton('core/design_package')->getPackageName();?>";
10
+ var themeName = "<?php echo Mage::getSingleton('core/design_package')->getTheme('frontend');?>";
11
  var headElem = document.getElementsByTagName("head")[0];
12
+ var lang = "<?php echo Mage::app()->getLocale()->getLocaleCode();?>";
13
+ var pplsVer = "<?php echo Mage::getConfig()->getNode()->modules->PPLS_Discussions->version;?>";
14
  pplsCSS.setAttribute("rel", "stylesheet");
15
  pplsCSS.setAttribute("type", "text/css");
16
  pplsCSS.setAttribute("href", ppls_cdn_url + "/css/internalStyle.css");
20
  bsCSS.setAttribute("type", "text/css");
21
  bsCSS.setAttribute("href", ppls_cdn_url + "/css/pplsay_bootstrap.min.css");
22
  headElem.insertBefore(bsCSS,headElem.firstChild);
23
+ var pplsJS=document.createElement('script');
24
+ pplsJS.setAttribute("type","text/javascript");
25
+ pplsJS.setAttribute("src", ppls_cdn_url+ "/js/rwd/conversationsRenderer.js");
26
+ document.getElementsByTagName("head")[0].appendChild(pplsJS);
 
 
 
 
 
 
 
27
  </script>
28
  </div>
29
  <div id="PPLSAYLink" class="row" style="padding-left: 15px;">
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PPLSAY_Social_Discussions</name>
4
- <version>1.1.2</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
@@ -26,11 +26,11 @@ Visit us at: http://pplsay.com&#xD;
26
  For demo site please refer to the following link pplsay demo:&#xD;
27
  http://demo.pplsay.com/&#xD;
28
  </description>
29
- <notes>- Fixed performance issue </notes>
30
  <authors><author><name>PPLSAY Commerce Ltd</name><user>pplsay</user><email>contact@pplsay.com</email></author><author><name>PPLSAY Commerce Ltd</name><user>ymatatov</user><email>ymatatov@pplsay.com</email></author></authors>
31
- <date>2014-08-18</date>
32
- <time>20:34:03</time>
33
- <contents><target name="magecommunity"><dir name="PPLS"><dir name="Discussions"><dir name="Block"><file name="Discussions.php" hash="b27a6cd3150240f9bc00a86668087e80"/><file name="Discussions.php~" hash="fbee3a0227e037a9af6028fadf52c61d"/><file name="Virality.php" hash="45913cedd9e52a60dba35ec86116451b"/><file name="Virality.php~" hash="9d4c15d1ed72359e62f77ea7235dbd86"/></dir><dir name="Model"><file name="Discussions.php" hash="08b561dbd24285cd479e7d8fae95fe96"/><file name="Discussions.php~" hash="259d360b583f658a0d5d96c684bc00a3"/><file name="Observer.php" hash="0090d37d9f59653775ab1c438610b825"/><file name="Observer.php~" hash="5f9d93319b88003a4b97b6052c4bbebf"/><file name="Virality.php" hash="e23eb32efb83f1b238e56d287621afb3"/><file name="Virality.php~" hash="e23eb32efb83f1b238e56d287621afb3"/></dir><dir name="controllers"><file name="AjaxController.php" hash="3dc80810396889a44ad5630200a5120a"/></dir><dir name="etc"><file name="config.xml" hash="2591a21ff35bc08a5c2c4b1007badcb7"/><file name="config.xml~" hash="2591a21ff35bc08a5c2c4b1007badcb7"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="discussions.xml" hash="e287cd779c0b2822d13f841906d9ceda"/></dir><dir name="template"><dir name="discussions"><file name="discussions.phtml" hash="d0c2a36c1e45a8097d9e2b64bb34683c"/><file name="discussions.phtml~" hash="191ec614612eef04dbaef660b7254ffd"/><file name="discussions_tab.phtml" hash="a8ba7a05bd513c39d8e23ef5aaa9a713"/><file name="discussionsajax.phtml" hash="7198009ab06cff1df67af38b1a1c2bb2"/><file name="feedbackajax.phtml" hash="87dc84f946738cf45c469355a501495d"/><file name="getdiscussionsajax.phtml" hash="8a16f98dd4eee7ffd75d72d66b071ac5"/><file name="prod_discussions.phtml~" hash="a8ba7a05bd513c39d8e23ef5aaa9a713"/><file name="prod_discussions2.phtml~" hash="501c88fbd1f8a98c7cb398e4d619ad43"/><file name="searchdiscussionsajax.phtml" hash="710a9cf544b4280dcc979780a6b27397"/><file name="virality.phtml" hash="e24ff80a61fdb0650dd6ac9579e371e5"/><file name="virality.phtml~" hash="d458c32b5a7b9b8bdea7733dbf1114c6"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="discussions"><file name="discussions.phtml" hash="2cf98f4c538b94fee53071b6a3489fc3"/><file name="discussions.phtml~" hash="2cf98f4c538b94fee53071b6a3489fc3"/><file name="prod_discussions.phtml~" hash="a8ba7a05bd513c39d8e23ef5aaa9a713"/><file name="prod_discussions2.phtml~" hash="501c88fbd1f8a98c7cb398e4d619ad43"/><file name="virality.phtml~" hash="e5f7560a0fc7a498dfda94a62346a139"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="template"><dir name="discussions"><file name="discussions.phtml" hash="38a8cad19ed181f8c7fb5232bce3d096"/><file name="discussions.phtml~" hash="38a8cad19ed181f8c7fb5232bce3d096"/><file name="prod_discussions.phtml~" hash="a8ba7a05bd513c39d8e23ef5aaa9a713"/><file name="prod_discussions2.phtml~" hash="501c88fbd1f8a98c7cb398e4d619ad43"/><file name="virality.phtml~" hash="41cd911fb7a8e96e6e12d01cea97fba1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PPLS_Discussions.xml" hash="ac7b6141ef009aa254ead448c9720e95"/></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name/><channel>connect.magentocommerce.com/core</channel><min/><max/></package></required></dependencies>
36
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>PPLSAY_Social_Discussions</name>
4
+ <version>1.1.3</version>
5
  <stability>stable</stability>
6
  <license>GPL</license>
7
  <channel>community</channel>
26
  For demo site please refer to the following link pplsay demo:&#xD;
27
  http://demo.pplsay.com/&#xD;
28
  </description>
29
+ <notes>- Fixed performance issues</notes>
30
  <authors><author><name>PPLSAY Commerce Ltd</name><user>pplsay</user><email>contact@pplsay.com</email></author><author><name>PPLSAY Commerce Ltd</name><user>ymatatov</user><email>ymatatov@pplsay.com</email></author></authors>
31
+ <date>2014-08-27</date>
32
+ <time>18:33:39</time>
33
+ <contents><target name="magecommunity"><dir name="PPLS"><dir name="Discussions"><dir name="Block"><file name="Discussions.php" hash="ba59fa56d3a766bb4df0b316424429d6"/><file name="Discussions.php~" hash="bcd023e1d6fddcd5abbd7c3217235c80"/><file name="Virality.php" hash="89b053e0383f93c2822b7df641bf6eca"/><file name="Virality.php~" hash="89b053e0383f93c2822b7df641bf6eca"/></dir><dir name="Model"><file name="Discussions.php" hash="7db7b06bd5a042a177cc4ddd057f0294"/><file name="Discussions.php~" hash="9b03cd28731d30c09f2153a9d9893b12"/><file name="Observer.php" hash="c7033b540b29e847ccfdc1ee0773385f"/><file name="Observer.php~" hash="068e913c39ea60f5109a5be9455918b8"/><file name="Virality.php" hash="76bd0d650be1e40354c58a55e7e1b45c"/><file name="Virality.php~" hash="dc6798b3b775f6a111fb5725350e093f"/></dir><dir name="controllers"><file name="AjaxController.php" hash="68755c25bbe223eea5b9cbafc254894b"/><file name="AjaxController.php~" hash="49050506de09082d7032e0177bcc0a6b"/></dir><dir name="etc"><file name="config.xml" hash="2591a21ff35bc08a5c2c4b1007badcb7"/><file name="config.xml~" hash="2591a21ff35bc08a5c2c4b1007badcb7"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="discussions.xml" hash="ddea3c9c8230bc6fb92d70892efb7ad9"/></dir><dir name="template"><dir name="discussions"><file name="discoverajax.phtml" hash="2898a95d02519cf8054f17ce73fe424f"/><file name="discoverajax.phtml~" hash="2898a95d02519cf8054f17ce73fe424f"/><file name="discussions.phtml" hash="50449432efd90d331694e29e3c5977dd"/><file name="discussions.phtml~" hash="5d051febb94428a6207df204d451a4b7"/><file name="discussions_tab.phtml" hash="a8ba7a05bd513c39d8e23ef5aaa9a713"/><file name="discussionsajax.phtml" hash="7198009ab06cff1df67af38b1a1c2bb2"/><file name="feedbackajax.phtml" hash="87dc84f946738cf45c469355a501495d"/><file name="getdiscussionsajax.phtml" hash="8a16f98dd4eee7ffd75d72d66b071ac5"/><file name="prod_discussions.phtml~" hash="a8ba7a05bd513c39d8e23ef5aaa9a713"/><file name="prod_discussions2.phtml~" hash="501c88fbd1f8a98c7cb398e4d619ad43"/><file name="pviewajax.phtml" hash="e3874bf6cd826d3e674f8c542e2dd32c"/><file name="pviewajax.phtml~" hash="8a2a525b1cf2c5a9ee680ec043454b47"/><file name="searchdiscussionsajax.phtml" hash="710a9cf544b4280dcc979780a6b27397"/><file name="virality.phtml" hash="e24ff80a61fdb0650dd6ac9579e371e5"/><file name="virality.phtml~" hash="e24ff80a61fdb0650dd6ac9579e371e5"/></dir></dir></dir></dir><dir name="default"><dir name="default"><dir name="template"><dir name="discussions"><file name="discussions.phtml" hash="b628c9e68d54b18402717adc4a9129c7"/><file name="discussions.phtml~" hash="ee53c50d252f9b72db691094f4c38294"/><file name="prod_discussions.phtml~" hash="a8ba7a05bd513c39d8e23ef5aaa9a713"/><file name="prod_discussions2.phtml~" hash="501c88fbd1f8a98c7cb398e4d619ad43"/><file name="virality.phtml~" hash="e5f7560a0fc7a498dfda94a62346a139"/></dir></dir></dir></dir><dir name="rwd"><dir name="default"><dir name="template"><dir name="discussions"><file name="discussions.phtml" hash="b9e9115f6a44880a2bfad45b5edffcc1"/><file name="discussions.phtml~" hash="0a18e82fbfe7848c311cc265ac948be4"/><file name="prod_discussions.phtml~" hash="a8ba7a05bd513c39d8e23ef5aaa9a713"/><file name="prod_discussions2.phtml~" hash="501c88fbd1f8a98c7cb398e4d619ad43"/><file name="virality.phtml~" hash="41cd911fb7a8e96e6e12d01cea97fba1"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="PPLS_Discussions.xml" hash="ac7b6141ef009aa254ead448c9720e95"/></dir></target></contents>
34
  <compatible/>
35
  <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name/><channel>connect.magentocommerce.com/core</channel><min/><max/></package></required></dependencies>
36
  </package>