Fortunately, there is a quick fix for this.
Download the magento clean up tool (a php file) and upload to your store root folder.
Once done, browse to the clean up tool (http://www.yourstore.com/magento-cleanup.php) and you will see a list of messages that it has reset the folder permission.
]]>Here’s how to install chinese language for the admin
1. go to magento connect and install the below 2.0 extension key
http://connect20.magentocommerce.com/community/Locale_Mage_community_zh_CN
2. Once installed, check your app\locale and you will see a lot of csv files in the folder. Those files are created by the extension… in the wrong folder!
3. Create a folder ‘zh_CN‘ in app\locale and move all the csv files in app\locale to app\locale\zh_CN
4. Once done, go back to admin page and flush your cache (system -> cache management -> flush magento cache)
5. Change the language to chinese (china) and you should be able to view it in chinese (hopefully)
]]>1. check page.xml in app\design\frontend\default\[yourtemplate]\layout and verify if the following line is in place.
\\app\design\frontend\default\[yourtemplate]\layout\page.xml
2. open *.phtml in app\design\frontend\default\magikjewellery\template\page and verify if the following line is after the tag
\\app\design\frontend\default\[yourtemplate]\template\page\1column.phtml
\\app\design\frontend\default\[yourtemplate]\template\page\1columnhome.phtml
\\app\design\frontend\default\[yourtemplate]\template\page\2columns-left.phtml
\\app\design\frontend\default\[yourtemplate]\template\page\2columns-right.phtml
\\app\design\frontend\default\[yourtemplate]\template\page\print.phtml
...
<!--?php echo $this--->getChildHtml('after_body_start') ?>
...
3. clear your cache by going to admin -> system -> cache management and flush magento cache
4. open your home page, right click on it and select view source and check if the following codes are generated.
<!-- BEGIN GOOGLE ANALYTICS CODE -->
<script type="text/javascript">
//<![CDATA[
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(ga);
})();
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-1234567-7']);
_gaq.push(['_trackPageview']);
//]]>
</script>
<!-- END GOOGLE ANALYTICS CODE -->
]]>As discussed in this tutorial (though it is for symfony 1.2, it will works in 1.4), the key thing is to set a post validator to validate values after the initial validation.
Assuming you have two fields – one checkbox and one textfield.
And you want the textfield to be filled in if the checkbox is ticked.
Here’s how you do it.
// lib\form\doctrine\MyForm.class.php
class MyForm extends BaseContestForm
{
public function configure()
{
// add a post validator
$this->validatorSchema->setPostValidator(
new sfValidatorCallback(array('callback' => array($this, 'validateTextField')))
);
}
public function validateTextField($validator, $values)
{
if ($values['myCheckbox'])
{
$this->validatorSchema['myTextField'] = new sfValidatorString(array(
'required' => true,
'max_length' => 50,
'min_length' => 1
));
}
return $values;
}
}
]]>The SQL would update sf_guard_user’s id to match the sf_guard_user_profile’s id.
Take note that this is provided that your other application tables are using sf_guard_user_profile‘s id and not the sf_guard_user‘s id.

