if(Mage::getSingleton(‘customer/session’)->isLoggedIn()):
Mage::getDesign()->setPackageName(‘package_name’)->setTheme(‘set_themename’);
endif;
Below are the simple step to create the database backup
step-1 Create bat file like test.bat
Step-2 Copy the below code to bat file
@echo off
set TIMESTAMP=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
c:\wamp\bin\mysql\mysql5.6.12\bin\mysqldump –user=root –password= –result-file=”C:/wamp/backup/databases.%TIMESTAMP%.sql” databasename
Step-3 scheduling bat file
>> Go to all program >>Accessories>>system tool>>Task Schedular
>> Create basic task
>> Specify name description then go to next
>> In this step there is an option to schedule backup like daily,weekly etc
>> Go to next step and there is an option to set the time
>> Go to the next step and select start a program and go to next
>> and select the bat file where you have save and click on finish.
Now you have completed all the task to take the database backup
if you want to test it then follow the below step
Step-1 Click on task schedular library it will list all schedule task
Step-2 select the task that you have created and click on run it will create the file on backup location
Please follow the below step to add the color picker in wordpress admin panel
Step-1 Register the wp color picker style by adding the below code
wp_enqueue_style( ‘wp-color-picker’ );
Step-2 Register the wp color picker js by adding the below code
wp_enqueue_script( ‘wp-color-picker’ );
Step-3 Add the below code to pick the color in your form/page etc.
Step-4 Add the below script to call the color picker function
jQuery(document).ready(function($){
$(‘.my-color-field’).wpColorPicker();
});
thats it..
To avoid the strip class from div,ul etc.We have to edit config.js paste the below line
config.allowedContent = true;
as in the below function
CKEDITOR.editorConfig = function( config ) {
// Define changes to default configuration here. For example:
// config.language = ‘fr’;
// config.uiColor = ‘#AADC6E’;
config.allowedContent = true;
};
Get current module name, route name, controller name and action name
Posted: November 23, 2015 in MagentoMage::app()->getRequest()->getControllerName(); //controller name Mage::app()->getRequest()->getActionName(); //action name Mage::app()->getRequest()->getRouteName(); // routes name Mage::app()->getRequest()->getModuleName(); // module name
<?php
// output headers so that the file is downloaded rather than displayed
header(‘Content-Type: text/csv; charset=utf-8’);
header(‘Content-Disposition: attachment; filename=data.csv’);
// create a file pointer connected to the output stream
$output = fopen(‘php://output’, ‘w’);
// output the column headings
fputcsv($output, array(‘ID’,’Name’,’Email’ ));
// fetch the data
mysql_connect(‘localhost’, ‘root’, ‘password’);
mysql_select_db(‘abc’);
$sql=’SELECT name,email FROM users ORDER BY id DESC’;
$rows = mysql_query($sql);
// loop over the rows, outputting them
while ($row = mysql_fetch_assoc($rows)) fputcsv($output, $row)
If we are using the GROUP BY clouse in the select statement without using any aggregate function GROUP BY behave like DISTINCT operator.
The main difference between the DISTINCT and GROUP BY clouse is that the GROUP BY clouse sort the result set while the DISTINCT operator does not..