Version Notes
This is stable version of this extension and has been tested on various version of community editions.
In this particular version we are supporting it to run on PHP V 5.4.X
Download this release
Release Info
Developer | Rave Infosys |
Extension | Raveinfosys_sitemap |
Version | 1.0.3 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.3
- app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap.php +0 -0
- app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit.php +1 -1
- app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Config.php +0 -0
- app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Form.php +0 -0
- app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tab/Config.php +33 -51
- app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tab/Form.php +16 -20
- app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tabs.php +0 -0
- app/code/community/Raveinfosys/Showmap/Block/Showmap.php +26 -0
- app/code/{local → community}/Raveinfosys/Showmap/Helper/Data.php +0 -0
- app/code/community/Raveinfosys/Showmap/Model/Config.php +20 -0
- app/code/{local → community}/Raveinfosys/Showmap/Model/Mysql4/Config.php +1 -1
- app/code/community/Raveinfosys/Showmap/Model/Mysql4/Config/Collection.php +10 -0
- app/code/{local → community}/Raveinfosys/Showmap/Model/Mysql4/Showmap.php +0 -0
- app/code/{local → community}/Raveinfosys/Showmap/Model/Mysql4/Showmap/Collection.php +0 -0
- app/code/community/Raveinfosys/Showmap/Model/Showmap.php +249 -0
- app/code/community/Raveinfosys/Showmap/controllers/Adminhtml/ShowmapController.php +61 -0
- app/code/community/Raveinfosys/Showmap/controllers/IndexController.php +9 -0
- app/code/{local → community}/Raveinfosys/Showmap/etc/config.xml +1 -1
- app/code/{local → community}/Raveinfosys/Showmap/sql/showmap_setup/mysql4-install-0.1.0.php +6 -8
- app/code/{local → community}/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse.php +1 -1
- app/code/community/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse/Description.php +13 -0
- app/code/{local → community}/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse/Grid.php +4 -0
- app/code/{local → community}/Raveinfosys/Showresponse/Helper/Data.php +0 -0
- app/code/{local → community}/Raveinfosys/Showresponse/Model/Mysql4/Showresponse.php +0 -0
- app/code/{local → community}/Raveinfosys/Showresponse/Model/Mysql4/Showresponse/Collection.php +0 -0
- app/code/community/Raveinfosys/Showresponse/Model/Showresponse.php +18 -0
- app/code/{local → community}/Raveinfosys/Showresponse/controllers/Adminhtml/ShowresponseController.php +5 -25
- app/code/{local → community}/Raveinfosys/Showresponse/etc/config.xml +0 -0
- app/code/{local → community}/Raveinfosys/Showresponse/sql/showresponse_setup/mysql4-install-0.1.0.php +1 -2
- app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Grid.php +0 -116
- app/code/local/Raveinfosys/Showmap/Block/Showmap.php +0 -17
- app/code/local/Raveinfosys/Showmap/Model/Config.php +0 -37
- app/code/local/Raveinfosys/Showmap/Model/Showmap.php +0 -163
- app/code/local/Raveinfosys/Showmap/Model/Status.php +0 -15
- app/code/local/Raveinfosys/Showmap/controllers/Adminhtml/ShowmapController.php +0 -334
- app/code/local/Raveinfosys/Showmap/controllers/IndexController.php +0 -25
- app/code/local/Raveinfosys/Showresponse/Block/Showresponse.php +0 -17
- app/code/local/Raveinfosys/Showresponse/Model/Showresponse.php +0 -35
- app/code/local/Raveinfosys/Showresponse/Model/Status.php +0 -15
- app/design/frontend/{default → base}/default/layout/showmap.xml +0 -0
- app/design/frontend/{default → base}/default/template/showmap/showmap.phtml +5 -13
- app/etc/modules/Raveinfosys_Showmap.xml +1 -1
- app/etc/modules/Raveinfosys_Showresponse.xml +1 -1
- package.xml +8 -8
app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap.php
RENAMED
File without changes
|
app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit.php
RENAMED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
{
|
5 |
-
|
6 |
{
|
7 |
parent::__construct();
|
8 |
|
2 |
|
3 |
class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit extends Mage_Adminhtml_Block_Widget_Form_Container
|
4 |
{
|
5 |
+
public function __construct()
|
6 |
{
|
7 |
parent::__construct();
|
8 |
|
app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Config.php
RENAMED
File without changes
|
app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Form.php
RENAMED
File without changes
|
app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tab/Config.php
RENAMED
@@ -51,9 +51,6 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Config extends Mage_A
|
|
51 |
'label' => Mage::helper('showmap')->__('Yes')))));
|
52 |
}
|
53 |
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
if($row['product']=='yes')
|
58 |
{
|
59 |
$fieldset->addField('product', 'select', array(
|
@@ -85,10 +82,7 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Config extends Mage_A
|
|
85 |
'label' => Mage::helper('showmap')->__('Yes')))));
|
86 |
}
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
if($row['cms']=='yes')
|
93 |
{
|
94 |
$fieldset->addField('cms', 'select', array(
|
@@ -118,59 +112,47 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Config extends Mage_A
|
|
118 |
array(
|
119 |
'value' => yes,
|
120 |
'label' => Mage::helper('showmap')->__('Yes')))));
|
121 |
-
}
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
if($row['other']=='yes')
|
127 |
{
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
}
|
141 |
else
|
142 |
{
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
}
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
'after_element_html' => '<small></small>',
|
164 |
-
'style' => 'background-color:#FF6600; width:70px; color:white;font-family:Arial, Helvetica, sans-serif;
|
165 |
-
font-style:normal; ',
|
166 |
-
'tabindex' => 1
|
167 |
-
));
|
168 |
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
return parent::_prepareForm();
|
173 |
-
|
174 |
}
|
175 |
|
176 |
|
51 |
'label' => Mage::helper('showmap')->__('Yes')))));
|
52 |
}
|
53 |
|
|
|
|
|
|
|
54 |
if($row['product']=='yes')
|
55 |
{
|
56 |
$fieldset->addField('product', 'select', array(
|
82 |
'label' => Mage::helper('showmap')->__('Yes')))));
|
83 |
}
|
84 |
|
85 |
+
|
|
|
|
|
|
|
86 |
if($row['cms']=='yes')
|
87 |
{
|
88 |
$fieldset->addField('cms', 'select', array(
|
112 |
array(
|
113 |
'value' => yes,
|
114 |
'label' => Mage::helper('showmap')->__('Yes')))));
|
115 |
+
}
|
116 |
+
|
|
|
|
|
|
|
117 |
if($row['other']=='yes')
|
118 |
{
|
119 |
+
$fieldset->addField('other', 'select', array(
|
120 |
+
'name' => 'other',
|
121 |
+
'label' => 'Show Header And Footer',
|
122 |
+
'align' =>'left',
|
123 |
+
'values' => array(
|
124 |
+
array(
|
125 |
+
'value' => yes,
|
126 |
+
'label' => Mage::helper('showmap')->__('Yes'),),
|
127 |
|
128 |
+
array(
|
129 |
+
'value' => no,
|
130 |
+
'label' => Mage::helper('showmap')->__('No')))));
|
131 |
}
|
132 |
else
|
133 |
{
|
134 |
+
$fieldset->addField('other', 'select', array(
|
135 |
+
'name' => 'other',
|
136 |
+
'label' => 'Show Header And Footer',
|
137 |
+
'align' =>'left',
|
138 |
+
'values' => array(
|
139 |
+
array(
|
140 |
+
'value' => no,
|
141 |
+
'label' => Mage::helper('showmap')->__('No'),),
|
142 |
|
143 |
+
array(
|
144 |
+
'value' => yes,
|
145 |
+
'label' => Mage::helper('showmap')->__('Yes')))));
|
146 |
}
|
147 |
+
$fieldset->addField('submit', 'submit', array(
|
148 |
+
'value' => 'Save',
|
149 |
+
'after_element_html' => '<small></small>',
|
150 |
+
'style' => 'background-color:#FF6600; width:70px; color:white;font-family:Arial, Helvetica, sans-serif;
|
151 |
+
font-style:normal; ',
|
152 |
+
'tabindex' => 1
|
153 |
+
));
|
|
|
|
|
|
|
|
|
|
|
154 |
|
155 |
+
return parent::_prepareForm();
|
|
|
|
|
|
|
|
|
156 |
}
|
157 |
|
158 |
|
app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tab/Form.php
RENAMED
@@ -4,17 +4,13 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adm
|
|
4 |
{
|
5 |
protected function _prepareForm()
|
6 |
{
|
7 |
-
|
8 |
-
$showmap = Mage::getModel('showmap/showmap');
|
9 |
$row = $showmap->getRow();
|
10 |
if($row['google']=='yes')$google=true;
|
11 |
if($row['bing']=='yes')$bing=true;
|
12 |
if($row['window']=='yes')$window=true;
|
13 |
-
if($row['yahoo']=='yes')
|
14 |
-
|
15 |
-
$yahoo=true;
|
16 |
-
$yahoo_id = $row['yahoo_id'];
|
17 |
-
}
|
18 |
$form = new Varien_Data_Form();
|
19 |
$this->setForm($form);
|
20 |
$fieldset = $form->addFieldset('showmap_form', array('legend'=>Mage::helper('showmap')->__('Site Map')));
|
@@ -46,10 +42,10 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adm
|
|
46 |
'values' => array(
|
47 |
array(
|
48 |
'value' => hours,
|
49 |
-
'label' => Mage::helper('showmap')->__('
|
50 |
array(
|
51 |
'value' => days,
|
52 |
-
'label' => Mage::helper('showmap')->__('
|
53 |
|
54 |
)));
|
55 |
}
|
@@ -61,11 +57,11 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adm
|
|
61 |
'values' => array(
|
62 |
array(
|
63 |
'value' => days,
|
64 |
-
'label' => Mage::helper('showmap')->__('
|
65 |
|
66 |
array(
|
67 |
'value' => hours,
|
68 |
-
'label' => Mage::helper('showmap')->__('
|
69 |
}
|
70 |
|
71 |
|
@@ -77,7 +73,7 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adm
|
|
77 |
'checked' => $google,
|
78 |
'onclick' => "",
|
79 |
'onchange' => "",
|
80 |
-
'value' => '
|
81 |
'disabled' => false,
|
82 |
'after_element_html' => '<large>Google</large>',
|
83 |
'tabindex' => 1
|
@@ -88,7 +84,7 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adm
|
|
88 |
'checked' => $bing,
|
89 |
'onclick' => "",
|
90 |
'onchange' => "",
|
91 |
-
'value' => '
|
92 |
'disabled' => false,
|
93 |
'after_element_html' => '<large>Bing</large>',
|
94 |
'tabindex' => 1
|
@@ -99,7 +95,7 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adm
|
|
99 |
'checked' => $window,
|
100 |
'onclick' => "",
|
101 |
'onchange' => "",
|
102 |
-
'value' => '
|
103 |
'disabled' => false,
|
104 |
'after_element_html' => '<large>Window Live</large>',
|
105 |
'tabindex' => 1
|
@@ -108,15 +104,15 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adm
|
|
108 |
$fieldset->addField('yahoo', 'checkbox', array(
|
109 |
'name' => 'yahoo',
|
110 |
'checked' => $yahoo,
|
111 |
-
'onclick' => "if(this.value=='
|
112 |
document.getElementById('yahoo_appid').style.visibility='visible';
|
113 |
document.getElementById('label').style.visibility='visible';}
|
114 |
else{
|
115 |
document.getElementById('yahoo_appid').style.visibility='hidden';
|
116 |
document.getElementById('label').style.visibility='hidden';
|
117 |
-
}}",
|
118 |
'onchange' => "",
|
119 |
-
'value' => '
|
120 |
'disabled' => false,
|
121 |
|
122 |
'after_element_html' => '<large>Yahoo</large>',
|
@@ -124,15 +120,15 @@ class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Edit_Tab_Form extends Mage_Adm
|
|
124 |
));
|
125 |
|
126 |
|
127 |
-
$fieldset->addField('label', 'label', array(
|
128 |
'after_element_html' => '<div id ="label" style=visibility:hidden;>Yahoo App Id</div>'));
|
129 |
|
130 |
$fieldset->addField('yahoo_appid', 'text', array(
|
131 |
'label' => Mage::helper('showmap')->__(''),
|
132 |
'label_style' => 'visibility: hidden;',
|
133 |
-
'name' => '
|
134 |
'value' => ''.$yahoo_id.'',
|
135 |
-
'style' => 'visibility: hidden;'));
|
136 |
|
137 |
|
138 |
return parent::_prepareForm();
|
4 |
{
|
5 |
protected function _prepareForm()
|
6 |
{
|
7 |
+
$showmap = Mage::getModel('showmap/showmap');
|
|
|
8 |
$row = $showmap->getRow();
|
9 |
if($row['google']=='yes')$google=true;
|
10 |
if($row['bing']=='yes')$bing=true;
|
11 |
if($row['window']=='yes')$window=true;
|
12 |
+
if($row['yahoo']=='yes')$yahoo=true;
|
13 |
+
|
|
|
|
|
|
|
14 |
$form = new Varien_Data_Form();
|
15 |
$this->setForm($form);
|
16 |
$fieldset = $form->addFieldset('showmap_form', array('legend'=>Mage::helper('showmap')->__('Site Map')));
|
42 |
'values' => array(
|
43 |
array(
|
44 |
'value' => hours,
|
45 |
+
'label' => Mage::helper('showmap')->__('Hour(s)')),
|
46 |
array(
|
47 |
'value' => days,
|
48 |
+
'label' => Mage::helper('showmap')->__('Day(s)'),),
|
49 |
|
50 |
)));
|
51 |
}
|
57 |
'values' => array(
|
58 |
array(
|
59 |
'value' => days,
|
60 |
+
'label' => Mage::helper('showmap')->__('Day(s)'),),
|
61 |
|
62 |
array(
|
63 |
'value' => hours,
|
64 |
+
'label' => Mage::helper('showmap')->__('Hour(s)')))));
|
65 |
}
|
66 |
|
67 |
|
73 |
'checked' => $google,
|
74 |
'onclick' => "",
|
75 |
'onchange' => "",
|
76 |
+
'value' => 'yes',
|
77 |
'disabled' => false,
|
78 |
'after_element_html' => '<large>Google</large>',
|
79 |
'tabindex' => 1
|
84 |
'checked' => $bing,
|
85 |
'onclick' => "",
|
86 |
'onchange' => "",
|
87 |
+
'value' => 'yes',
|
88 |
'disabled' => false,
|
89 |
'after_element_html' => '<large>Bing</large>',
|
90 |
'tabindex' => 1
|
95 |
'checked' => $window,
|
96 |
'onclick' => "",
|
97 |
'onchange' => "",
|
98 |
+
'value' => 'yes',
|
99 |
'disabled' => false,
|
100 |
'after_element_html' => '<large>Window Live</large>',
|
101 |
'tabindex' => 1
|
104 |
$fieldset->addField('yahoo', 'checkbox', array(
|
105 |
'name' => 'yahoo',
|
106 |
'checked' => $yahoo,
|
107 |
+
/* 'onclick' => "if(this.value=='yes'){if(this.checked==true){
|
108 |
document.getElementById('yahoo_appid').style.visibility='visible';
|
109 |
document.getElementById('label').style.visibility='visible';}
|
110 |
else{
|
111 |
document.getElementById('yahoo_appid').style.visibility='hidden';
|
112 |
document.getElementById('label').style.visibility='hidden';
|
113 |
+
}}", */
|
114 |
'onchange' => "",
|
115 |
+
'value' => 'yes',
|
116 |
'disabled' => false,
|
117 |
|
118 |
'after_element_html' => '<large>Yahoo</large>',
|
120 |
));
|
121 |
|
122 |
|
123 |
+
/* $fieldset->addField('label', 'label', array(
|
124 |
'after_element_html' => '<div id ="label" style=visibility:hidden;>Yahoo App Id</div>'));
|
125 |
|
126 |
$fieldset->addField('yahoo_appid', 'text', array(
|
127 |
'label' => Mage::helper('showmap')->__(''),
|
128 |
'label_style' => 'visibility: hidden;',
|
129 |
+
'name' => 'yahoo_id',
|
130 |
'value' => ''.$yahoo_id.'',
|
131 |
+
'style' => 'visibility: hidden;')); */
|
132 |
|
133 |
|
134 |
return parent::_prepareForm();
|
app/code/{local → community}/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Edit/Tabs.php
RENAMED
File without changes
|
app/code/community/Raveinfosys/Showmap/Block/Showmap.php
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Raveinfosys_Showmap_Block_Showmap extends Mage_Core_Block_Template
|
3 |
+
{
|
4 |
+
public function _prepareLayout()
|
5 |
+
{
|
6 |
+
return parent::_prepareLayout();
|
7 |
+
}
|
8 |
+
|
9 |
+
public function getShowmap()
|
10 |
+
{
|
11 |
+
$cats = Mage::getModel('catalog/category')->load(2)->getChildren();
|
12 |
+
$catIds = explode(',',$cats);
|
13 |
+
$this->setData('catIds', $catIds);
|
14 |
+
|
15 |
+
$product = Mage::getModel('catalog/product');
|
16 |
+
$products = $product->getCollection()->addStoreFilter($storeId)->getData();
|
17 |
+
$this->setData('products', $products);
|
18 |
+
|
19 |
+
$collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());
|
20 |
+
$collection->getSelect()
|
21 |
+
->where('is_active = 1');
|
22 |
+
$this->setData('collection', $collection);
|
23 |
+
|
24 |
+
return Mage::getModel('showmap/config')->getRow();
|
25 |
+
}
|
26 |
+
}
|
app/code/{local → community}/Raveinfosys/Showmap/Helper/Data.php
RENAMED
File without changes
|
app/code/community/Raveinfosys/Showmap/Model/Config.php
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Raveinfosys_Showmap_Model_Config extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
|
6 |
+
public function _construct()
|
7 |
+
{
|
8 |
+
parent::_construct();
|
9 |
+
$this->_init('showmap/config');
|
10 |
+
}
|
11 |
+
|
12 |
+
public function getRow()
|
13 |
+
{
|
14 |
+
$collection = $this->getCollection()
|
15 |
+
->setOrder('id', 'DESC');
|
16 |
+
$row = $collection->getFirstItem()->getData();
|
17 |
+
return $row;
|
18 |
+
}
|
19 |
+
|
20 |
+
}
|
app/code/{local → community}/Raveinfosys/Showmap/Model/Mysql4/Config.php
RENAMED
@@ -5,6 +5,6 @@ class Raveinfosys_Showmap_Model_Mysql4_Config extends Mage_Core_Model_Mysql4_Abs
|
|
5 |
public function _construct()
|
6 |
{
|
7 |
// Note that the showmap_id refers to the key field in your database table.
|
8 |
-
$this->_init('showmap/
|
9 |
}
|
10 |
}
|
5 |
public function _construct()
|
6 |
{
|
7 |
// Note that the showmap_id refers to the key field in your database table.
|
8 |
+
$this->_init('showmap/config', 'id');
|
9 |
}
|
10 |
}
|
app/code/community/Raveinfosys/Showmap/Model/Mysql4/Config/Collection.php
ADDED
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Raveinfosys_Showmap_Model_Mysql4_Config_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('showmap/config');
|
9 |
+
}
|
10 |
+
}
|
app/code/{local → community}/Raveinfosys/Showmap/Model/Mysql4/Showmap.php
RENAMED
File without changes
|
app/code/{local → community}/Raveinfosys/Showmap/Model/Mysql4/Showmap/Collection.php
RENAMED
File without changes
|
app/code/community/Raveinfosys/Showmap/Model/Showmap.php
ADDED
@@ -0,0 +1,249 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Raveinfosys_Showmap_Model_Showmap extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public $google_url = "http://www.google.com/webmasters/tools/ping?sitemap=";
|
6 |
+
public $yahoo_url = "http://www.bing.com/webmaster/ping.aspx?siteMap=";
|
7 |
+
public $bing_url = "http://www.bing.com/webmaster/ping.aspx?siteMap=";
|
8 |
+
public $window_url = "http://www.bing.com/webmaster/ping.aspx?siteMap=";
|
9 |
+
|
10 |
+
public function _construct()
|
11 |
+
{
|
12 |
+
parent::_construct();
|
13 |
+
$this->_init('showmap/showmap');
|
14 |
+
}
|
15 |
+
|
16 |
+
public function getRow()
|
17 |
+
{
|
18 |
+
$collection = $this->getCollection()
|
19 |
+
->setOrder('showmap_id', 'DESC');
|
20 |
+
$row = $collection->getFirstItem()->getData();
|
21 |
+
return $row;
|
22 |
+
}
|
23 |
+
|
24 |
+
public function update()
|
25 |
+
{
|
26 |
+
$arr_row = $this->getRow();
|
27 |
+
$this->submitSitemap($arr_row);
|
28 |
+
}
|
29 |
+
|
30 |
+
public function submitSitemap($data)
|
31 |
+
{
|
32 |
+
$responses = array();
|
33 |
+
$responses['google_response'] = 'Not Configured';
|
34 |
+
$responses['yahoo_response'] = 'Not Configured';
|
35 |
+
$responses['bing_response'] = 'Not Configured';
|
36 |
+
$responses['window_response'] = 'Not Configured';
|
37 |
+
|
38 |
+
$base_url = $this->get_url()."sitemap.xml";
|
39 |
+
$isCurl = function_exists(curl_init);
|
40 |
+
if($isCurl)
|
41 |
+
{
|
42 |
+
if($data['google']=='yes')
|
43 |
+
{
|
44 |
+
$url_google = $this->google_url.$base_url;
|
45 |
+
$string = $this->get_web_page($url_google);
|
46 |
+
|
47 |
+
$DOM = new DOMDocument;
|
48 |
+
$DOM->loadHTML($string);
|
49 |
+
|
50 |
+
$items = $DOM->getElementsByTagName('body');
|
51 |
+
$array = array();
|
52 |
+
for ($i = 0; $i < $items->length; $i++)
|
53 |
+
$array = $items->item($i)->nodeValue ;
|
54 |
+
$responses['google_response'] = substr($array,'0',105);
|
55 |
+
}
|
56 |
+
|
57 |
+
if($data['yahoo']=='yes')
|
58 |
+
{
|
59 |
+
$url_yahoo = $this->yahoo_url.$base_url;
|
60 |
+
$responses['yahoo_response'] = strip_tags($this->get_web_page($url_yahoo));
|
61 |
+
}
|
62 |
+
|
63 |
+
if($data['bing']=='yes')
|
64 |
+
{
|
65 |
+
$url_bing = $this->bing_url.$base_url;
|
66 |
+
$responses['bing_response'] = strip_tags($this->get_web_page($url_bing));
|
67 |
+
}
|
68 |
+
|
69 |
+
if($data['window']=='yes')
|
70 |
+
{
|
71 |
+
$url_window = $this->window_url.$base_url;
|
72 |
+
$responses['window_response'] = strip_tags($this->get_web_page($url_window));
|
73 |
+
}
|
74 |
+
}
|
75 |
+
|
76 |
+
if($data['google']=='yes' || $data['bing']=='yes' || $data['window']=='yes' || $data['yahoo']=='yes')
|
77 |
+
{
|
78 |
+
$responses['date'] = date('Y-m-d h:i:s a', Mage::getModel('core/date')->timestamp(time()));
|
79 |
+
$showresponse = Mage::getModel('showresponse/showresponse')->setData($responses);
|
80 |
+
$showresponse->save();
|
81 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('showmap')->__('sitemap was successfully submitted'));
|
82 |
+
}
|
83 |
+
else
|
84 |
+
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('showmap')->__('Please choose at least 1 channel'));
|
85 |
+
}
|
86 |
+
|
87 |
+
function get_web_page( $url )
|
88 |
+
{
|
89 |
+
$options = array(
|
90 |
+
CURLOPT_RETURNTRANSFER => true, // return web page
|
91 |
+
CURLOPT_HEADER => false, // don't return headers
|
92 |
+
CURLOPT_FOLLOWLOCATION => true, // follow redirects
|
93 |
+
CURLOPT_ENCODING => "", // handle all encodings
|
94 |
+
CURLOPT_AUTOREFERER => true, // set referer on redirect
|
95 |
+
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
|
96 |
+
CURLOPT_TIMEOUT => 120, // timeout on response
|
97 |
+
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
|
98 |
+
);
|
99 |
+
|
100 |
+
$ch = curl_init( $url );
|
101 |
+
curl_setopt_array( $ch, $options );
|
102 |
+
$content = curl_exec( $ch );
|
103 |
+
$err = curl_errno( $ch );
|
104 |
+
$errmsg = curl_error( $ch );
|
105 |
+
$header = curl_getinfo( $ch );
|
106 |
+
curl_close( $ch );
|
107 |
+
$header['errno'] = $err;
|
108 |
+
$header['errmsg'] = $errmsg;
|
109 |
+
$header['content'] = $content;
|
110 |
+
return $content;
|
111 |
+
}
|
112 |
+
|
113 |
+
public function get_url()
|
114 |
+
{
|
115 |
+
$string = Mage::getBaseURL();
|
116 |
+
$string1 = str_replace("index.php/","", $string);
|
117 |
+
$string2 = str_replace('/','%2F',$string1);
|
118 |
+
$string3 = str_replace(':','%3A',$string2);
|
119 |
+
return $string3;
|
120 |
+
|
121 |
+
}
|
122 |
+
|
123 |
+
public function generateSitemapXML()
|
124 |
+
{
|
125 |
+
$config = Mage::getModel('showmap/config');
|
126 |
+
$row = $config->getRow();
|
127 |
+
if($row['configured'] == 0)return false;
|
128 |
+
$content = file_get_contents('sitemap/sitemap.xml');
|
129 |
+
$content = str_replace('</urlset>','',$content);
|
130 |
+
$content .= '<?xml version="1.0" encoding="utf-8"?><urlset>';
|
131 |
+
$count = 0;
|
132 |
+
if($row['category'] == 'yes')
|
133 |
+
{
|
134 |
+
$cats = Mage::getModel('catalog/category')->load(2)->getChildren();
|
135 |
+
$catIds = explode(',',$cats);
|
136 |
+
foreach($catIds as $catId)
|
137 |
+
{
|
138 |
+
if($catId !='')
|
139 |
+
{
|
140 |
+
$category = Mage::getModel('catalog/category')->load($catId);
|
141 |
+
$subCats = Mage::getModel('catalog/category')->load($category->getId())->getChildren();
|
142 |
+
$subCatIds = explode(',',$subCats);
|
143 |
+
$url=$category->getUrl();
|
144 |
+
if(strpos($content,$url) === false)
|
145 |
+
{
|
146 |
+
$content .= '<url><loc>'.$url.'</loc>';
|
147 |
+
$content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
|
148 |
+
$content .= '<changefreq>daily</changefreq>';
|
149 |
+
$content .= '<priority>0.50</priority>';
|
150 |
+
$content .= '</url>';
|
151 |
+
$count++;
|
152 |
+
}
|
153 |
+
if(count($subCatIds) > 1)
|
154 |
+
{
|
155 |
+
foreach($subCatIds as $subCat)
|
156 |
+
{
|
157 |
+
$subCategory = Mage::getModel('catalog/category')->load($subCat);
|
158 |
+
$url=$subCategory->getUrl();
|
159 |
+
if(strpos($content,$url) === false)
|
160 |
+
{
|
161 |
+
$content .= '<url><loc>'.$url.'</loc>';
|
162 |
+
$content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
|
163 |
+
$content .= '<changefreq>daily</changefreq>';
|
164 |
+
$content .= '<priority>0.50</priority>';
|
165 |
+
$content .= '</url>';
|
166 |
+
$count++;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
}
|
170 |
+
}
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
if($row['product'] == 'yes')
|
175 |
+
{
|
176 |
+
$product = Mage::getModel('catalog/product');
|
177 |
+
$products = $product->getCollection()->addStoreFilter($storeId)->getData();
|
178 |
+
foreach ($products as $pro)
|
179 |
+
{
|
180 |
+
$Stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($pro['entity_id'])->getIsinStock();
|
181 |
+
if($Stock)
|
182 |
+
{
|
183 |
+
$_product = $product->load($pro['entity_id']);
|
184 |
+
$url=Mage::getUrl().$_product->getUrlPath();
|
185 |
+
if(strpos($content,$url) === false && $_product->getStatus()!=2)
|
186 |
+
{
|
187 |
+
$content .= '<url><loc>'.$url.'</loc>';
|
188 |
+
$content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
|
189 |
+
$content .= '<changefreq>daily</changefreq>';
|
190 |
+
$content .= '<priority>0.50</priority>';
|
191 |
+
$content .= '</url>';
|
192 |
+
$count++;
|
193 |
+
}
|
194 |
+
}
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
if($row['cms'] == 'yes')
|
199 |
+
{
|
200 |
+
$collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());
|
201 |
+
$collection->getSelect()
|
202 |
+
->where('is_active = 1');
|
203 |
+
foreach ($collection as $page)
|
204 |
+
{
|
205 |
+
$PageData = $page->getData();
|
206 |
+
if($PageData['identifier']!='no-route' && $PageData['identifier']!='enable-cookies')
|
207 |
+
{
|
208 |
+
$url = Mage::getUrl(). $PageData['identifier'];
|
209 |
+
if(strpos($content,$url) === false)
|
210 |
+
{
|
211 |
+
$content .= '<url><loc>'.$url.'</loc>';
|
212 |
+
$content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
|
213 |
+
$content .= '<changefreq>daily</changefreq>';
|
214 |
+
$content .= '<priority>0.50</priority>';
|
215 |
+
$content .= '</url>';
|
216 |
+
$count++;
|
217 |
+
}
|
218 |
+
}
|
219 |
+
}
|
220 |
+
}
|
221 |
+
|
222 |
+
$content .= '</urlset>';
|
223 |
+
$url_dir = Mage::getBaseDir()."/sitemap.xml";
|
224 |
+
$file_handle = fopen($url_dir,'w');
|
225 |
+
fwrite($file_handle,$content);
|
226 |
+
fclose($file_handle);
|
227 |
+
return true;
|
228 |
+
}
|
229 |
+
|
230 |
+
public function changeInterval()
|
231 |
+
{
|
232 |
+
$obj = Mage::getModel('showmap/showmap');
|
233 |
+
$showmap = $obj->getRow();
|
234 |
+
if($showmap['format'] == 'days')
|
235 |
+
{
|
236 |
+
$ping_interval = $showmap['ping_interval'];
|
237 |
+
$cron = '0 0 */'.$ping_interval.' * *';
|
238 |
+
}
|
239 |
+
if($showmap['format'] == 'hours')
|
240 |
+
{
|
241 |
+
$ping_interval = $showmap['ping_interval'];
|
242 |
+
$cron = '0 */'.$ping_interval.' * * *';
|
243 |
+
}
|
244 |
+
$url = Mage::getBaseDir('code').'/community/Raveinfosys/Showmap/etc/config.xml';
|
245 |
+
$endreXML = simplexml_load_file($url);
|
246 |
+
$endreXML->crontab[0]->jobs[0]->Raveinfosys_Showmap[0]->schedule[0]->cron_expr = $cron;
|
247 |
+
file_put_contents($url, $endreXML->asXML());
|
248 |
+
}
|
249 |
+
}
|
app/code/community/Raveinfosys/Showmap/controllers/Adminhtml/ShowmapController.php
ADDED
@@ -0,0 +1,61 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Raveinfosys_Showmap_Adminhtml_ShowmapController extends Mage_Adminhtml_Controller_Action
|
4 |
+
{
|
5 |
+
|
6 |
+
public function indexAction()
|
7 |
+
{
|
8 |
+
if(Mage::getModel('showmap/showmap')->generateSitemapXML())
|
9 |
+
$this->_forward('edit');
|
10 |
+
else
|
11 |
+
$this->_redirect('*/*/config');
|
12 |
+
}
|
13 |
+
|
14 |
+
public function editAction()
|
15 |
+
{
|
16 |
+
$this->loadLayout();
|
17 |
+
$this->_setActiveMenu('showmap/items');
|
18 |
+
|
19 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
20 |
+
$this->_addContent($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit'))
|
21 |
+
->_addLeft($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit_tabs'));
|
22 |
+
|
23 |
+
$this->renderLayout();
|
24 |
+
}
|
25 |
+
|
26 |
+
public function saveAction()
|
27 |
+
{
|
28 |
+
if ($data = $this->getRequest()->getPost())
|
29 |
+
{
|
30 |
+
$model = Mage::getModel('showmap/showmap');
|
31 |
+
$model->submitSitemap($data);
|
32 |
+
$model->setData($data)
|
33 |
+
->save();
|
34 |
+
|
35 |
+
$model->changeInterval();
|
36 |
+
}
|
37 |
+
$this->_redirect('*/*/');
|
38 |
+
}
|
39 |
+
|
40 |
+
public function configAction()
|
41 |
+
{
|
42 |
+
$this->loadLayout();
|
43 |
+
$this->_setActiveMenu('showmap/items');
|
44 |
+
|
45 |
+
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
46 |
+
$this->_addContent($this->getLayout()->createBlock('showmap/adminhtml_showmap_config'))
|
47 |
+
->_addLeft($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit_config'));
|
48 |
+
|
49 |
+
if ($data = $this->getRequest()->getPost())
|
50 |
+
{
|
51 |
+
$model = Mage::getModel('showmap/config');
|
52 |
+
$data['configured'] = 1;
|
53 |
+
$model->setData($data)
|
54 |
+
->save();
|
55 |
+
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('showmap')->__('Sitemap was successfully configured'));
|
56 |
+
$this->_redirect('*/*/config');
|
57 |
+
}
|
58 |
+
$this->renderLayout();
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
app/code/community/Raveinfosys/Showmap/controllers/IndexController.php
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Raveinfosys_Showmap_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
+
{
|
4 |
+
public function indexAction()
|
5 |
+
{
|
6 |
+
$this->loadLayout();
|
7 |
+
$this->renderLayout();
|
8 |
+
}
|
9 |
+
}
|
app/code/{local → community}/Raveinfosys/Showmap/etc/config.xml
RENAMED
@@ -138,7 +138,7 @@
|
|
138 |
<jobs>
|
139 |
<Raveinfosys_Showmap>
|
140 |
<schedule>
|
141 |
-
<cron_expr>0 */
|
142 |
</schedule>
|
143 |
<run>
|
144 |
<model>showmap/showmap::update</model>
|
138 |
<jobs>
|
139 |
<Raveinfosys_Showmap>
|
140 |
<schedule>
|
141 |
+
<cron_expr>0 */1 * * *</cron_expr>
|
142 |
</schedule>
|
143 |
<run>
|
144 |
<model>showmap/showmap::update</model>
|
app/code/{local → community}/Raveinfosys/Showmap/sql/showmap_setup/mysql4-install-0.1.0.php
RENAMED
@@ -12,13 +12,11 @@ $installer->run("
|
|
12 |
`showmap_id` int(11) NOT NULL auto_increment,
|
13 |
`ping_interval` int(12),
|
14 |
`format` varchar(20),
|
15 |
-
`google` varchar(20),
|
16 |
-
`bing` varchar(20),
|
17 |
-
`window` varchar(20),
|
18 |
-
`yahoo` varchar(20),
|
19 |
-
`
|
20 |
-
`internal_company_id` varchar(80) NOT NULL default '',
|
21 |
-
PRIMARY KEY (`showmap_id`)
|
22 |
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
23 |
|
24 |
|
@@ -30,7 +28,7 @@ $installer->run("
|
|
30 |
`category` varchar(20),
|
31 |
`cms` varchar(20),
|
32 |
`other` varchar(20),
|
33 |
-
`configured` int(2) NOT NULL DEFAULT
|
34 |
PRIMARY KEY (`id`)
|
35 |
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
36 |
");
|
12 |
`showmap_id` int(11) NOT NULL auto_increment,
|
13 |
`ping_interval` int(12),
|
14 |
`format` varchar(20),
|
15 |
+
`google` varchar(20) NOT NULL default 'no',
|
16 |
+
`bing` varchar(20) NOT NULL default 'no',
|
17 |
+
`window` varchar(20) NOT NULL default 'no',
|
18 |
+
`yahoo` varchar(20) NOT NULL default 'no',
|
19 |
+
PRIMARY KEY (`showmap_id`)
|
|
|
|
|
20 |
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
21 |
|
22 |
|
28 |
`category` varchar(20),
|
29 |
`cms` varchar(20),
|
30 |
`other` varchar(20),
|
31 |
+
`configured` int(2) NOT NULL DEFAULT 1,
|
32 |
PRIMARY KEY (`id`)
|
33 |
)ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
34 |
");
|
app/code/{local → community}/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse.php
RENAMED
@@ -6,7 +6,7 @@ class Raveinfosys_Showresponse_Block_Adminhtml_Showresponse extends Mage_Adminht
|
|
6 |
$this->_controller = 'adminhtml_showresponse';
|
7 |
$this->_blockGroup = 'showresponse';
|
8 |
$this->_headerText = Mage::helper('showresponse')->__('View Responses');
|
9 |
-
$this->_addButtonLabel = Mage::helper('showresponse')->__('Refresh');
|
10 |
parent::__construct();
|
|
|
11 |
}
|
12 |
}
|
6 |
$this->_controller = 'adminhtml_showresponse';
|
7 |
$this->_blockGroup = 'showresponse';
|
8 |
$this->_headerText = Mage::helper('showresponse')->__('View Responses');
|
|
|
9 |
parent::__construct();
|
10 |
+
$this->removeButton('add');
|
11 |
}
|
12 |
}
|
app/code/community/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse/Description.php
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
class Raveinfosys_Showresponse_Block_Adminhtml_Showresponse_Description extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Text
|
3 |
+
{
|
4 |
+
public function render(Varien_Object $row)
|
5 |
+
{
|
6 |
+
$html = parent::render($row);
|
7 |
+
if(strlen($html)>250)
|
8 |
+
return substr($html,0,250).'...';
|
9 |
+
else
|
10 |
+
return $html;
|
11 |
+
}
|
12 |
+
}
|
13 |
+
?>
|
app/code/{local → community}/Raveinfosys/Showresponse/Block/Adminhtml/Showresponse/Grid.php
RENAMED
@@ -31,24 +31,28 @@ class Raveinfosys_Showresponse_Block_Adminhtml_Showresponse_Grid extends Mage_Ad
|
|
31 |
'header' => Mage::helper('showresponse')->__('Google Response'),
|
32 |
'align' =>'left',
|
33 |
'index' => 'google_response',
|
|
|
34 |
));
|
35 |
|
36 |
$this->addColumn('yahoo_response', array(
|
37 |
'header' => Mage::helper('showresponse')->__('Yahoo Response'),
|
38 |
'align' =>'left',
|
39 |
'index' => 'yahoo_response',
|
|
|
40 |
));
|
41 |
|
42 |
$this->addColumn('bing_response', array(
|
43 |
'header' => Mage::helper('showresponse')->__('Bing Response'),
|
44 |
'align' =>'left',
|
45 |
'index' => 'bing_response',
|
|
|
46 |
));
|
47 |
|
48 |
$this->addColumn('window_response', array(
|
49 |
'header' => Mage::helper('showresponse')->__('Window Live Response'),
|
50 |
'align' =>'left',
|
51 |
'index' => 'window_response',
|
|
|
52 |
));
|
53 |
|
54 |
$this->addColumn('date', array(
|
31 |
'header' => Mage::helper('showresponse')->__('Google Response'),
|
32 |
'align' =>'left',
|
33 |
'index' => 'google_response',
|
34 |
+
'renderer' => 'showresponse/adminhtml_showresponse_description'
|
35 |
));
|
36 |
|
37 |
$this->addColumn('yahoo_response', array(
|
38 |
'header' => Mage::helper('showresponse')->__('Yahoo Response'),
|
39 |
'align' =>'left',
|
40 |
'index' => 'yahoo_response',
|
41 |
+
'renderer' => 'showresponse/adminhtml_showresponse_description'
|
42 |
));
|
43 |
|
44 |
$this->addColumn('bing_response', array(
|
45 |
'header' => Mage::helper('showresponse')->__('Bing Response'),
|
46 |
'align' =>'left',
|
47 |
'index' => 'bing_response',
|
48 |
+
'renderer' => 'showresponse/adminhtml_showresponse_description'
|
49 |
));
|
50 |
|
51 |
$this->addColumn('window_response', array(
|
52 |
'header' => Mage::helper('showresponse')->__('Window Live Response'),
|
53 |
'align' =>'left',
|
54 |
'index' => 'window_response',
|
55 |
+
'renderer' => 'showresponse/adminhtml_showresponse_description'
|
56 |
));
|
57 |
|
58 |
$this->addColumn('date', array(
|
app/code/{local → community}/Raveinfosys/Showresponse/Helper/Data.php
RENAMED
File without changes
|
app/code/{local → community}/Raveinfosys/Showresponse/Model/Mysql4/Showresponse.php
RENAMED
File without changes
|
app/code/{local → community}/Raveinfosys/Showresponse/Model/Mysql4/Showresponse/Collection.php
RENAMED
File without changes
|
app/code/community/Raveinfosys/Showresponse/Model/Showresponse.php
ADDED
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
class Raveinfosys_Showresponse_Model_Showresponse extends Mage_Core_Model_Abstract
|
4 |
+
{
|
5 |
+
public function _construct()
|
6 |
+
{
|
7 |
+
parent::_construct();
|
8 |
+
$this->_init('showresponse/showresponse');
|
9 |
+
}
|
10 |
+
|
11 |
+
public function getRow()
|
12 |
+
{
|
13 |
+
$collection = $this->getCollection()
|
14 |
+
->setOrder('showresponse_id', 'DESC');
|
15 |
+
$row = $collection->getFirstItem()->getData();
|
16 |
+
return $row;
|
17 |
+
}
|
18 |
+
}
|
app/code/{local → community}/Raveinfosys/Showresponse/controllers/Adminhtml/ShowresponseController.php
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
class Raveinfosys_Showresponse_Adminhtml_ShowresponseController extends
|
4 |
{
|
5 |
|
6 |
protected function _initAction()
|
@@ -13,29 +13,14 @@ class Raveinfosys_Showresponse_Adminhtml_ShowresponseController extends Mage_Adm
|
|
13 |
|
14 |
public function indexAction()
|
15 |
{
|
16 |
-
|
17 |
-
$config = Mage::getModel('showmap/config');
|
18 |
$row = $config->getRow();
|
19 |
if($row['configured'] == 0)$this->_redirect('showmap/adminhtml_showmap/config');
|
20 |
$this->_initAction()
|
21 |
->renderLayout();
|
22 |
}
|
23 |
|
24 |
-
|
25 |
-
{
|
26 |
-
|
27 |
-
$this->_redirect('*/*/');
|
28 |
-
|
29 |
-
}
|
30 |
-
|
31 |
-
public function newAction()
|
32 |
-
{
|
33 |
-
|
34 |
-
$this->_forward('edit');
|
35 |
-
|
36 |
-
}
|
37 |
-
|
38 |
-
|
39 |
public function deleteAction()
|
40 |
{
|
41 |
if( $this->getRequest()->getParam('id') > 0 )
|
@@ -43,7 +28,6 @@ class Raveinfosys_Showresponse_Adminhtml_ShowresponseController extends Mage_Adm
|
|
43 |
try
|
44 |
{
|
45 |
$model = Mage::getModel('showresponse/showresponse');
|
46 |
-
|
47 |
$model->setId($this->getRequest()->getParam('id'))
|
48 |
->delete();
|
49 |
|
@@ -74,13 +58,9 @@ class Raveinfosys_Showresponse_Adminhtml_ShowresponseController extends Mage_Adm
|
|
74 |
$showresponse->delete();
|
75 |
}
|
76 |
Mage::getSingleton('adminhtml/session')->addSuccess(
|
77 |
-
Mage::helper('adminhtml')->__(
|
78 |
-
'Total of %d record(s) were successfully deleted', count($showresponseIds)
|
79 |
-
)
|
80 |
-
);
|
81 |
}
|
82 |
-
catch (Exception $e)
|
83 |
-
{
|
84 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
85 |
}
|
86 |
}
|
1 |
<?php
|
2 |
|
3 |
+
class Raveinfosys_Showresponse_Adminhtml_ShowresponseController extends Mage_Adminhtml_Controller_Action
|
4 |
{
|
5 |
|
6 |
protected function _initAction()
|
13 |
|
14 |
public function indexAction()
|
15 |
{
|
16 |
+
$config = Mage::getModel('showmap/config');
|
|
|
17 |
$row = $config->getRow();
|
18 |
if($row['configured'] == 0)$this->_redirect('showmap/adminhtml_showmap/config');
|
19 |
$this->_initAction()
|
20 |
->renderLayout();
|
21 |
}
|
22 |
|
23 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
public function deleteAction()
|
25 |
{
|
26 |
if( $this->getRequest()->getParam('id') > 0 )
|
28 |
try
|
29 |
{
|
30 |
$model = Mage::getModel('showresponse/showresponse');
|
|
|
31 |
$model->setId($this->getRequest()->getParam('id'))
|
32 |
->delete();
|
33 |
|
58 |
$showresponse->delete();
|
59 |
}
|
60 |
Mage::getSingleton('adminhtml/session')->addSuccess(
|
61 |
+
Mage::helper('adminhtml')->__('Total of %d record(s) were successfully deleted', count($showresponseIds)));
|
|
|
|
|
|
|
62 |
}
|
63 |
+
catch (Exception $e){
|
|
|
64 |
Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
|
65 |
}
|
66 |
}
|
app/code/{local → community}/Raveinfosys/Showresponse/etc/config.xml
RENAMED
File without changes
|
app/code/{local → community}/Raveinfosys/Showresponse/sql/showresponse_setup/mysql4-install-0.1.0.php
RENAMED
@@ -13,8 +13,7 @@ $installer->run("
|
|
13 |
`yahoo_response` text,
|
14 |
`bing_response` text,
|
15 |
`window_response` text,
|
16 |
-
`date` timestamp,
|
17 |
-
`internal_company_id` varchar(80) NOT NULL default '',
|
18 |
PRIMARY KEY (`showresponse_id`)
|
19 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
20 |
");
|
13 |
`yahoo_response` text,
|
14 |
`bing_response` text,
|
15 |
`window_response` text,
|
16 |
+
`date` timestamp,
|
|
|
17 |
PRIMARY KEY (`showresponse_id`)
|
18 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
19 |
");
|
app/code/local/Raveinfosys/Showmap/Block/Adminhtml/Showmap/Grid.php
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Raveinfosys_Showmap_Block_Adminhtml_Showmap_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
4 |
-
{
|
5 |
-
public function __construct()
|
6 |
-
{
|
7 |
-
parent::__construct();
|
8 |
-
$this->setId('showmapGrid');
|
9 |
-
$this->setDefaultSort('showmap_id');
|
10 |
-
$this->setDefaultDir('ASC');
|
11 |
-
$this->setSaveParametersInSession(true);
|
12 |
-
}
|
13 |
-
|
14 |
-
protected function _prepareCollection()
|
15 |
-
{
|
16 |
-
$collection = Mage::getModel('showmap/showmap')->getCollection();
|
17 |
-
$this->setCollection($collection);
|
18 |
-
return parent::_prepareCollection();
|
19 |
-
}
|
20 |
-
|
21 |
-
protected function _prepareColumns()
|
22 |
-
{
|
23 |
-
$this->addColumn('showmap_id', array(
|
24 |
-
'header' => Mage::helper('showmap')->__('ID'),
|
25 |
-
'align' =>'right',
|
26 |
-
'width' => '50px',
|
27 |
-
'index' => 'showmap_id',
|
28 |
-
));
|
29 |
-
|
30 |
-
$this->addColumn('title', array(
|
31 |
-
'header' => Mage::helper('showmap')->__('Title'),
|
32 |
-
'align' =>'left',
|
33 |
-
'index' => 'title',
|
34 |
-
));
|
35 |
-
|
36 |
-
/*
|
37 |
-
$this->addColumn('content', array(
|
38 |
-
'header' => Mage::helper('showmap')->__('Item Content'),
|
39 |
-
'width' => '150px',
|
40 |
-
'index' => 'content',
|
41 |
-
));
|
42 |
-
*/
|
43 |
-
|
44 |
-
$this->addColumn('status', array(
|
45 |
-
'header' => Mage::helper('showmap')->__('Status'),
|
46 |
-
'align' => 'left',
|
47 |
-
'width' => '80px',
|
48 |
-
'index' => 'status',
|
49 |
-
'type' => 'options',
|
50 |
-
'options' => array(
|
51 |
-
1 => 'Enabled',
|
52 |
-
2 => 'Disabled',
|
53 |
-
),
|
54 |
-
));
|
55 |
-
|
56 |
-
$this->addColumn('action',
|
57 |
-
array(
|
58 |
-
'header' => Mage::helper('showmap')->__('Action'),
|
59 |
-
'width' => '100',
|
60 |
-
'type' => 'action',
|
61 |
-
'getter' => 'getId',
|
62 |
-
'actions' => array(
|
63 |
-
array(
|
64 |
-
'caption' => Mage::helper('showmap')->__('Edit'),
|
65 |
-
'url' => array('base'=> '*/*/edit'),
|
66 |
-
'field' => 'id'
|
67 |
-
)
|
68 |
-
),
|
69 |
-
'filter' => false,
|
70 |
-
'sortable' => false,
|
71 |
-
'index' => 'stores',
|
72 |
-
'is_system' => true,
|
73 |
-
));
|
74 |
-
|
75 |
-
$this->addExportType('*/*/exportCsv', Mage::helper('showmap')->__('CSV'));
|
76 |
-
$this->addExportType('*/*/exportXml', Mage::helper('showmap')->__('XML'));
|
77 |
-
|
78 |
-
return parent::_prepareColumns();
|
79 |
-
}
|
80 |
-
|
81 |
-
protected function _prepareMassaction()
|
82 |
-
{
|
83 |
-
$this->setMassactionIdField('showmap_id');
|
84 |
-
$this->getMassactionBlock()->setFormFieldName('showmap');
|
85 |
-
|
86 |
-
$this->getMassactionBlock()->addItem('delete', array(
|
87 |
-
'label' => Mage::helper('showmap')->__('Delete'),
|
88 |
-
'url' => $this->getUrl('*/*/massDelete'),
|
89 |
-
'confirm' => Mage::helper('showmap')->__('Are you sure?')
|
90 |
-
));
|
91 |
-
|
92 |
-
$statuses = Mage::getSingleton('showmap/status')->getOptionArray();
|
93 |
-
|
94 |
-
array_unshift($statuses, array('label'=>'', 'value'=>''));
|
95 |
-
$this->getMassactionBlock()->addItem('status', array(
|
96 |
-
'label'=> Mage::helper('showmap')->__('Change status'),
|
97 |
-
'url' => $this->getUrl('*/*/massStatus', array('_current'=>true)),
|
98 |
-
'additional' => array(
|
99 |
-
'visibility' => array(
|
100 |
-
'name' => 'status',
|
101 |
-
'type' => 'select',
|
102 |
-
'class' => 'required-entry',
|
103 |
-
'label' => Mage::helper('showmap')->__('Status'),
|
104 |
-
'values' => $statuses
|
105 |
-
)
|
106 |
-
)
|
107 |
-
));
|
108 |
-
return $this;
|
109 |
-
}
|
110 |
-
|
111 |
-
public function getRowUrl($row)
|
112 |
-
{
|
113 |
-
return $this->getUrl('*/*/edit', array('id' => $row->getId()));
|
114 |
-
}
|
115 |
-
|
116 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showmap/Block/Showmap.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Raveinfosys_Showmap_Block_Showmap extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
public function _prepareLayout()
|
5 |
-
{
|
6 |
-
return parent::_prepareLayout();
|
7 |
-
}
|
8 |
-
|
9 |
-
public function getShowmap()
|
10 |
-
{
|
11 |
-
if (!$this->hasData('showmap')) {
|
12 |
-
$this->setData('showmap', Mage::registry('showmap'));
|
13 |
-
}
|
14 |
-
return $this->getData('showmap');
|
15 |
-
|
16 |
-
}
|
17 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showmap/Model/Config.php
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Raveinfosys_Showmap_Model_Config extends Mage_Core_Model_Abstract
|
4 |
-
{
|
5 |
-
|
6 |
-
public function _construct()
|
7 |
-
{
|
8 |
-
parent::_construct();
|
9 |
-
$this->_init('showmap/showmap_config');
|
10 |
-
|
11 |
-
}
|
12 |
-
|
13 |
-
public function getRow()
|
14 |
-
{
|
15 |
-
|
16 |
-
$resource = Mage::getSingleton('core/resource');
|
17 |
-
$readconnection = $resource->getConnection('core_read');
|
18 |
-
$tableName = $resource->getTableName('showmap/config');
|
19 |
-
$sql = "select * from $tableName
|
20 |
-
where id=(select max(id) from $tableName)";
|
21 |
-
$row = $readconnection->fetchRow($sql);
|
22 |
-
return $row;
|
23 |
-
}
|
24 |
-
|
25 |
-
public function insertdata($category,$product,$cms,$other)
|
26 |
-
{
|
27 |
-
|
28 |
-
$resource = Mage::getSingleton('core/resource');
|
29 |
-
$writeConnection = $resource->getConnection('core_write');
|
30 |
-
$tableName = $resource->getTableName('showmap/config');
|
31 |
-
$query = "INSERT INTO $tableName ( `category`,`product`,`cms`,`other`,`configured`) VALUES ('$category', '$product','$cms','$other',1)";
|
32 |
-
$writeConnection->query($query);
|
33 |
-
|
34 |
-
}
|
35 |
-
|
36 |
-
|
37 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showmap/Model/Showmap.php
DELETED
@@ -1,163 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Raveinfosys_Showmap_Model_Showmap extends Mage_Core_Model_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('showmap/showmap');
|
9 |
-
|
10 |
-
}
|
11 |
-
|
12 |
-
public function insertdata($ping_interval,$format,$google,$bing,$window,$yahoo,$yahoo_appid)
|
13 |
-
{
|
14 |
-
|
15 |
-
$resource = Mage::getSingleton('core/resource');
|
16 |
-
$writeConnection = $resource->getConnection('core_write');
|
17 |
-
$tableName = $resource->getTableName('showmap/showmap');
|
18 |
-
$query_showmap = "INSERT INTO $tableName ( `ping_interval`,`format`,`google`,`bing`,`window`,`yahoo`,`yahoo_id`) VALUES ($ping_interval,'$format','$google','$bing','$window','$yahoo','$yahoo_appid')";
|
19 |
-
$writeConnection->query($query_showmap);
|
20 |
-
|
21 |
-
}
|
22 |
-
|
23 |
-
public function getRow()
|
24 |
-
{
|
25 |
-
$resource = Mage::getSingleton('core/resource');
|
26 |
-
$readconnection = $resource->getConnection('core_read');
|
27 |
-
$tableName = $resource->getTableName('showmap/showmap');
|
28 |
-
$sql = "select * from $tableName
|
29 |
-
where showmap_id=(select max(showmap_id) from $tableName)";
|
30 |
-
$row = $readconnection->fetchRow($sql);
|
31 |
-
return $row;
|
32 |
-
}
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
public function update()
|
37 |
-
{
|
38 |
-
|
39 |
-
$google_response = 'Not Configured';
|
40 |
-
$yahoo_response = 'Not Configured';
|
41 |
-
$bing_response = 'Not Configured';
|
42 |
-
$window_response = 'Not Configured';
|
43 |
-
$arr_row = $this->getRow();
|
44 |
-
|
45 |
-
$ping_interval = $arr_row['ping_interval'];
|
46 |
-
$format = $arr_row['format'];
|
47 |
-
$google = $arr_row['google'];
|
48 |
-
$yahoo = $arr_row['yahoo'];
|
49 |
-
$bing = $arr_row['bing'];
|
50 |
-
$window = $arr_row['window'];
|
51 |
-
|
52 |
-
|
53 |
-
$base_url = $this->get_url()."sitemap.xml";
|
54 |
-
$isCurl = function_exists(curl_init);
|
55 |
-
if($isCurl)
|
56 |
-
{
|
57 |
-
|
58 |
-
|
59 |
-
if($google=='yes')
|
60 |
-
{
|
61 |
-
|
62 |
-
$url_google = "http://www.google.com/webmasters/tools/ping?sitemap=".$base_url;
|
63 |
-
$string = $this->get_web_page($url_google);
|
64 |
-
$DOM = new DOMDocument;
|
65 |
-
$DOM->loadHTML($string);
|
66 |
-
|
67 |
-
$items = $DOM->getElementsByTagName('body');
|
68 |
-
$array = array();
|
69 |
-
for ($i = 0; $i < $items->length; $i++)
|
70 |
-
$array = $items->item($i)->nodeValue ;
|
71 |
-
$google_response = substr($array,'0',105);
|
72 |
-
|
73 |
-
|
74 |
-
}
|
75 |
-
|
76 |
-
|
77 |
-
if($yahoo=='yes')
|
78 |
-
{
|
79 |
-
|
80 |
-
$url_yahoo = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
|
81 |
-
$yahoo_response = $this->get_web_page($url_yahoo);
|
82 |
-
|
83 |
-
}
|
84 |
-
|
85 |
-
|
86 |
-
if($bing=='yes')
|
87 |
-
{
|
88 |
-
|
89 |
-
$url_bing = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
|
90 |
-
$bing_response = $this->get_web_page($url_bing);
|
91 |
-
|
92 |
-
}
|
93 |
-
|
94 |
-
if($window=='yes')
|
95 |
-
{
|
96 |
-
|
97 |
-
$url_window = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
|
98 |
-
$window_response = $this->get_web_page($url_window);
|
99 |
-
|
100 |
-
}
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
}
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
if($google=='yes' || $yahoo=='yes' || $bing=='yes' )
|
112 |
-
{
|
113 |
-
|
114 |
-
$date = date('Y-m-d h:i:s a', time());
|
115 |
-
$showresponse = Mage::getModel('showresponse/showresponse');
|
116 |
-
$showresponse->insertdata($google_response, $bing_response, $window_response, $yahoo_response, $date);
|
117 |
-
|
118 |
-
}
|
119 |
-
|
120 |
-
|
121 |
-
}
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
function get_web_page( $url )
|
126 |
-
{
|
127 |
-
$options = array(
|
128 |
-
CURLOPT_RETURNTRANSFER => true, // return web page
|
129 |
-
CURLOPT_HEADER => false, // don't return headers
|
130 |
-
CURLOPT_FOLLOWLOCATION => true, // follow redirects
|
131 |
-
CURLOPT_ENCODING => "", // handle all encodings
|
132 |
-
CURLOPT_AUTOREFERER => true, // set referer on redirect
|
133 |
-
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
|
134 |
-
CURLOPT_TIMEOUT => 120, // timeout on response
|
135 |
-
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
|
136 |
-
);
|
137 |
-
|
138 |
-
$ch = curl_init( $url );
|
139 |
-
curl_setopt_array( $ch, $options );
|
140 |
-
$content = curl_exec( $ch );
|
141 |
-
$err = curl_errno( $ch );
|
142 |
-
$errmsg = curl_error( $ch );
|
143 |
-
$header = curl_getinfo( $ch );
|
144 |
-
curl_close( $ch );
|
145 |
-
$header['errno'] = $err;
|
146 |
-
$header['errmsg'] = $errmsg;
|
147 |
-
$header['content'] = $content;
|
148 |
-
return $content;
|
149 |
-
}
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
public function get_url()
|
155 |
-
{
|
156 |
-
$string = Mage::getBaseURL();
|
157 |
-
$string1 = str_replace("index.php/","", $string);
|
158 |
-
$string2 = str_replace('/','%2F',$string1);
|
159 |
-
$string3 = str_replace(':','%3A',$string2);
|
160 |
-
return $string3;
|
161 |
-
|
162 |
-
}
|
163 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showmap/Model/Status.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Raveinfosys_Showmap_Model_Status extends Varien_Object
|
4 |
-
{
|
5 |
-
const STATUS_ENABLED = 1;
|
6 |
-
const STATUS_DISABLED = 2;
|
7 |
-
|
8 |
-
static public function getOptionArray()
|
9 |
-
{
|
10 |
-
return array(
|
11 |
-
self::STATUS_ENABLED => Mage::helper('showmap')->__('Enabled'),
|
12 |
-
self::STATUS_DISABLED => Mage::helper('showmap')->__('Disabled')
|
13 |
-
);
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showmap/controllers/Adminhtml/ShowmapController.php
DELETED
@@ -1,334 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Raveinfosys_Showmap_Adminhtml_ShowmapController extends Mage_Adminhtml_Controller_action
|
4 |
-
{
|
5 |
-
|
6 |
-
public function indexAction()
|
7 |
-
{
|
8 |
-
|
9 |
-
$config = Mage::getModel('showmap/config');
|
10 |
-
$row = $config->getRow();
|
11 |
-
if($row['configured'] == 0)$this->_redirect('*/*/config');
|
12 |
-
$content = file_get_contents('sitemap/sitemap.xml');
|
13 |
-
$content = str_replace('</urlset>','',$content);
|
14 |
-
$content .= '<?xml version="1.0" encoding="utf-8"?><urlset>';
|
15 |
-
$count = 0;
|
16 |
-
if($row['category'] == 'yes')
|
17 |
-
{
|
18 |
-
$cats = Mage::getModel('catalog/category')->load(2)->getChildren();
|
19 |
-
$catIds = explode(',',$cats);
|
20 |
-
Mage::register('catIds', $catIds);
|
21 |
-
foreach($catIds as $catId)
|
22 |
-
{
|
23 |
-
if($catId !='')
|
24 |
-
{
|
25 |
-
$category = Mage::getModel('catalog/category')->load($catId);
|
26 |
-
$subCats = Mage::getModel('catalog/category')->load($category->getId())->getChildren();
|
27 |
-
$subCatIds = explode(',',$subCats);
|
28 |
-
$url=$category->getUrl();
|
29 |
-
if(strpos($content,$url) === false)
|
30 |
-
{
|
31 |
-
$content .= '<url><loc>'.$url.'</loc>';
|
32 |
-
$content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
|
33 |
-
$content .= '<changefreq>daily</changefreq>';
|
34 |
-
$content .= '<priority>0.50</priority>';
|
35 |
-
$content .= '</url>';
|
36 |
-
$count++;
|
37 |
-
}
|
38 |
-
if(count($subCatIds) > 1)
|
39 |
-
{
|
40 |
-
foreach($subCatIds as $subCat)
|
41 |
-
{
|
42 |
-
$subCategory = Mage::getModel('catalog/category')->load($subCat);
|
43 |
-
$url=$subCategory->getUrl();
|
44 |
-
if(strpos($content,$url) === false)
|
45 |
-
{
|
46 |
-
$content .= '<url><loc>'.$url.'</loc>';
|
47 |
-
$content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
|
48 |
-
$content .= '<changefreq>daily</changefreq>';
|
49 |
-
$content .= '<priority>0.50</priority>';
|
50 |
-
$content .= '</url>';
|
51 |
-
$count++;
|
52 |
-
}
|
53 |
-
}
|
54 |
-
}
|
55 |
-
}
|
56 |
-
}
|
57 |
-
}
|
58 |
-
|
59 |
-
if($row['product'] == 'yes')
|
60 |
-
{
|
61 |
-
$product = Mage::getModel('catalog/product');
|
62 |
-
$products = $product->getCollection()->addStoreFilter($storeId)->getData();
|
63 |
-
Mage::register('products', $products);
|
64 |
-
foreach ($products as $pro)
|
65 |
-
{
|
66 |
-
|
67 |
-
$Stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($pro['entity_id'])->getIsinStock();
|
68 |
-
if($Stock)
|
69 |
-
{
|
70 |
-
$_product = $product->load($pro['entity_id']);
|
71 |
-
$url=Mage::getUrl().$_product->getUrlPath();
|
72 |
-
if(strpos($content,$url) === false && $_product->getStatus()!=2)
|
73 |
-
{
|
74 |
-
$content .= '<url><loc>'.$url.'</loc>';
|
75 |
-
$content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
|
76 |
-
$content .= '<changefreq>daily</changefreq>';
|
77 |
-
$content .= '<priority>0.50</priority>';
|
78 |
-
$content .= '</url>';
|
79 |
-
$count++;
|
80 |
-
}
|
81 |
-
}
|
82 |
-
}
|
83 |
-
}
|
84 |
-
|
85 |
-
if($row['cms'] == 'yes')
|
86 |
-
{
|
87 |
-
$collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());
|
88 |
-
$collection->getSelect()
|
89 |
-
->where('is_active = 1');
|
90 |
-
Mage::register('collection', $collection);
|
91 |
-
foreach (Mage::registry('collection') as $page)
|
92 |
-
{
|
93 |
-
$PageData = $page->getData();
|
94 |
-
if($PageData['identifier']!='no-route' && $PageData['identifier']!='enable-cookies')
|
95 |
-
{
|
96 |
-
$url = Mage::getUrl(). $PageData['identifier'];
|
97 |
-
if(strpos($content,$url) === false)
|
98 |
-
{
|
99 |
-
$content .= '<url><loc>'.$url.'</loc>';
|
100 |
-
$content .= '<lastmod>'.date('Y-m-d').'</lastmod>';
|
101 |
-
$content .= '<changefreq>daily</changefreq>';
|
102 |
-
$content .= '<priority>0.50</priority>';
|
103 |
-
$content .= '</url>';
|
104 |
-
$count++;
|
105 |
-
}
|
106 |
-
}
|
107 |
-
}
|
108 |
-
}
|
109 |
-
|
110 |
-
$content .= '</urlset>';
|
111 |
-
$url_dir = Mage::getBaseDir()."/sitemap.xml";
|
112 |
-
$file_handle = fopen($url_dir,'w');
|
113 |
-
fwrite($file_handle,$content);
|
114 |
-
fclose($file_handle);
|
115 |
-
|
116 |
-
$this->_forward('edit');
|
117 |
-
|
118 |
-
}
|
119 |
-
|
120 |
-
public function editAction()
|
121 |
-
{
|
122 |
-
|
123 |
-
|
124 |
-
$this->loadLayout();
|
125 |
-
$this->_setActiveMenu('showmap/items');
|
126 |
-
|
127 |
-
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
128 |
-
|
129 |
-
$this->_addContent($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit'))
|
130 |
-
->_addLeft($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit_tabs'));
|
131 |
-
|
132 |
-
$this->renderLayout();
|
133 |
-
|
134 |
-
}
|
135 |
-
|
136 |
-
|
137 |
-
public function saveAction()
|
138 |
-
{
|
139 |
-
|
140 |
-
|
141 |
-
if ($data = $this->getRequest()->getPost())
|
142 |
-
{
|
143 |
-
$google='no';$yahoo='no';$bing='no';$window='no';
|
144 |
-
$google_response = 'Not Configured';
|
145 |
-
$yahoo_response = 'Not Configured';
|
146 |
-
$bing_response = 'Not Configured';
|
147 |
-
$window_response = 'Not Configured';
|
148 |
-
$ping_interval=$this->getRequest()->getPost('ping_interval');
|
149 |
-
$format=$this->getRequest()->getPost('format');
|
150 |
-
$ch_google=$this->getRequest()->getPost('google');
|
151 |
-
$ch_bing=$this->getRequest()->getPost('bing');
|
152 |
-
$ch_window=$this->getRequest()->getPost('window');
|
153 |
-
$ch_yahoo=$this->getRequest()->getPost('yahoo');
|
154 |
-
$yahoo_appid=$this->getRequest()->getPost('yahoo_appid');
|
155 |
-
$base_url = $this->get_url()."sitemap.xml";
|
156 |
-
$isCurl = function_exists(curl_init);
|
157 |
-
if($isCurl)
|
158 |
-
{
|
159 |
-
|
160 |
-
if($ch_google=='google')
|
161 |
-
{
|
162 |
-
$google='yes';
|
163 |
-
$url_google = "http://www.google.com/webmasters/tools/ping?sitemap=".$base_url;
|
164 |
-
$string = $this->get_web_page($url_google);
|
165 |
-
$DOM = new DOMDocument;
|
166 |
-
$DOM->loadHTML($string);
|
167 |
-
|
168 |
-
$items = $DOM->getElementsByTagName('body');
|
169 |
-
$array = array();
|
170 |
-
for ($i = 0; $i < $items->length; $i++)
|
171 |
-
$array = $items->item($i)->nodeValue ;
|
172 |
-
$google_response = substr($array,'0',105);
|
173 |
-
|
174 |
-
|
175 |
-
}
|
176 |
-
|
177 |
-
|
178 |
-
if($ch_yahoo=='yahoo' && $yahoo_appid!='')
|
179 |
-
{
|
180 |
-
$yahoo='yes';
|
181 |
-
$url_yahoo = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
|
182 |
-
$yahoo_response = $this->get_web_page($url_yahoo);
|
183 |
-
|
184 |
-
}
|
185 |
-
|
186 |
-
|
187 |
-
if($ch_bing=='bing')
|
188 |
-
{
|
189 |
-
$bing='yes';
|
190 |
-
$url_bing = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
|
191 |
-
$bing_response = $this->get_web_page($url_bing);
|
192 |
-
|
193 |
-
|
194 |
-
}
|
195 |
-
|
196 |
-
|
197 |
-
if($ch_window=='window')
|
198 |
-
{
|
199 |
-
$window='yes';
|
200 |
-
$url_window = "http://www.bing.com/webmaster/ping.aspx?siteMap=".$base_url;
|
201 |
-
$window_response = $this->get_web_page($url_window);
|
202 |
-
|
203 |
-
}
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
}
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
if($google=='yes' || $yahoo=='yes' || $bing=='yes' || $window=='yes')
|
212 |
-
{
|
213 |
-
$date = date('Y-m-d h:i:s a', time());
|
214 |
-
$showmap = Mage::getModel('showmap/showmap');
|
215 |
-
$showmap->insertdata($ping_interval,$format,$google,$bing,$window,$yahoo,$yahoo_appid);
|
216 |
-
$this->xml();
|
217 |
-
|
218 |
-
$showresponse = Mage::getModel('showresponse/showresponse');
|
219 |
-
$showresponse->insertdata($google_response, $bing_response, $window_response, $yahoo_response, $date);
|
220 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('showmap')->__('sitemap was successfully submitted'));
|
221 |
-
if($ch_yahoo=='yahoo' && $yahoo_appid=='' )
|
222 |
-
{
|
223 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('showmap')->__('Please enter yahoo app id for submitting on yahoo'));
|
224 |
-
}
|
225 |
-
}
|
226 |
-
else
|
227 |
-
if($ch_yahoo=='yahoo')
|
228 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('showmap')->__('Please enter yahoo app id'));
|
229 |
-
else
|
230 |
-
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('showmap')->__('Please choose at least 1 channel'));
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
}
|
236 |
-
$this->_redirect('*/*/');
|
237 |
-
}
|
238 |
-
|
239 |
-
|
240 |
-
public function configAction()
|
241 |
-
{
|
242 |
-
|
243 |
-
$this->loadLayout();
|
244 |
-
$this->_setActiveMenu('showmap/items');
|
245 |
-
|
246 |
-
$this->getLayout()->getBlock('head')->setCanLoadExtJs(true);
|
247 |
-
|
248 |
-
$this->_addContent($this->getLayout()->createBlock('showmap/adminhtml_showmap_config'))
|
249 |
-
->_addLeft($this->getLayout()->createBlock('showmap/adminhtml_showmap_edit_config'));
|
250 |
-
|
251 |
-
|
252 |
-
if ($data = $this->getRequest()->getPost())
|
253 |
-
{
|
254 |
-
|
255 |
-
//$store = $this->getRequest()->getPost('store');
|
256 |
-
$category = $this->getRequest()->getPost('category');
|
257 |
-
$product = $this->getRequest()->getPost('product');
|
258 |
-
$cms = $this->getRequest()->getPost('cms');
|
259 |
-
$other = $this->getRequest()->getPost('other');
|
260 |
-
$config = Mage::getModel('showmap/config');
|
261 |
-
$config->insertdata($category,$product,$cms,$other);
|
262 |
-
Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('showmap')->__('Sitemap was successfully configured'));
|
263 |
-
$this->_redirect('*/*/config');
|
264 |
-
|
265 |
-
}
|
266 |
-
|
267 |
-
$this->renderLayout();
|
268 |
-
|
269 |
-
}
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
function get_web_page( $url )
|
274 |
-
{
|
275 |
-
$options = array(
|
276 |
-
CURLOPT_RETURNTRANSFER => true, // return web page
|
277 |
-
CURLOPT_HEADER => false, // don't return headers
|
278 |
-
CURLOPT_FOLLOWLOCATION => true, // follow redirects
|
279 |
-
CURLOPT_ENCODING => "", // handle all encodings
|
280 |
-
CURLOPT_AUTOREFERER => true, // set referer on redirect
|
281 |
-
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
|
282 |
-
CURLOPT_TIMEOUT => 120, // timeout on response
|
283 |
-
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
|
284 |
-
);
|
285 |
-
|
286 |
-
$ch = curl_init( $url );
|
287 |
-
curl_setopt_array( $ch, $options );
|
288 |
-
$content = curl_exec( $ch );
|
289 |
-
$err = curl_errno( $ch );
|
290 |
-
$errmsg = curl_error( $ch );
|
291 |
-
$header = curl_getinfo( $ch );
|
292 |
-
curl_close( $ch );
|
293 |
-
$header['errno'] = $err;
|
294 |
-
$header['errmsg'] = $errmsg;
|
295 |
-
$header['content'] = $content;
|
296 |
-
return $content;
|
297 |
-
}
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
public function get_url()
|
302 |
-
{
|
303 |
-
$string = Mage::getBaseURL();
|
304 |
-
$string1 = str_replace("index.php/","", $string);
|
305 |
-
$string2 = str_replace('/','%2F',$string1);
|
306 |
-
$string3 = str_replace(':','%3A',$string2);
|
307 |
-
return $string3;
|
308 |
-
|
309 |
-
}
|
310 |
-
|
311 |
-
|
312 |
-
public function xml()
|
313 |
-
{
|
314 |
-
|
315 |
-
$obj = Mage::getModel('showmap/showmap');
|
316 |
-
$showmap = $obj->getRow();
|
317 |
-
if($showmap['format'] == 'days')
|
318 |
-
{
|
319 |
-
$ping_interval = $showmap['ping_interval'];
|
320 |
-
$cron = '0 0 */'.$ping_interval.' * *';
|
321 |
-
}
|
322 |
-
if($showmap['format'] == 'hours')
|
323 |
-
{
|
324 |
-
$ping_interval = $showmap['ping_interval'];
|
325 |
-
$cron = '0 */'.$ping_interval.' * * *';
|
326 |
-
}
|
327 |
-
$url = Mage::getBaseDir()."/app/code/local/Raveinfosys/Showmap/etc/config.xml";
|
328 |
-
$endreXML = simplexml_load_file($url);
|
329 |
-
$endreXML->crontab[0]->jobs[0]->Raveinfosys_Showmap[0]->schedule[0]->cron_expr = $cron;
|
330 |
-
file_put_contents($url, $endreXML->asXML());
|
331 |
-
|
332 |
-
}
|
333 |
-
|
334 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showmap/controllers/IndexController.php
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Raveinfosys_Showmap_IndexController extends Mage_Core_Controller_Front_Action
|
3 |
-
{
|
4 |
-
public function indexAction()
|
5 |
-
{
|
6 |
-
|
7 |
-
$this->loadLayout();
|
8 |
-
|
9 |
-
$cats = Mage::getModel('catalog/category')->load(2)->getChildren();
|
10 |
-
$catIds = explode(',',$cats);
|
11 |
-
Mage::register('catIds', $catIds);
|
12 |
-
|
13 |
-
$product = Mage::getModel('catalog/product');
|
14 |
-
$products = $product->getCollection()->addStoreFilter($storeId)->getData();
|
15 |
-
Mage::register('products', $products);
|
16 |
-
|
17 |
-
$collection = Mage::getModel('cms/page')->getCollection()->addStoreFilter(Mage::app()->getStore()->getId());
|
18 |
-
$collection->getSelect()
|
19 |
-
->where('is_active = 1');
|
20 |
-
Mage::register('collection', $collection);
|
21 |
-
|
22 |
-
$this->renderLayout();
|
23 |
-
|
24 |
-
}
|
25 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showresponse/Block/Showresponse.php
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
class Raveinfosys_Showresponse_Block_Showresponse extends Mage_Core_Block_Template
|
3 |
-
{
|
4 |
-
public function _prepareLayout()
|
5 |
-
{
|
6 |
-
return parent::_prepareLayout();
|
7 |
-
}
|
8 |
-
|
9 |
-
public function getShowresponse()
|
10 |
-
{
|
11 |
-
if (!$this->hasData('showresponse')) {
|
12 |
-
$this->setData('showresponse', Mage::registry('showresponse'));
|
13 |
-
}
|
14 |
-
return $this->getData('showresponse');
|
15 |
-
|
16 |
-
}
|
17 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showresponse/Model/Showresponse.php
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Raveinfosys_Showresponse_Model_Showresponse extends Mage_Core_Model_Abstract
|
4 |
-
{
|
5 |
-
public function _construct()
|
6 |
-
{
|
7 |
-
parent::_construct();
|
8 |
-
$this->_init('showresponse/showresponse');
|
9 |
-
}
|
10 |
-
|
11 |
-
public function insertdata($google_response, $bing_response, $window_response, $yahoo_response, $date)
|
12 |
-
{
|
13 |
-
|
14 |
-
$resource = Mage::getSingleton('core/resource');
|
15 |
-
$writeConnection = $resource->getConnection('core_write');
|
16 |
-
$tableName = $resource->getTableName('showresponse/showresponse');
|
17 |
-
$query_showmap_response = "INSERT INTO $tableName (`google_response`,`bing_response` ,`window_response`, `yahoo_response`,`date`) VALUES ('$google_response', '$bing_response', '$window_response', '$yahoo_response', '$date')";
|
18 |
-
|
19 |
-
$writeConnection->query($query_showmap_response);
|
20 |
-
|
21 |
-
}
|
22 |
-
|
23 |
-
public function getRow()
|
24 |
-
{
|
25 |
-
|
26 |
-
$resource = Mage::getSingleton('core/resource');
|
27 |
-
$readconnection = $resource->getConnection('core_read');
|
28 |
-
$tableName = $resource->getTableName('showmap/showmap');
|
29 |
-
$sql = "select * from $tableName
|
30 |
-
where id=(select max(id) from $tableName)";
|
31 |
-
$row = $readconnection->fetchRow($sql);
|
32 |
-
return $row;
|
33 |
-
|
34 |
-
}
|
35 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/local/Raveinfosys/Showresponse/Model/Status.php
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
class Raveinfosys_Showresponse_Model_Status extends Varien_Object
|
4 |
-
{
|
5 |
-
const STATUS_ENABLED = 1;
|
6 |
-
const STATUS_DISABLED = 2;
|
7 |
-
|
8 |
-
static public function getOptionArray()
|
9 |
-
{
|
10 |
-
return array(
|
11 |
-
self::STATUS_ENABLED => Mage::helper('showresponse')->__('Enabled'),
|
12 |
-
self::STATUS_DISABLED => Mage::helper('showresponse')->__('Disabled')
|
13 |
-
);
|
14 |
-
}
|
15 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/design/frontend/{default → base}/default/layout/showmap.xml
RENAMED
File without changes
|
app/design/frontend/{default → base}/default/template/showmap/showmap.phtml
RENAMED
@@ -1,9 +1,7 @@
|
|
|
|
|
|
1 |
<h4><?php echo $this->__('Sitemap') ?></h4>
|
2 |
|
3 |
-
<?php
|
4 |
-
$config = Mage::getModel('showmap/config');
|
5 |
-
$row = $config->getRow();
|
6 |
-
?>
|
7 |
<?php if($row['category'] == 'yes') {?>
|
8 |
<div class="block block-reviews">
|
9 |
<div class="block-title">
|
@@ -11,7 +9,7 @@ $row = $config->getRow();
|
|
11 |
</div>
|
12 |
<div class="block-content">
|
13 |
<ul>
|
14 |
-
<?php foreach(
|
15 |
<li>
|
16 |
<?php $category = Mage::getModel('catalog/category')->load($catId);?>
|
17 |
<a href="<?php echo $category->getUrl();?>" style="font:bold;font-size:13px;"><?php echo $category->getName();?></a>
|
@@ -47,7 +45,7 @@ $row = $config->getRow();
|
|
47 |
<div class="block-content"><ul>
|
48 |
<?php $storeId = Mage::app()->getStore()->getId();
|
49 |
$product = Mage::getModel('catalog/product');
|
50 |
-
foreach (
|
51 |
{
|
52 |
$Stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($pro['entity_id'])->getIsinStock();
|
53 |
if($Stock)
|
@@ -63,17 +61,13 @@ $row = $config->getRow();
|
|
63 |
|
64 |
<?php }?>
|
65 |
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
<?php if($row['cms'] == 'yes') {?>
|
71 |
<div class="block block-reviews">
|
72 |
<div class="block-title">
|
73 |
<strong><span>CMS</span></strong>
|
74 |
</div>
|
75 |
<ul>
|
76 |
-
<?php foreach (
|
77 |
<?php $PageData = $page->getData(); ?>
|
78 |
<?php if($PageData['identifier']!='no-route' && $PageData['identifier']!='enable-cookies') { ?>
|
79 |
<li>
|
@@ -85,8 +79,6 @@ $row = $config->getRow();
|
|
85 |
<?php }?>
|
86 |
|
87 |
|
88 |
-
|
89 |
-
|
90 |
<?php if($row['other'] == 'yes') {?>
|
91 |
<div class="block block-reviews">
|
92 |
<div class="block-title">
|
1 |
+
<?php $row = $this->getShowmap();?>
|
2 |
+
|
3 |
<h4><?php echo $this->__('Sitemap') ?></h4>
|
4 |
|
|
|
|
|
|
|
|
|
5 |
<?php if($row['category'] == 'yes') {?>
|
6 |
<div class="block block-reviews">
|
7 |
<div class="block-title">
|
9 |
</div>
|
10 |
<div class="block-content">
|
11 |
<ul>
|
12 |
+
<?php foreach($this->getData('catIds') as $catId): ?>
|
13 |
<li>
|
14 |
<?php $category = Mage::getModel('catalog/category')->load($catId);?>
|
15 |
<a href="<?php echo $category->getUrl();?>" style="font:bold;font-size:13px;"><?php echo $category->getName();?></a>
|
45 |
<div class="block-content"><ul>
|
46 |
<?php $storeId = Mage::app()->getStore()->getId();
|
47 |
$product = Mage::getModel('catalog/product');
|
48 |
+
foreach ($this->getData('products') as $pro) //loop for getting products
|
49 |
{
|
50 |
$Stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($pro['entity_id'])->getIsinStock();
|
51 |
if($Stock)
|
61 |
|
62 |
<?php }?>
|
63 |
|
|
|
|
|
|
|
|
|
64 |
<?php if($row['cms'] == 'yes') {?>
|
65 |
<div class="block block-reviews">
|
66 |
<div class="block-title">
|
67 |
<strong><span>CMS</span></strong>
|
68 |
</div>
|
69 |
<ul>
|
70 |
+
<?php foreach ($this->getData('collection') as $page): ?>
|
71 |
<?php $PageData = $page->getData(); ?>
|
72 |
<?php if($PageData['identifier']!='no-route' && $PageData['identifier']!='enable-cookies') { ?>
|
73 |
<li>
|
79 |
<?php }?>
|
80 |
|
81 |
|
|
|
|
|
82 |
<?php if($row['other'] == 'yes') {?>
|
83 |
<div class="block block-reviews">
|
84 |
<div class="block-title">
|
app/etc/modules/Raveinfosys_Showmap.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<modules>
|
4 |
<Raveinfosys_Showmap>
|
5 |
<active>true</active>
|
6 |
-
<codePool>
|
7 |
</Raveinfosys_Showmap>
|
8 |
</modules>
|
9 |
</config>
|
3 |
<modules>
|
4 |
<Raveinfosys_Showmap>
|
5 |
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
</Raveinfosys_Showmap>
|
8 |
</modules>
|
9 |
</config>
|
app/etc/modules/Raveinfosys_Showresponse.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<modules>
|
4 |
<Raveinfosys_Showresponse>
|
5 |
<active>true</active>
|
6 |
-
<codePool>
|
7 |
</Raveinfosys_Showresponse>
|
8 |
</modules>
|
9 |
</config>
|
3 |
<modules>
|
4 |
<Raveinfosys_Showresponse>
|
5 |
<active>true</active>
|
6 |
+
<codePool>community</codePool>
|
7 |
</Raveinfosys_Showresponse>
|
8 |
</modules>
|
9 |
</config>
|
package.xml
CHANGED
@@ -1,19 +1,19 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Raveinfosys_sitemap</name>
|
4 |
-
<version>1.0.
|
5 |
<stability>stable</stability>
|
6 |
-
<license
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>The Raveinfosys Sitemap Extension generate the sitemap xml file and submit the created xml file on different channel.</summary>
|
10 |
<description>The Raveinfosys Sitemap Extension generate the sitemap xml file and submit the created xml file on different channel e.g. Google,Yahoo,Bing and Window Live.</description>
|
11 |
-
<notes>This is stable version of this extension and has been tested on various version of community editions.
|
12 |
In this particular version we are supporting it to run on PHP V 5.4.X</notes>
|
13 |
-
<authors><author><name>Rave Infosys</name><user>raveinfo</user><email>lpext@raveinfosys.com</email></author
|
14 |
-
<date>
|
15 |
-
<time>
|
16 |
-
<contents><target name="
|
17 |
<compatible/>
|
18 |
-
<dependencies><required><php><min>5.2.0</min><max>5.4.
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>Raveinfosys_sitemap</name>
|
4 |
+
<version>1.0.3</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license>OSL v3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>The Raveinfosys Sitemap Extension generate the sitemap xml file and submit the created xml file on different channel.</summary>
|
10 |
<description>The Raveinfosys Sitemap Extension generate the sitemap xml file and submit the created xml file on different channel e.g. Google,Yahoo,Bing and Window Live.</description>
|
11 |
+
<notes>This is stable version of this extension and has been tested on various version of community editions. &#xD;
|
12 |
In this particular version we are supporting it to run on PHP V 5.4.X</notes>
|
13 |
+
<authors><author><name>Rave Infosys</name><user>raveinfo</user><email>lpext@raveinfosys.com</email></author></authors>
|
14 |
+
<date>2014-04-17</date>
|
15 |
+
<time>08:33:19</time>
|
16 |
+
<contents><target name="magecommunity"><dir name="Raveinfosys"><dir name="Showmap"><dir name="Block"><dir name="Adminhtml"><dir name="Showmap"><dir name="Edit"><file name="Config.php" hash="5848ce1009d583ae291136c9e870d40a"/><file name="Form.php" hash="fdb5180a209343c38065d5c065ee8ab8"/><dir name="Tab"><file name="Config.php" hash="59d9243c620cd996790074e3251a21b5"/><file name="Form.php" hash="5d7fdd9a8ebde47cfb68f62c2e2bddc7"/></dir><file name="Tabs.php" hash="6ad8f280da7ef0e2499f860f8e1411c0"/></dir><file name="Edit.php" hash="41db00d7b5c348b873b5f8dd3afa3d1f"/></dir><file name="Showmap.php" hash="f607b56084d16443341e6d23a17e9e08"/></dir><file name="Showmap.php" hash="da46c18f2e1b64b1611da74d6e41cab2"/></dir><dir name="Helper"><file name="Data.php" hash="613c2b028f0fbf350044ffc58522923a"/></dir><dir name="Model"><file name="Config.php" hash="8cfdfecda476dd8ddaacf074fed177f3"/><dir name="Mysql4"><dir name="Config"><file name="Collection.php" hash="cd37998be1d5889d84cf70b0ba42ae08"/></dir><file name="Config.php" hash="7c04d5259441e245f9abce7ef13a12a7"/><dir name="Showmap"><file name="Collection.php" hash="306a934b96d01954787c66e0811deb98"/></dir><file name="Showmap.php" hash="2555336901b5215c23a7ffa63e8eb664"/></dir><file name="Showmap.php" hash="3d4950aa731490297425f301c1fa2977"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShowmapController.php" hash="fec04a2ea3eefc02bd66ac5c5c898531"/></dir><file name="IndexController.php" hash="8186ecce469a0ab704e62fcb2b717d98"/></dir><dir name="etc"><file name="config.xml" hash="d9fac1f949f1cef0b94bc43091e5e06b"/></dir><dir name="sql"><dir name="showmap_setup"><file name="mysql4-install-0.1.0.php" hash="8d3163eab10f2efdd8cb9bcf367396c1"/></dir></dir></dir><dir name="Showresponse"><dir name="Block"><dir name="Adminhtml"><dir name="Showresponse"><file name="Description.php" hash="24f6da89d678660dad11ac0452647ae5"/><file name="Grid.php" hash="9ca870bd130d8c7c6fd4ee2e5e45443b"/></dir><file name="Showresponse.php" hash="87ed0a31933d7c138d368f9c8f22897b"/></dir></dir><dir name="Helper"><file name="Data.php" hash="bb901d91823996ca1394a17fb8c37626"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Showresponse"><file name="Collection.php" hash="48661fd41f6e68c6c2b98341cda9bd99"/></dir><file name="Showresponse.php" hash="509aa9d1d29696fc09e7b3d0d71aee30"/></dir><file name="Showresponse.php" hash="bcbb719fae3d2103f70f7ced81a66b2f"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="ShowresponseController.php" hash="f64005b07b22521d7ba95905c0c8d5ef"/></dir></dir><dir name="etc"><file name="config.xml" hash="acceb3c67515280cfcb653667a884daa"/></dir><dir name="sql"><dir name="showresponse_setup"><file name="mysql4-install-0.1.0.php" hash="343762b915e8ec087e61942cc5fc725f"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Raveinfosys_Showresponse.xml" hash="49aa5e11fa483202f16541bf703d29c9"/><file name="Raveinfosys_Showmap.xml" hash="ce57a53875aff4c2c2921c01372ce6eb"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="showresponse.xml" hash="8590cf727e2fa8f2109305c06cfc0cbf"/><file name="showmap.xml" hash="c1ebb47555f3b60cad22e1b2f2d20780"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="showmap.xml" hash="2dc0228bfe8979923bd4fd482231ecb2"/></dir><dir name="template"><dir name="showmap"><file name="showmap.phtml" hash="c19e0a702703a150ee02ae01507b10ab"/></dir></dir></dir></dir></dir></target></contents>
|
17 |
<compatible/>
|
18 |
+
<dependencies><required><php><min>5.2.0</min><max>5.4.27</max></php><extension><name>curl</name><min>7.21.4</min><max>7.36.0</max></extension><extension><name>SimpleXML</name><min></min><max></max></extension></required></dependencies>
|
19 |
</package>
|