很简单,商店设置-》商品信息-》元标签XXX
关闭即可
2011年08月12日
2011年08月11日
Optimize your DirectAdmin backups with rSync
DirectAdmin offers some great backup which makes it possible to create a backup file for each user or hosting account. The control panel has backup functions for the different access levels:
* Admin level: Create system or whole server backups
* Admin level: Create backups for all users and resellers
* Reseller level: Create backups for all users owned by the reseller
* User level: Create backups for different services (website, e-mail, database…)
Create complete and compact backups
While the backup files created by a user remain one the local server, is it possible to copy those backups, created by the admin or reseller user, to a remote backup location. Each backup file (created by the admin or reseller) contains: The files from the website, a database dump file, the e-mail accounts (including data), the DNS records and all other user related settings/stats. Using DirectAmin’s backup/restore function, it’s very easy to move complete websites:
1. Create a backup and store the file on your remote backup storage platform and wait for the confirmation e-mail that your backup is ready
2. Login to the new/second DirectAdmin server and restore the account from the remote location (don’t forget to change the server’s IP address)
3. After you got the conformation e-mail that your account is restored, just change the A records or the name server for your domain name.
With this functionality it’s possible to move website between servers without a second of downtime! Optional you can change the A records from the first server to point them to the new server’s IP address.
High server load on backup creation
The backup function is great to move websites and also for your daily backup if the accounts are not to big. Just in case you need to create several bigger backup files (f.e. 1GB), your server will become slow until the whole backup process is finished.
Backup plan to lower the server load
Using rsync it’s possible to create incremental backups for your whole server, but since good backup storage is often not cheap we want to backup only the important data. The whole backup process is about:
* We create a weekly or monthly backup using the native DirectAdmin functions
* We need to create a script to export MySQL data dump file from all databases
* We need to create a script that copies all files to a remote location using rsync
* We need to create a CRON job for both scripts
* We need to check the backup vitality ones a week or month
It’s up to you if you want to create a monthly or weekly backup within DirectAdmin (the same for how often you check your backups). Run all backup tasks in a time frame where most of your visitors are offline.
Complete DirectAdmin user account backups ones in week or month
Login to DirectAdmin as the admin and follow the link “Admin Backup/Transfer” and select those users you like to backup. For the option “CRON Schedule” choose a moment where your visitors are offline and enter the remote backup location (EVBackup from ExaVault is a service we use) for the FTP login form. Click the submit button and your backup is created ones a month or week. You get a mail message when a backup is created.
Create MySQL dump files from all databases
There is a global admin account for the MySQL service on your DA server, you can find the user name and password in: /usr/local/directadmin/conf/
Using this login/password, it’s possible to create MySQL dumps for all databases on your server. Create a file with the following code and name it dbbackup.sh.
#!/bin/sh
DBUSER=”da_admin”
DBHOST=”localhost”
DBPASS=”thepassword”
BACKUPDIR=”dbbackup”
DBS=`mysql -u$DBUSER -h$DBHOST -p$DBPASS -e”show databases”`
for DATABASE in $DBS
do
if [ $DATABASE != "Database" ]; then
FILENAME=$DATABASE.gz
mysqldump -u$DBUSER -h$DBHOST -p$DBPASS $DATABASE | gzip –best > $BACKUPDIR/$FILENAME
fi
done
Save the file in the /home/admin/ directory and create in the same directory another one called “dbbackup”. If you run this script from the command line, all gzipped MySQL dump files are created inside the new created directory.
Copy your files using rsync
Before you can start using rsync you need to setup a private key which is needed for the SSH connection. Enter the following commands via the command line from your server:
#sudo ssh-keygen -f /home/admin/ssh_key -t rsa -N ”
#sudo rsync -e ssh /home/admin/ssh_key.pub username@username.exavault.com:ssh_keys/key1.pub
#ssh username@username.exavault.com addkeys
The commands are based on the instructions from the Exavault website, check their tutorial for further information. Next we need to create a script which will synchronize your files with those files on your remote backup location, create a file under the name databackup.sh inside your admin’s home directory with this code:
rsync -avz –delete –one-file-system -e “ssh -i /ssh_key” “/home” USERNAME@USERNAME.exavault.com:backup-1
rsync -avz –delete –one-file-system -e “ssh -i /ssh_key” “/home/admin/dbbackup” USERNAME@USERNAME.exavault.com:backup-1
The first command will copy all user directories to the remote backup location and the second one will copy all MySQL dump files.
Unlimited Online backup for 4.95/month
Create CRON jobs for your daily backups
The last step we need to do is the setup of some CRON jobs. Login to the console and edit the root’s crontab file with: sudo crontab -e
Next add these two CRON jobs to the list and the CRON demon will create at 5am the MySQL dump files first and than 30 minutes later the data backup script is executed:
0 5 * * * sh /home/admin/backup/dbbackup.sh
30 5 * * * sh /home/admin/backup/databackup.sh
That’s all, don’t forget to test all your backups frequently!
2011年07月18日
如何用商品图片批量处理模块
商品图片批量处理模块可以自动处理商品图片为三种尺寸的图片,也就是 小,中,大
首先我们做些准备工作
1. 什么是小图?中图?大图?
小图:就是商品列表的图片,其大小有图像参数菜单中,小图的宽,高都有设定,系统假定,凡是所有等于尺寸的图片,均属于小图,例如下面的新进商品图片….通常其尺寸都和小图相同。除非基于某种特殊需要。尺寸通常150×150左右
中图:商品信息页面中商品图像的大小,全站只有这里用到,通常都要在300×300左右,数字仅供你判断事做参考
大图:商品信息页面中商品图像放大后的大小,根据我的模块,这里有可能有两个尺寸:1.点击后放大,在图像参数菜单中有大图像的尺寸设置。2.鼠标移上去后局部放大镜,在 jqzoom 菜单里有该尺寸;这两个尺寸应该都在 500×500 以上。上述两个尺寸,外加上 image manager 菜单下,最大图像尺寸,应该三者都一致!
2011年04月29日
zen cart 一个安全漏洞的描述
实际上,zen cart 存在一个致命的安全问题,尤其是早期版本。非常容易被人轻易入侵。
骇客可以通过 Zen cart 后台集成的编辑器 FCKeditor的上传功能,植入木马到 images 目录,然后再进行种种操作
该文件位于
/editors/fckeditor/editor/filemanager/upload/php/upload.php
建议:
1. 将该文件改名或删除。
2. images 目录禁止写权限
3. 在 images 目录中,以及images下的所有子目录都上传一个文件,名为 .htaccess 内容如下
# deny *everything*
Order Allow,Deny
Deny from all
# but now allow just *certain* necessary files:
Order Allow,Deny
Allow from all
IndexIgnore */*
并将该文件权限改为444
/bmz_cache/内也可以上传该文件
2011年02月26日
后台模块:增强的属性复制功能,复制任一商品的属性到任意多个商品。
zen cart的属性复制功能已然强大,但由于批复制只能针对某一分类或者全体,对于想局部批复制到几个商品,或者跨几个分类的几个商品,无疑还不够灵活。
Weber(qq:344109424) 在分析了zen cart 批复制的机制后,开发了这个模块。
功能:
将某一商品的属性完全复制到指定的任意商品,分类,这里的分类不局限于底层分类,而是任意分类都可以。
做法:首先做个链接,如下图

接下来完成:

中间过程:
首先界面:
如果产品不是很多:
直接做全部商品的下拉(或者多选)就行了。zen cart 本身就有,改一下就可以。
如果产品分类比较多:
首先做个全部分类的下拉,提交分类的ID
onchange 事件, ['server_uri'] 去掉当前分类ID并 + this.value 即可,刷新页面。
下面做个递归调用,以显示某个分类下的所有商品;
1. 首先递归,计算该分类下所有最内层的分类。
2. 找出这些内层分类的所有商品。
从完善的角度看,加个 check all, uncheck all 也就是举手之劳
2010年12月5日
让zen cart 的css 按钮支援 png 图片
很特别的是,zen cart 的 按钮默认是gif 格式,如果使用 png 格式当然也可以。但如果
一个按钮图片名称 是例如 b_search.png,当我们切换到CSS按钮的时候,发现这时css按钮的class居然是 b_search.png 而不是正常的b_search
解决的办法很简单
$sec_class = basename($image, ‘.gif’);
改为
$sec_class = basename($image, substr($image,strripos($image,’.')));
就可以了
2010年12月2日
2010年11月25日
zen cart 在图像说明文字过长时(30) 避免以 css方式显示 图像(非按钮)
html_output.php
$zco_notifier->notify(‘PAGE_OUTPUT_IMAGE_BUTTON’);
if (strtolower(IMAGE_USE_CSS_BUTTONS) == ‘yes’ && strlen($alt)<30) return zenCssButton($image, $alt, 'button', $sec_class, $parameters = '');
return zen_image($template->get_template_dir($image, DIR_WS_TEMPLATE, $current_page_base, ‘buttons/’ . $_SESSION['language'] . ‘/’) . $image, $alt, ”, ”, $parameters);
}
2010年11月21日
中文后台的 zen cart,
admin/includes/languages/english/email_extras.php 和 orders.php, password_forgotten.php, customers.php
