Version Notes
Changed getRequestString() to getRequestUri() to capture query strings.
Download this release
Release Info
| Developer | Arron Moss |
| Extension | Zero1_Seoredirects |
| Version | 1.0.6 |
| Comparing to | |
| See all releases | |
Code changes from version 1.0.1 to 1.0.6
- app/code/community/Zero1/Seoredirects/Block/Manage.php +21 -26
- app/code/community/Zero1/Seoredirects/Block/Manage/Grid.php +61 -47
- app/code/community/Zero1/Seoredirects/Helper/Data.php +5 -13
- app/code/community/Zero1/Seoredirects/Helper/License.php +73 -60
- app/code/community/Zero1/Seoredirects/Model/Mysql4/Redirection.php +8 -16
- app/code/community/Zero1/Seoredirects/Model/Mysql4/Redirection/Collection.php +8 -16
- app/code/community/Zero1/Seoredirects/Model/Mysql4/Setup.php +5 -13
- app/code/community/Zero1/Seoredirects/Model/Observer.php +179 -126
- app/code/community/Zero1/Seoredirects/Model/Redirection.php +8 -15
- app/code/community/Zero1/Seoredirects/controllers/Adminhtml/Seoredirects/ManageController.php +64 -68
- app/code/community/Zero1/Seoredirects/etc/config.xml +2 -2
- app/code/community/Zero1/Seoredirects/etc/system.xml +6 -6
- app/code/community/Zero1/Seoredirects/sql/seoredirects_setup/mysql4-install-1.0.0.php +19 -19
- app/code/community/Zero1/Seoredirects/sql/seoredirects_setup/mysql4-install-1.0.1.php +19 -19
- package.xml +6 -6
app/code/community/Zero1/Seoredirects/Block/Manage.php
CHANGED
|
@@ -1,26 +1,21 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
1GunxnkjEHlTUoZqRxhLbgKw6qoSgmeNt83fGVvHvz52RYAJnbQqFIcGeWojSktjUgbr5c5icUko
|
| 23 |
-
9yKhxuDawFmiXNz6T/1pRWoTkfD1T4fQUEpZ6ObyPtMrKgY9E935h+if0XhLZJ7bHlWT9O/7cKr7
|
| 24 |
-
Zwqb9NOCiAFjrKyNzWN02CaTE64jFxiuyo6II37yEzYVANk1iyfcejAwPEZaRTTZSQzATVcrYfR0
|
| 25 |
-
DabIm26wl6t62mSHKqbGujRYEZuR1bRi2txff8G+fs0kA0vnV1lCJPSf09Rnel04sdP+DIC1ZwiA
|
| 26 |
-
/cel
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Block_Manage extends Mage_Adminhtml_Block_Widget_Grid_Container
|
| 3 |
+
{
|
| 4 |
+
protected $_controller = 'seoredirects';
|
| 5 |
+
|
| 6 |
+
public function __construct()
|
| 7 |
+
{
|
| 8 |
+
$this->_controller = 'manage';
|
| 9 |
+
$this->_blockGroup = 'seoredirects';
|
| 10 |
+
|
| 11 |
+
$this->_headerText = Mage::helper('seoredirects')->__('SEO Redirection Management');
|
| 12 |
+
$this->_addButton('refresh', array(
|
| 13 |
+
'label' => $this->__('Refresh from Google'),
|
| 14 |
+
'onclick' => "setLocation('{$this->getUrl('*/*/update')}')",
|
| 15 |
+
'class' => 'refresh'
|
| 16 |
+
));
|
| 17 |
+
|
| 18 |
+
parent::__construct();
|
| 19 |
+
$this->_removeButton('add');
|
| 20 |
+
}
|
| 21 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Zero1/Seoredirects/Block/Manage/Grid.php
CHANGED
|
@@ -1,47 +1,61 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Block_Manage_Grid extends Mage_Adminhtml_Block_Widget_Grid
|
| 3 |
+
{
|
| 4 |
+
public function __construct()
|
| 5 |
+
{
|
| 6 |
+
parent::__construct();
|
| 7 |
+
$this->setId('manageGrid');
|
| 8 |
+
$this->setDefaultSort('entity_id');
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
protected function _getStore()
|
| 12 |
+
{
|
| 13 |
+
$storeId = (int)$this->getRequest()->getParam('store', 0);
|
| 14 |
+
return Mage::app()->getStore($storeId);
|
| 15 |
+
}
|
| 16 |
+
|
| 17 |
+
protected function _prepareCollection()
|
| 18 |
+
{
|
| 19 |
+
$store = $this->_getStore();
|
| 20 |
+
|
| 21 |
+
$collection = Mage::getModel('seoredirects/redirection')->getCollection();
|
| 22 |
+
|
| 23 |
+
if($store->getId())
|
| 24 |
+
{
|
| 25 |
+
$collection->addFieldToFilter('store', $store->getId());
|
| 26 |
+
}
|
| 27 |
+
|
| 28 |
+
$this->setCollection($collection);
|
| 29 |
+
|
| 30 |
+
return parent::_prepareCollection();
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
protected function _prepareColumns()
|
| 34 |
+
{
|
| 35 |
+
$this->addColumn('entity_id', array(
|
| 36 |
+
'header' => Mage::helper('catalog')->__('ID'),
|
| 37 |
+
'sortable' => true,
|
| 38 |
+
'width' => '60',
|
| 39 |
+
'index' => 'entity_id'
|
| 40 |
+
));
|
| 41 |
+
|
| 42 |
+
$this->addColumn('redirect_from', array(
|
| 43 |
+
'header' => Mage::helper('catalog')->__('From'),
|
| 44 |
+
'index' => 'redirect_from'
|
| 45 |
+
));
|
| 46 |
+
|
| 47 |
+
$this->addColumn('redirect_to', array(
|
| 48 |
+
'header' => Mage::helper('catalog')->__('To'),
|
| 49 |
+
'index' => 'redirect_to'
|
| 50 |
+
));
|
| 51 |
+
|
| 52 |
+
$this->addColumn('store', array(
|
| 53 |
+
'header' => Mage::helper('newsletter')->__('Store'),
|
| 54 |
+
'index' => 'store',
|
| 55 |
+
'type' => 'options',
|
| 56 |
+
'options' => Mage::getModel('adminhtml/system_store')->getStoreOptionHash()
|
| 57 |
+
));
|
| 58 |
+
|
| 59 |
+
return parent::_prepareColumns();
|
| 60 |
+
}
|
| 61 |
+
}
|
app/code/community/Zero1/Seoredirects/Helper/Data.php
CHANGED
|
@@ -1,13 +1,5 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
EW67Te12kWT60T77Y3PUlW5oY5hTikA3bXhh8ojVwnyva+P8q+57ojN6mUq5HRSDnVYTP81ozyvw
|
| 7 |
-
8via9E4MMBEpgkq8HS8RHaaV9BufPFTDqSfpm1WpgHzX1+cQ/EQ9gZdEteunZ6Lc/zGxtk2kM02m
|
| 8 |
-
buEOG4mBbm1UJbT6BaZqUTwDjNcT++rJztQq55aI8stPoUCfvpF0m8GF89umtnUI1St5vv5jT3FE
|
| 9 |
-
c0juzN/oBUYGgXWqhjBhRCVGu8ptYcx0+dKIG2yGUBEkXAbM+lxqiiMmch0b4A6ORcrtx9Ve6yOR
|
| 10 |
-
J13LNROIGQI+I12RcdEXDisRnIdfEnsILDWUPbm0iXwfKFtmmepcLPT/tW8mHecu7bF8LXnKR4rK
|
| 11 |
-
HJVh1hpUzWEXXBbUeUD+8CpZvtBQiqEm91/j+LhZEtyjbBD/SvMvRUuxHWQZmAhNI7J5i/fb4jMw
|
| 12 |
-
ZB9BGE0RNfm2ymnOk5aPzmIlJWe12uep6HuSzsQV90/cs5Pc8SLBOovsyj6ZE2sLBnoZii9yVY2x
|
| 13 |
-
APCtJ0==
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Helper_Data extends Mage_Core_Helper_Abstract
|
| 3 |
+
{
|
| 4 |
+
|
| 5 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Zero1/Seoredirects/Helper/License.php
CHANGED
|
@@ -1,60 +1,73 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Helper_License extends Mage_Core_Helper_Abstract
|
| 3 |
+
{
|
| 4 |
+
private $_license_required_for_community = true;
|
| 5 |
+
private $_license_required_for_enterprise = true;
|
| 6 |
+
|
| 7 |
+
public function isEnterprise()
|
| 8 |
+
{
|
| 9 |
+
if(method_exists('Mage', 'getEdition'))
|
| 10 |
+
{
|
| 11 |
+
// Mage::getEdition() exists so it is EE 1.12+ or CE 1.7+
|
| 12 |
+
if(Mage::getEdition() == Mage::EDITION_ENTERPRISE)
|
| 13 |
+
return true;
|
| 14 |
+
} else {
|
| 15 |
+
// Fallback on the old version number lookup
|
| 16 |
+
$version = Mage::getVersionInfo();
|
| 17 |
+
|
| 18 |
+
if($version['major'] == 1 && $version['minor'] >= 7)
|
| 19 |
+
return true;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
return false;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
public function isValid($store = null)
|
| 26 |
+
{
|
| 27 |
+
$data = $this->getData($store);
|
| 28 |
+
|
| 29 |
+
if($this->isEnterprise())
|
| 30 |
+
{
|
| 31 |
+
if($this->_license_required_for_enterprise && !isset($data['enterprise']))
|
| 32 |
+
return false;
|
| 33 |
+
} else {
|
| 34 |
+
if($this->_license_required_for_community && !isset($data['community']))
|
| 35 |
+
return false;
|
| 36 |
+
}
|
| 37 |
+
|
| 38 |
+
return true;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
public function getData($store = null)
|
| 42 |
+
{
|
| 43 |
+
$store = ($store === null) ? Mage::app()->getStore() : $store;
|
| 44 |
+
|
| 45 |
+
$data = array();
|
| 46 |
+
$module_name = preg_replace('/^Zero1_([^_]*)_Helper_License$/si', '$1', get_class($this));
|
| 47 |
+
$module_name = strtolower($module_name);
|
| 48 |
+
$serial = base64_decode($store->getConfig($module_name.'/settings/serial'));
|
| 49 |
+
$url = $store->getConfig('web/unsecure/base_url');
|
| 50 |
+
|
| 51 |
+
if(!empty($url) && !empty($serial))
|
| 52 |
+
{
|
| 53 |
+
$hash = hash('sha256', '$4$W8DgMGQZ$Twn84iicE6FQo7wCrxnL4Aow5/w$'.$module_name.$url, true);
|
| 54 |
+
$iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_ECB);
|
| 55 |
+
$iv = mcrypt_create_iv($iv_size, MCRYPT_RAND);
|
| 56 |
+
$data = @unserialize(mcrypt_decrypt(MCRYPT_BLOWFISH, $hash, $serial, MCRYPT_MODE_ECB, $iv));
|
| 57 |
+
$data = (!is_array($data)) ? array() : $data;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
return $data;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
public function getRequestURL($store = null)
|
| 64 |
+
{
|
| 65 |
+
$store = ($store === null) ? Mage::app()->getStore() : $store;
|
| 66 |
+
|
| 67 |
+
$params = array();
|
| 68 |
+
$params['url'] = $store->getConfig('web/unsecure/base_url');
|
| 69 |
+
$params['enterprise'] = ($this->isEnterprise()) ? '1' : '0';
|
| 70 |
+
|
| 71 |
+
return 'http://www.zero1.co.uk/licence/index.php?'.http_build_query($params);
|
| 72 |
+
}
|
| 73 |
+
}
|
app/code/community/Zero1/Seoredirects/Model/Mysql4/Redirection.php
CHANGED
|
@@ -1,16 +1,8 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
KNIWnJxzYUcLjP3m0+2g74PHTcYC+ReR4zrHravBbcPdbq1iwQkyhTivmJJpj3g0y4dwaYl0ArfK
|
| 10 |
-
E4RhpDlKv4JEv8szSCrkBunRHtHDjMKAyjSkQWAdXoZn6uJyIA/3R97ze1ytZGRpimWmumP/toCH
|
| 11 |
-
PrNcaPStbvcBMIJd/4KpyRqh9M6dFOri+Za15CGJatsNdtn0JopxYXatV1SzkDxGWscp5YSTi8ga
|
| 12 |
-
0RmS3AUzQ3WLpb1n4/az8bCmoeEO269Qvpb6LoZcplZxQp9t10lrrTUs0wc2n/wabFyuYnTjUOhm
|
| 13 |
-
IG0xHy6HAU0gTh4N/T9WIz3b568P6WCdRMibC25ad9JFWyeVtMYNQLL003rJpWJlWxGeogMtVu1k
|
| 14 |
-
WZrhSLQKHkvQOClMLIW7ut3AhcwPbQqeDVmInwNd1RCrys7Q+fcgWFxLpfeLHcuLZy19ohsi+QCq
|
| 15 |
-
qVldrZDe6xkjUIjY8g1adhI0hord9WddWfKDn1wuEvEMeuXVMoypPzS3A6g961nFjLtR8/1ArSq0
|
| 16 |
-
0BU6jkNcsya=
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Model_Mysql4_Redirection extends Mage_Core_Model_Mysql4_Abstract
|
| 3 |
+
{
|
| 4 |
+
protected function _construct()
|
| 5 |
+
{
|
| 6 |
+
$this->_init('seoredirects/redirection', 'entity_id');
|
| 7 |
+
}
|
| 8 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Zero1/Seoredirects/Model/Mysql4/Redirection/Collection.php
CHANGED
|
@@ -1,16 +1,8 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
op1dYcgEY12ZAclSdlMWC769ClNsQCMnbSH2PweUqCNZYWBsQshS3yrrEGicwpew6SCMUtz1712w
|
| 10 |
-
9UOZD5MPRgjJu3gakrGknHVtNRYdbPn5EWAa+wLl2CE6+tUGwMUqtlAqvFIdSC7I3303JAQ6IrZA
|
| 11 |
-
J081fiVe/3ibc4lfRUt/0P2HEsKwGNZnjgxdLpNi0v/hfh4q2Kc3hZPdzyLnsxU440a+Zpqi4HB+
|
| 12 |
-
LkzfhZiogBd1AqH9RD2nv+hNOWzjE5NAGRoiALFGcJr3MKpPI+Kjg64WAhGe/Xugux7LOwZKkQf6
|
| 13 |
-
zqGeamD0hUlJW1X+sk0bBj6oc0CElcgaEmxRiTM9eVCw5nVD6HqBK5dls+yVuDRJM3kdKbdG6isQ
|
| 14 |
-
0AXiMKr/ypqUDW7sN3uj5WwATMx0bMZDCknZOQcF3Kqir0c5gB8Z0hb2Aoc3ao6YZkHp/fiQAqi/
|
| 15 |
-
zBOGwMkjMMBZbku44TILRS+g6RPZDqU41xmP8s5+vvyowfYdTljATkLKEZQ7283vJO6Dpc61aBR5
|
| 16 |
-
uTiP
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Model_Mysql4_Redirection_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
|
| 3 |
+
{
|
| 4 |
+
protected function _construct()
|
| 5 |
+
{
|
| 6 |
+
$this->_init('seoredirects/redirection');
|
| 7 |
+
}
|
| 8 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Zero1/Seoredirects/Model/Mysql4/Setup.php
CHANGED
|
@@ -1,13 +1,5 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
sA6Q3/9s+yeTHMnnYMC+LPe4jQQzsh+p2Q0TPgfHFQUD2lIAzm+XBnIyBYEnzaPFfK6/BzLWddIu
|
| 7 |
-
yyGg40aRWg8MtBY/99ep8aP97oI+AMJtJT7ASy0OCwcPP0bA8d7aozym+VEkOMk2RFyX8jc/DHS7
|
| 8 |
-
zIZsKpbWhaZ6Davy46/C1jr8jITe2Ifyx45HwdrNZPA8iW5HpS66dqeYSPkjHMPfME4pvuv6p2ZO
|
| 9 |
-
L/M20xxmVPd/3IcLT7KIlkvn1Ls1ntSGMAx4VNWrMwbiPj/ZSr+NThX1BNz98P/bKglgsOXeLsV4
|
| 10 |
-
gPXDdaUB5YuZVtZdPrDe2rDknylHrgTlzaDvf3y+o7A5HOIMX0QJVtCO3upzO0CAVTAgD/5z8ZgI
|
| 11 |
-
yt3ySTVZfnV3PgT7yE/2/gS/wINxYK/PTySc8+szwSMXzN5rYunFX+YGBg8jGQNNjjZKKoyR0XZB
|
| 12 |
-
0k2pCBSM3+hHVAwPa1jnc6qCdMip0Z11anKfCsmSDFKfMxQHLeBMxNDmkEdwGyn2KOvfB8V8YHoT
|
| 13 |
-
ILlu0YeRY5Mfz2bGYRgrm6xFPYLO5BOhciJ//m==
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Model_Mysql4_Setup extends Mage_Catalog_Model_Resource_Eav_Mysql4_Setup
|
| 3 |
+
{
|
| 4 |
+
}
|
| 5 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Zero1/Seoredirects/Model/Observer.php
CHANGED
|
@@ -1,126 +1,179 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Model_Observer
|
| 3 |
+
{
|
| 4 |
+
const DEFAULT_LIMIT = 50;
|
| 5 |
+
|
| 6 |
+
function controller_front_send_response_before(Varien_Event_Observer $observer)
|
| 7 |
+
{
|
| 8 |
+
$front = $observer->getFront();
|
| 9 |
+
$request = $front->getRequest();
|
| 10 |
+
|
| 11 |
+
if($request->getActionName() != 'noRoute')
|
| 12 |
+
return; // There is a valid route, nothing to do
|
| 13 |
+
|
| 14 |
+
$redirections = Mage::getModel('seoredirects/redirection')->getCollection();
|
| 15 |
+
$redirections->addFieldToFilter('store', Mage::app()->getStore()->getId());
|
| 16 |
+
$redirections->addFieldToFilter('redirect_from', $request->getRequestUri());
|
| 17 |
+
|
| 18 |
+
foreach($redirections as $redirection)
|
| 19 |
+
{
|
| 20 |
+
header('HTTP/1.1 301 Moved Permanently');
|
| 21 |
+
header('Location: '.$redirection->getRedirectTo());
|
| 22 |
+
die();
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
// No redirections
|
| 26 |
+
return;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
function updateRedirectionsCronJob()
|
| 30 |
+
{
|
| 31 |
+
$dump_path = Mage::getBaseDir('var').'/seoredirects';
|
| 32 |
+
if(!file_exists($dump_path))
|
| 33 |
+
mkdir($dump_path);
|
| 34 |
+
|
| 35 |
+
$stores = Mage::getResourceModel('core/store_collection');
|
| 36 |
+
$results = array();
|
| 37 |
+
|
| 38 |
+
foreach($stores as $store)
|
| 39 |
+
{
|
| 40 |
+
$results[$store->getId()] = array(
|
| 41 |
+
'updated' => 0,
|
| 42 |
+
'deleted' => 0,
|
| 43 |
+
'added' => 0,
|
| 44 |
+
'loops' => 0,
|
| 45 |
+
'limitation' => '',
|
| 46 |
+
);
|
| 47 |
+
|
| 48 |
+
$redirections = Mage::getModel('seoredirects/redirection')->getCollection();
|
| 49 |
+
$redirections->addFieldToFilter('store', $store->getId());
|
| 50 |
+
|
| 51 |
+
if(!Mage::getStoreConfig('seoredirects/settings/enabled', $store->getId()))
|
| 52 |
+
{
|
| 53 |
+
// Redirects are disabled for this store, delete them all
|
| 54 |
+
foreach($redirections as $redirection)
|
| 55 |
+
{
|
| 56 |
+
$redirection->delete();
|
| 57 |
+
$results[$store->getId()]['deleted']++;
|
| 58 |
+
}
|
| 59 |
+
|
| 60 |
+
continue; // Do not import anything now
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
$url = Mage::getStoreConfig('seoredirects/settings/url', $store->getId());
|
| 64 |
+
|
| 65 |
+
if(empty($url))
|
| 66 |
+
continue; // Invalid URL, do not update the existing data
|
| 67 |
+
|
| 68 |
+
$client = new Zend_Http_Client($url);
|
| 69 |
+
|
| 70 |
+
$filename = $store->getId().'-'.time().'.csv';
|
| 71 |
+
touch($dump_path.'/'.$filename);
|
| 72 |
+
|
| 73 |
+
$fp = fopen($dump_path.'/'.$filename, 'r+');
|
| 74 |
+
fwrite($fp, $client->request()->getBody());
|
| 75 |
+
fseek($fp, 0);
|
| 76 |
+
|
| 77 |
+
////////////////////////////////////////////////
|
| 78 |
+
// Import the new redirections
|
| 79 |
+
$redirects = array();
|
| 80 |
+
|
| 81 |
+
while(($data = fgetcsv($fp, 4096)) !== false)
|
| 82 |
+
{
|
| 83 |
+
if(is_array($data) && count($data) >= 2)
|
| 84 |
+
$redirects[$data[0]] = $data[1];
|
| 85 |
+
}
|
| 86 |
+
fclose($fp);
|
| 87 |
+
|
| 88 |
+
// Detect the limit for this store
|
| 89 |
+
$license_data = array();
|
| 90 |
+
if(Mage::helper('seoredirects/license')->isValid($store))
|
| 91 |
+
$license_data = Mage::helper('seoredirects/license')->getData($store);
|
| 92 |
+
|
| 93 |
+
if(isset($license_data['limit']))
|
| 94 |
+
{
|
| 95 |
+
$limit = $license_data['limit'];
|
| 96 |
+
} else {
|
| 97 |
+
$limit = self::DEFAULT_LIMIT;
|
| 98 |
+
}
|
| 99 |
+
|
| 100 |
+
if($limit > 0)
|
| 101 |
+
{
|
| 102 |
+
$redirects = array_slice($redirects, 0, $limit);
|
| 103 |
+
$results[$store->getId()]['limitation'] = 'Limited to '.$limit.' rows by your current license. <a href="'.Mage::helper('seoredirects/license')->getRequestURL($store).'" target="_blank">Click here to increase this limit</a>';
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
// Add / update the redirections
|
| 107 |
+
foreach($redirects as $from => $to)
|
| 108 |
+
{
|
| 109 |
+
$found = false;
|
| 110 |
+
|
| 111 |
+
foreach($redirections as $redirection)
|
| 112 |
+
{
|
| 113 |
+
if($redirection->getRedirectFrom() == $from)
|
| 114 |
+
{
|
| 115 |
+
// Existing redirection, update
|
| 116 |
+
$redirection->setRedirectTo($to);
|
| 117 |
+
$redirection->setRedirectFrom($from);
|
| 118 |
+
$redirection->setStore($store->getId());
|
| 119 |
+
$redirection->save();
|
| 120 |
+
$found = true;
|
| 121 |
+
$results[$store->getId()]['updated']++;
|
| 122 |
+
|
| 123 |
+
//echo 'Updated <b>'.$from.'</b> = <b>'.$to.'</b> into store ID <b>'.$store->getId().'</b><br/>';
|
| 124 |
+
}
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
if(!$found)
|
| 128 |
+
{
|
| 129 |
+
// New redirection
|
| 130 |
+
$redirection = Mage::getModel('seoredirects/redirection');
|
| 131 |
+
$redirection->setRedirectTo($to);
|
| 132 |
+
$redirection->setRedirectFrom($from);
|
| 133 |
+
$redirection->setStore($store->getId());
|
| 134 |
+
$redirection->save();
|
| 135 |
+
$results[$store->getId()]['added']++;
|
| 136 |
+
|
| 137 |
+
//echo 'Added <b>'.$from.'</b> = <b>'.$to.'</b> into store ID <b>'.$store->getId().'</b><br/>';
|
| 138 |
+
}
|
| 139 |
+
}
|
| 140 |
+
|
| 141 |
+
// Remove all the unused redirections
|
| 142 |
+
$redirections = Mage::getModel('seoredirects/redirection')->getCollection();
|
| 143 |
+
$redirections->addFieldToFilter('store', $store->getId());
|
| 144 |
+
foreach($redirections as $redirection)
|
| 145 |
+
{
|
| 146 |
+
if(!array_key_exists($redirection->getRedirectFrom(), $redirects))
|
| 147 |
+
{
|
| 148 |
+
//echo 'Removed <b>'.$redirection->getRedirectFrom().'</b> from store ID <b>'.$store->getId().'</b><br/>';
|
| 149 |
+
$redirection->delete();
|
| 150 |
+
$results[$store->getId()]['deleted']++;
|
| 151 |
+
}
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
// Make sure there are no redirection loops
|
| 155 |
+
$redirections = Mage::getModel('seoredirects/redirection')->getCollection();
|
| 156 |
+
$redirections->addFieldToFilter('store', $store->getId());
|
| 157 |
+
foreach($redirections as $redirectionA)
|
| 158 |
+
{
|
| 159 |
+
foreach($redirections as $redirectionB)
|
| 160 |
+
{
|
| 161 |
+
if(!$redirectionA || !$redirectionB)
|
| 162 |
+
continue; // Invalid rediection, been deleted?
|
| 163 |
+
|
| 164 |
+
if($redirectionA == $redirectionB)
|
| 165 |
+
continue;
|
| 166 |
+
|
| 167 |
+
if($redirectionA->getRedirectTo() == $redirectionB->getRedirectFrom())
|
| 168 |
+
{
|
| 169 |
+
//echo 'Removed loop <b>'.$redirection->getRedirectFrom().'</b> from store ID <b>'.$store->getId().'</b><br/>';
|
| 170 |
+
$redirectionA->delete();
|
| 171 |
+
$results[$store->getId()]['loops']++;
|
| 172 |
+
}
|
| 173 |
+
}
|
| 174 |
+
}
|
| 175 |
+
}
|
| 176 |
+
|
| 177 |
+
Mage::register('seoredirects_results', $results);
|
| 178 |
+
}
|
| 179 |
+
}
|
app/code/community/Zero1/Seoredirects/Model/Redirection.php
CHANGED
|
@@ -1,15 +1,8 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
UDqngxO0KQ/qW7Enkbd8UP2XM5fLdJTnf/wa5A+lp+ezD1ISyFJarEVCFMiuLSIKiKLcaqWsrMsp
|
| 10 |
-
rsozwNQ6fEnHep9ROVUbt2N/skM2AHWpgFzQRavt/RPgDs047V4ZvXSCE1XdMMuuH/gg2LXPc1Yw
|
| 11 |
-
BFRgYanvdLPfHQQifjalgg0Vdi+8DILG40pcJs+UjwJaKfTeDGftEJenPq0h8t+eOjAtOGt+0NNF
|
| 12 |
-
Ny8ekqdGlzpbesyT+bEBr/y+ktgCW4sgdKXpLy7vpKbDmMgmNfrdbK9EJW48kDcldrP3ECa9Z3h4
|
| 13 |
-
KwT6dseBsycKutAD8fhIoQnTjUzrdPQGwtVTe2neG+lEJkzEFpN/29NeMeB8kcnlLDerdyIQmust
|
| 14 |
-
0bmQzX8344wdP3iUnzs694bZ/4IqXW4miiv15gtMM8ruRk1xIb3lHU26QzQfmAtxDg0a+jnzLeyb
|
| 15 |
-
pRZE6ntKmYQ5KOmIy3C1R+Izb8E454MwAThhC0==
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Model_Redirection extends Mage_Core_Model_Abstract
|
| 3 |
+
{
|
| 4 |
+
protected function _construct()
|
| 5 |
+
{
|
| 6 |
+
$this->_init('seoredirects/redirection');
|
| 7 |
+
}
|
| 8 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Zero1/Seoredirects/controllers/Adminhtml/Seoredirects/ManageController.php
CHANGED
|
@@ -1,68 +1,64 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
HuKwQNy4sGME6cs6fJYD+PDgUMj79JarrZ/etBci/Z0tmYxbMwbP3PmGnz5Asa+3UZbqbqXa79Eo
|
| 66 |
-
SizeTtlw11bWcOo3BG+vQu8WNcoFwT71/qTJ2bpPbRULOglzsqwGuZPKHoxFI+taCI3mxVvKICHP
|
| 67 |
-
XXAxTlLw2vbHVd/m8I52uKr4udsq/eawmFdTufzZ6XXgCGO/s+siXFmooWHNZu3pj9dm5S73YZga
|
| 68 |
-
nYtldWvL2zGtk2BqKrp2Q7S8qYWcIFDBkWspO5u=
|
| 1 |
+
<?php
|
| 2 |
+
class Zero1_Seoredirects_Adminhtml_Seoredirects_ManageController extends Mage_Adminhtml_Controller_Action
|
| 3 |
+
{
|
| 4 |
+
public function indexAction()
|
| 5 |
+
{
|
| 6 |
+
$this->_title($this->__('SEO Redirects'))
|
| 7 |
+
->_title($this->__('Manage Redirects'));
|
| 8 |
+
|
| 9 |
+
$this->loadLayout();
|
| 10 |
+
$this->_setActiveMenu('catalog/seoredirects');
|
| 11 |
+
$this->renderLayout();
|
| 12 |
+
}
|
| 13 |
+
|
| 14 |
+
public function updateAction()
|
| 15 |
+
{
|
| 16 |
+
Mage::getModel('seoredirects/observer')->updateRedirectionsCronJob();
|
| 17 |
+
|
| 18 |
+
$results = Mage::registry('seoredirects_results');
|
| 19 |
+
$stores = Mage::getResourceModel('core/store_collection');
|
| 20 |
+
$pad = ' ';
|
| 21 |
+
|
| 22 |
+
foreach($stores as $store)
|
| 23 |
+
{
|
| 24 |
+
if(($results[$store->getId()]['updated'] +
|
| 25 |
+
$results[$store->getId()]['added'] +
|
| 26 |
+
$results[$store->getId()]['deleted'] +
|
| 27 |
+
$results[$store->getId()]['loops']) == 0)
|
| 28 |
+
{
|
| 29 |
+
continue;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
$this->_getSession()->addSuccess(
|
| 33 |
+
Mage::helper('seoredirects')->__($store->getName())
|
| 34 |
+
);
|
| 35 |
+
|
| 36 |
+
if($results[$store->getId()]['updated'] > 0)
|
| 37 |
+
$this->_getSession()->addSuccess(
|
| 38 |
+
Mage::helper('seoredirects')->__($pad.'Updated '.$results[$store->getId()]['updated'].' redirection(s).')
|
| 39 |
+
);
|
| 40 |
+
|
| 41 |
+
if($results[$store->getId()]['added'] > 0)
|
| 42 |
+
$this->_getSession()->addSuccess(
|
| 43 |
+
Mage::helper('seoredirects')->__($pad.'Added '.$results[$store->getId()]['added'].' redirection(s).')
|
| 44 |
+
);
|
| 45 |
+
|
| 46 |
+
if($results[$store->getId()]['deleted'] > 0)
|
| 47 |
+
$this->_getSession()->addSuccess(
|
| 48 |
+
Mage::helper('seoredirects')->__($pad.'Deleted '.$results[$store->getId()]['deleted'].' redirection(s).')
|
| 49 |
+
);
|
| 50 |
+
|
| 51 |
+
if($results[$store->getId()]['loops'] > 0)
|
| 52 |
+
$this->_getSession()->addSuccess(
|
| 53 |
+
Mage::helper('seoredirects')->__($pad.'Deleted '.$results[$store->getId()]['loops'].' looping redirection(s).')
|
| 54 |
+
);
|
| 55 |
+
|
| 56 |
+
if(!empty($results[$store->getId()]['limitation']))
|
| 57 |
+
$this->_getSession()->addSuccess(
|
| 58 |
+
Mage::helper('seoredirects')->__($pad.$results[$store->getId()]['limitation'])
|
| 59 |
+
);
|
| 60 |
+
}
|
| 61 |
+
|
| 62 |
+
$this->_redirect('*/*/index');
|
| 63 |
+
}
|
| 64 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
app/code/community/Zero1/Seoredirects/etc/config.xml
CHANGED
|
@@ -84,8 +84,8 @@
|
|
| 84 |
<default>
|
| 85 |
<seoredirects>
|
| 86 |
<settings>
|
| 87 |
-
<
|
| 88 |
-
<
|
| 89 |
</settings>
|
| 90 |
</seoredirects>
|
| 91 |
</default>
|
| 84 |
<default>
|
| 85 |
<seoredirects>
|
| 86 |
<settings>
|
| 87 |
+
<enabled>0</enabled>
|
| 88 |
+
<url></url>
|
| 89 |
</settings>
|
| 90 |
</seoredirects>
|
| 91 |
</default>
|
app/code/community/Zero1/Seoredirects/etc/system.xml
CHANGED
|
@@ -16,7 +16,7 @@
|
|
| 16 |
<show_in_website>1</show_in_website>
|
| 17 |
<show_in_store>1</show_in_store>
|
| 18 |
<fields>
|
| 19 |
-
<
|
| 20 |
<label>Enabled</label>
|
| 21 |
<frontend_type>select</frontend_type>
|
| 22 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
|
@@ -24,9 +24,9 @@
|
|
| 24 |
<show_in_default>0</show_in_default>
|
| 25 |
<show_in_website>0</show_in_website>
|
| 26 |
<show_in_store>1</show_in_store>
|
| 27 |
-
</
|
| 28 |
|
| 29 |
-
<
|
| 30 |
<label>Google Docs URL</label>
|
| 31 |
<frontend_type>text</frontend_type>
|
| 32 |
<sort_order>1</sort_order>
|
|
@@ -34,9 +34,9 @@
|
|
| 34 |
<show_in_website>0</show_in_website>
|
| 35 |
<show_in_store>1</show_in_store>
|
| 36 |
<comment>The above URL will be downloaded into Magento at 2am every morning</comment>
|
| 37 |
-
</
|
| 38 |
|
| 39 |
-
<
|
| 40 |
<label>Serial</label>
|
| 41 |
<frontend_type>textarea</frontend_type>
|
| 42 |
<sort_order>2</sort_order>
|
|
@@ -44,7 +44,7 @@
|
|
| 44 |
<show_in_website>1</show_in_website>
|
| 45 |
<show_in_store>0</show_in_store>
|
| 46 |
<comment><![CDATA[Visit <a href="http://www.zero1.co.uk/" target="_blank">http://www.zero1.co.uk</a> if you require a serial.]]></comment>
|
| 47 |
-
</
|
| 48 |
</fields>
|
| 49 |
</settings>
|
| 50 |
</groups>
|
| 16 |
<show_in_website>1</show_in_website>
|
| 17 |
<show_in_store>1</show_in_store>
|
| 18 |
<fields>
|
| 19 |
+
<enabled translate="label">
|
| 20 |
<label>Enabled</label>
|
| 21 |
<frontend_type>select</frontend_type>
|
| 22 |
<source_model>adminhtml/system_config_source_yesno</source_model>
|
| 24 |
<show_in_default>0</show_in_default>
|
| 25 |
<show_in_website>0</show_in_website>
|
| 26 |
<show_in_store>1</show_in_store>
|
| 27 |
+
</enabled>
|
| 28 |
|
| 29 |
+
<url translate="label">
|
| 30 |
<label>Google Docs URL</label>
|
| 31 |
<frontend_type>text</frontend_type>
|
| 32 |
<sort_order>1</sort_order>
|
| 34 |
<show_in_website>0</show_in_website>
|
| 35 |
<show_in_store>1</show_in_store>
|
| 36 |
<comment>The above URL will be downloaded into Magento at 2am every morning</comment>
|
| 37 |
+
</url>
|
| 38 |
|
| 39 |
+
<serial translate="label">
|
| 40 |
<label>Serial</label>
|
| 41 |
<frontend_type>textarea</frontend_type>
|
| 42 |
<sort_order>2</sort_order>
|
| 44 |
<show_in_website>1</show_in_website>
|
| 45 |
<show_in_store>0</show_in_store>
|
| 46 |
<comment><![CDATA[Visit <a href="http://www.zero1.co.uk/" target="_blank">http://www.zero1.co.uk</a> if you require a serial.]]></comment>
|
| 47 |
+
</serial>
|
| 48 |
</fields>
|
| 49 |
</settings>
|
| 50 |
</groups>
|
app/code/community/Zero1/Seoredirects/sql/seoredirects_setup/mysql4-install-1.0.0.php
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$installer = $this;
|
| 3 |
+
|
| 4 |
+
$installer->startSetup();
|
| 5 |
+
|
| 6 |
+
$installer->run("
|
| 7 |
+
|
| 8 |
+
DROP TABLE IF EXISTS {$this->getTable('zero1_seoredirects_redirection')};
|
| 9 |
+
CREATE TABLE {$this->getTable('zero1_seoredirects_redirection')} (
|
| 10 |
+
`entity_id` int(11) unsigned NOT NULL auto_increment,
|
| 11 |
+
`redirect_from` varchar(2047) NOT NULL,
|
| 12 |
+
`redirect_to` varchar(2047) NOT NULL,
|
| 13 |
+
`store` int(4) NOT NULL,
|
| 14 |
+
PRIMARY KEY (`entity_id`)
|
| 15 |
+
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
| 16 |
+
|
| 17 |
+
");
|
| 18 |
+
|
| 19 |
+
$installer->endSetup();
|
app/code/community/Zero1/Seoredirects/sql/seoredirects_setup/mysql4-install-1.0.1.php
CHANGED
|
@@ -1,19 +1,19 @@
|
|
| 1 |
-
<?php
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 1 |
+
<?php
|
| 2 |
+
$installer = $this;
|
| 3 |
+
|
| 4 |
+
$installer->startSetup();
|
| 5 |
+
|
| 6 |
+
$installer->run("
|
| 7 |
+
|
| 8 |
+
DROP TABLE IF EXISTS {$this->getTable('zero1_seoredirects_redirection')};
|
| 9 |
+
CREATE TABLE {$this->getTable('zero1_seoredirects_redirection')} (
|
| 10 |
+
`entity_id` int(11) unsigned NOT NULL auto_increment,
|
| 11 |
+
`redirect_from` varchar(2047) NOT NULL,
|
| 12 |
+
`redirect_to` varchar(2047) NOT NULL,
|
| 13 |
+
`store` int(4) NOT NULL,
|
| 14 |
+
PRIMARY KEY (`entity_id`)
|
| 15 |
+
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
| 16 |
+
|
| 17 |
+
");
|
| 18 |
+
|
| 19 |
+
$installer->endSetup();
|
package.xml
CHANGED
|
@@ -1,18 +1,18 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Zero1_Seoredirects</name>
|
| 4 |
-
<version>1.0.
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Manage you SEO redirects using a Google Doc</summary>
|
| 10 |
<description>Manage you SEO redirects using a Google Doc</description>
|
| 11 |
-
<notes>
|
| 12 |
<authors><author><name>Arron Moss</name><user>zero1limited</user><email>arron.moss@zero1.co.uk</email></author></authors>
|
| 13 |
-
<date>2012-
|
| 14 |
-
<time>
|
| 15 |
-
<contents><target name="magecommunity"><dir name="Zero1"><dir name="Seoredirects"><dir name="Block"><dir name="Manage"><file name="Grid.php" hash="b06399e81b30ef592805277595061b38"/></dir><file name="Manage.php" hash="1ed89ca5e60aeec11a5c225bcce8e124"/></dir><dir name="Helper"><file name="Data.php" hash="36474aca2c8e7dce3f30c398bd9c0ce0"/><file name="License.php" hash="
|
| 16 |
<compatible/>
|
| 17 |
-
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>Zero1_Seoredirects</name>
|
| 4 |
+
<version>1.0.6</version>
|
| 5 |
<stability>stable</stability>
|
| 6 |
<license uri="http://shop.zero1.co.uk/LICENSE.txt">Commercial</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Manage you SEO redirects using a Google Doc</summary>
|
| 10 |
<description>Manage you SEO redirects using a Google Doc</description>
|
| 11 |
+
<notes>Changed getRequestString() to getRequestUri() to capture query strings.</notes>
|
| 12 |
<authors><author><name>Arron Moss</name><user>zero1limited</user><email>arron.moss@zero1.co.uk</email></author></authors>
|
| 13 |
+
<date>2012-09-05</date>
|
| 14 |
+
<time>11:21:55</time>
|
| 15 |
+
<contents><target name="magecommunity"><dir name="Zero1"><dir name="Seoredirects"><dir name="Block"><dir name="Manage"><file name="Grid.php" hash="b06399e81b30ef592805277595061b38"/></dir><file name="Manage.php" hash="1ed89ca5e60aeec11a5c225bcce8e124"/></dir><dir name="Helper"><file name="Data.php" hash="36474aca2c8e7dce3f30c398bd9c0ce0"/><file name="License.php" hash="479affaec1ba20aa6b916dec4e055b4b"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Redirection"><file name="Collection.php" hash="73bf6b8f2ddff49dac520a6f71f72502"/></dir><file name="Redirection.php" hash="21d829342e13727de44bd3c821054bd9"/><file name="Setup.php" hash="e97a5f05e8459f367c14e98e7a0b03c6"/></dir><file name="Observer.php" hash="3aca40cf7cb66d1a449fb9861fac0029"/><file name="Redirection.php" hash="8d26f395bf5b33679b032c160152e24a"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Seoredirects"><file name="ManageController.php" hash="bf497a1ce5f202abd024a5736a0e8a9a"/></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="7e8d3a4c8dff9b4df9f380c284225393"/><file name="config.xml" hash="47fc4b68738ae8fc9e171ea8e1190fb8"/><file name="system.xml" hash="063dab03c71e04400c1f469b4f15ad61"/></dir><dir name="sql"><dir name="seoredirects_setup"><file name="mysql4-install-1.0.0.php" hash="918bc1dee6bb2388e78b7346929916c9"/><file name="mysql4-install-1.0.1.php" hash="918bc1dee6bb2388e78b7346929916c9"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Zero1_Seoredirects.xml" hash="dd176346dbb2abf0e20d8ea087abe2ce"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="seoredirects.xml" hash="84e2381a4d12eb22fa5e6b5b092ddef7"/></dir></dir></dir></dir></target></contents>
|
| 16 |
<compatible/>
|
| 17 |
+
<dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php></required></dependencies>
|
| 18 |
</package>
|
