convert to utf8

November 8th, 2011 No comments

#/bin/bash
LIST=`find . -name *.inc`
for i in $LIST;
do iconv -c -f euc-kr -t utf8 $i -o $i.”utf8″;
mv $i.”utf8″ $i;
done

Categories: Server, System Tags:

magento upgrade

August 31st, 2011 No comments

rm -rf /var/cache session
./mage mage-setup .
./mage config-set preferred_state stable
./mage list-installed
./mage list-upgrades
./mage install http://connect20.magentocommerce.com/community Mage_All_Latest –force
./shell php indexer.php reindexall

 

app/etc/config.xml

<initStatements>SET NAMES utf8; SET FOREIGN_KEY_CHECKS=0; SET UNIQUE_CHECKS=0;</initStatements>

Categories: Programming, System, Web Tags:

Magento 1.5.0.1 core_directory_storage problem

May 2nd, 2011 No comments
/app/code/core/Mage/Core/Model/Mysql4/File/Storage/Directory/Database.php
CREATE TABLE IF NOT EXISTS `PREFIX_core_directory_storage` (
`directory_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`path` varchar(255) NOT NULL DEFAULT '',
`upload_time` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
`parent_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`directory_id`),
UNIQUE KEY `IDX_DIRECTORY_PATH` (`name`, `path`),
KEY `parent_id` (`parent_id`),
CONSTRAINT `FK_DIRECTORY_PARENT_ID` FOREIGN KEY (`parent_id`)
REFERENCES `PREFIX_core_directory_storage` (`directory_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Directory storage';
May with
SET FOREIGN_KEY_CHECKS = 0;
Categories: Software Tags:

replace string, sed

February 17th, 2011 No comments

$sed -i 's/foo/foo_bar/g' filename.ext

$find . -type f -exec sed -i ‘s/foo/foo_bar/g‘ {} \;

Categories: Server Tags:

Installing Magento 1.3 with PHP 5.3

December 16th, 2010 No comments

lib/Varien/Object.php
On line 484, replace

public function ___toString(array $arrAttributes = array(), $valueSeparator=’,')
by
public function __invoke(array $arrAttributes = array(), $valueSeparator=’,')

app/code/core/Mage/Catalog/Model/Layer/Filter/Price.php
On line 139. replace

$key.= $taxReq->__toString(array(), ‘_’);
by
$key.= $taxReq->__invoke(array(), ‘_’);

app/code/core/Mage/Core/functions.php
On line 192, replace

switch($errno){
by
switch($errno){
case E_DEPRECATED:
return;

lib/Zend/Pdf/Resource/Image/Jpeg.php
On line 59, replace

if (!$gd_options['JPG Support'] ) {
by
if ( (!isset($gd_options['JPG Support']) || $gd_options['JPG Support'] != true) &&
(!isset($gd_options['JPEG Support']) || $gd_options['JPEG Support'] != true) ) {

Categories: Software Tags:

magento Browse By Vs. Shop By

November 10th, 2010 No comments

Catalog Category (Non-Anchor)

<block type=”catalog/navigation” name=”catalog.leftnav” after=”currency” template=”catalog/navigation/left.phtml”/>

Catalog Category (Anchor)

<block type=”catalog/layer_view” name=”catalog.leftnav” after=”currency” template=”catalog/layer/view.phtml”/>

Categories: System Tags:

magento disappear poll after voting

November 9th, 2010 1 comment

app/code/core/Mage/Poll/Model/Poll.php

public function getVotedPollsIds()
{
$idsArray = array();
/*
foreach ($this->getCookie()->get() as $cookieName => $cookieValue) {
$pattern = ‘#^’ . preg_quote($this->_pollCookieDefaultName, ‘#’) . ‘(\d+)$#’;
$match = array();
if (preg_match($pattern, $cookieName, $match)) {
if ($match[1] != Mage::getSingleton(‘core/session’)->getJustVotedPoll()) {
$idsArray[$match[1]] = $match[1];
}
}
}

// load from db for this ip
foreach ($this->_getResource()->getVotedPollIdsByIp(Mage::helper(‘core/http’)->getRemoteAddr()) as $pollId) {
$idsArray[$pollId] = $pollId;
}*/

return $idsArray;
}

Categories: System Tags: , ,

remove ssl encryption

October 30th, 2010 No comments

openssl rsa -in server.key -out server.key.new

mv server.key.new server.key

chmod 600 server.key

Categories: Server Tags: , ,

pear mage-setup

October 21st, 2010 No comments

./pear mage-setup .
./pear install magento-core/Mage_All_Latest

Categories: System Tags: , ,

Magento payment do not continue

October 16th, 2010 No comments

app/design/frontend/yourtheme/youtemplate/layout/page.xml

<action method=”addJs”><script>lib/ccard.js</script></action>

<block type=”page/html_head” name=”head” as=”head”>
<action method=”addJs”><script>prototype/prototype.js</script></action>
<action method=”addJs” ifconfig=”dev/js/deprecation”><script>prototype/deprecation.js</script></action>
<action method=”addJs”><script>lib/ccard.js</script></action>
<action method=”addJs”><script>prototype/validation.js</script></action>

…..

Categories: Programming Tags: , ,