-- drop constraints ALTER TABLE `sf_guard_forgot_password` DROP FOREIGN KEY `sf_guard_forgot_password_user_id_sf_guard_user_id`; ALTER TABLE `sf_guard_remember_key` DROP FOREIGN KEY `sf_guard_remember_key_user_id_sf_guard_user_id`; ALTER TABLE `sf_guard_user_group` DROP FOREIGN KEY `sf_guard_user_group_user_id_sf_guard_user_id`; ALTER TABLE `sf_guard_user_permission` DROP FOREIGN KEY `sf_guard_user_permission_user_id_sf_guard_user_id`; ALTER TABLE `sf_guard_user_profile` DROP FOREIGN KEY `sf_guard_user_profile_user_id_sf_guard_user_id`; -- remove auto increment ALTER TABLE `sf_guard_user` CHANGE `id` `id` BIGINT( 20 ) NOT NULL; -- update id in sf_guard_user update `sf_guard_user` set id = id - 1; -- add auto increment ALTER TABLE `sf_guard_user` CHANGE `id` `id` BIGINT( 20 ) NOT NULL AUTO_INCREMENT; -- update sf guard user profile update `sf_guard_user_profile` set user_id = user_id - 1; -- reset session TRUNCATE TABLE `sf_guard_remember_key`; -- reset user group TRUNCATE TABLE `sf_guard_user_group`; -- add back constraints ALTER TABLE `sf_guard_forgot_password` ADD CONSTRAINT `sf_guard_forgot_password_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE; ALTER TABLE `sf_guard_remember_key` ADD CONSTRAINT `sf_guard_remember_key_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE; ALTER TABLE `sf_guard_user_group` ADD CONSTRAINT `sf_guard_user_group_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE; ALTER TABLE `sf_guard_user_permission` ADD CONSTRAINT `sf_guard_user_permission_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE; ALTER TABLE `sf_guard_user_profile` ADD CONSTRAINT `sf_guard_user_profile_user_id_sf_guard_user_id` FOREIGN KEY (`user_id`) REFERENCES `sf_guard_user` (`id`) ON DELETE CASCADE;]]>
Here’s an example of how it will looks like when the thumbnail is showing on the listing page.
Before you add it in, you need to check the variable name of the row that the admin generator uses.
To check the variable name, go to the cache folder for the module and open the _list.php file with a notepad.
Take note of the row
\\cache\backend\dev\modules\autoContestphoto\templates\_list.php
...
<?php foreach ($pager->getResults() as $i => $contest_photo): $odd = fmod(++$i, 2) ? 'odd' : 'even' ?>
<tr class="sf_admin_row <?php echo $odd ?>">
<?php include_partial('contestphoto/list_td_batch_actions', array('contest_photo' => $contest_photo, 'helper' => $helper)) ?>
<?php include_partial('contestphoto/list_td_tabular', array('contest_photo' => $contest_photo)) ?>
<?php include_partial('contestphoto/list_td_actions', array('contest_photo' => $contest_photo, 'helper' => $helper)) ?>
</tr>
<?php endforeach; ?>
...
In my case, the variable name for the row is $contest_photo
Next, create a partial call _thumbnail.php in the template folder of the module.
In this partial, echo the path of the thumbnail or the photo with a img html tag
\\apps\backend\modules\contestphoto\templates\_thumbnail.php <img src="<?php echo $contest_photo->getThumbnailPath() ?>"/>
Then, edit the generator file to include the _thumbnail column for your list
\\apps\backend\modules\contest\config\generator.yml
...
list:
title: Contest Photo Management
display: [=title, contest, category, user, title, isDeleted, _thumbnail]
sort: [created_at, desc]
max_per_page: 50
...
Clear your cache and see if the thumbnail loads.
]]>Call to undefined method myUser::setReferer.
and if you are using sfGuard plugin, go to
apps\[project]\lib\myUser.class.php
and change
class myUser extends sfBasicSecurityUser
{
}
to
class myUser extends sfGuardSecurityUser
{
}
]]>Thus, you need to add your public IP address in fontend_dev.php to tell symfony to let you through in the production environment. Here’s how to do it
In your fontend_dev.php file, put in the below line to print out your public ip address
echo $_SERVER['REMOTE_ADDR']. "<br/>"
Access frontend_dev.php and copy the IP address as shown.
Edit frontend_dev.php and change the line
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1')))
to
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '::1', '111.222.333.444')))
Where 111.222.333.444 is the IP address you copied.
Upload back the frontend_dev.php and try again
]]>
AppLocale is a free download from Microsoft that allows you to run non-unicode applications without changing the entire system’s locale to another language. In short, it acts as a ‘wrapper’ for the non-unicode program and force the program to display the correct locale properly.
1. Once you install AppLocale, go to Start -> Program -> Microsoft AppLocale -> Applocale and the wizard will popup as shown below. Click Next
2. Click browse and select the chinese program exe file and click Next
3. Check if the language of the application is detected properly. if not, select the correct lanaguage and click Next
4. Tick the checkbox if you want to create a shortcut. The shortcut will be place under Start->Program->Microsoft AppLocale
5. Run the program by going to Start->Program->Microsoft AppLocale
And now the program is able to display the correct unicode
Am looking at the current popular PHP frameworks which need to fufil the following requirement
Currently shortlisted
Had do some googling and below are the pros and cons for each frameworks
CakePHP
Pro
Cons
Symfony
Pros
Cons
I decided to give myself a week to learn Syfmony before I decide which framework to use.