This hack is to add a reminder message at the heading area when members have not yet got their Email validation done.
1. includes/lib_main.php
Find the following codes:
<blockquote>$sql = 'SELECT u.user_id, u.email, u.user_name, u.user_money, u.pay_points'.
' FROM ' .$GLOBALS['ecs']->table('users'). ' AS u ' .
" WHERE u.user_id = '$id'";</blockquote>
add “u.is_validated” into the select strings.
2. themes/theme name/library/member_info.lbi
Add following code at where you want to show the message.
<!--{if $user_info.is_validated eq 0} -->
<font>You have not yet completed Email validation, please validate your Email in member center.</font>
<!--{/if} -->
mysql –user=YOUR_USERNAME –password=YOUR_PASSWORD -BNe “show tables” YOUR_DBSCHEMA_NAME | tr ‘\n’ ‘,’ | sed -e ‘s/,$//’ | awk ‘{print “SET FOREIGN_KEY_CHECKS = 0;DROP TABLE IF EXISTS ” $1 “;SET FOREIGN_KEY_CHECKS = 1;”}’ | mysql –user=YOUR_USERNAME –password=YOUR_PASSWORD YOUR_DBSCHEMA_NAME
Add follow code to index.php
if ($_SERVER['REMOTE_ADDR'] != '192.168.1.100')
{
require 'down.htm';
die();
}
The code will redirect visitors from all IPs except for 192.168.1.100 to down.htm page.
flush cache
rm -rf var/cache/ var/session/ var/report/
Backup files from public_html/magento directory
tar -zcf filename.tar.gz
Read more…
| Symbol 符號 |
Description 說明 |
Chinese 中文/中式說法 |
| ~ |
Tilde |
取代符號/毛毛蟲 |
| ! |
Exclamation point |
驚歎號 |
| @ |
At sign, at |
At符號/小老鼠 |
| # |
Number sign |
數字符號/井號 |
| £ |
Pound sign |
英鎊符號 |
| $ |
Dollar sign |
錢符號 |
| % |
Percent, percent sign |
百分比,百分比符號 |
| ^ |
Caret |
脫字符號/小三角 |
| & |
Ampersand |
And符號 |
| * |
Asterisk |
星號/米字號 |
| ( |
Open parenthesis |
左括號 |
| ) |
Close parenthesis |
右括號 |
| – |
Dash |
破折號 |
| — |
Double dash |
雙破折號 |
| _ |
Underscore |
底線 |
| + |
Plus, plus sign |
加,加號 |
| = |
Equals |
等號 |
| | |
Vertical bar |
垂直線/直線號 |
| \ |
Backslash |
反斜線 |
| { |
Open brace |
左大括號 |
| } |
Close brace |
右大括號 |
| [ |
Open bracket |
左方括號 |
| ] |
Close bracket |
右方括號 |
| : |
Colon |
冒號 |
| ; |
Semicolon |
分號 |
| “ |
Quote |
雙引號 |
| ‘ |
Single quote |
單引號 |
| , |
Comma |
逗號 |
| . |
Period, dot |
句號,點 |
| > |
Greater than |
大於 |
| < |
Less than |
小於 |
| ? |
Question mark |
問號 |
| / |
Slash |
斜線 |
| // |
Double slash |
雙斜線 |
| … |
Ellipsis |
省略符號/點點點 |
| - |
Hyphen |
連字號 |
符號表引用自頂客論壇:http://www.dk101.com/Discuz/viewthread.php?tid=116102
The following steps are how to dump the whole database of a MySql server and then restore them:
- Dump all databases by calling:
mysqldump -uroot -p –extended-insert –all-databases –add-drop-database –disable-keys –flush-privileges –quick –routines –triggers > all-databases.sql
- Stop the MySQL server;
- Rename or remove (in case you’ve already backed it up) the MySQL data directory;
- Make the appropriate changes in my.cnf;
- Re-initialize the database with the following command:
mysql_install_db
- Start the MySQL server;
- Get into the ‘mysql‘ console and type:
SET FOREIGN_KEY_CHECKS=0;
SOURCE all-databases.sql;
SET FOREIGN_KEY_CHECKS=1;
- Restart the MySQL server.
MySQL: How to Force MySql Drop Tables with Foreign Key
mysql> SET foreign_key_checks = 0;
mysql> drop table …
mysql> SET foreign_key_checks = 1;