Thứ Bảy, 31 tháng 8, 2013

Cách cài đặt Webserver : Apache2, PHP5, phpMyAdmin trên Linux Mint 15

Posted by Z-CLICK Thứ Bảy, tháng 8 31, 2013, under | No comments

I . Cài đặt Apache2 ( Installing Apache 2):
1. Cài đặt :
Mở Terminal lên, tại dấu nhắt đợi lệnh, gõ :
sudo apt-get install apache2
gõ Enter
sau đó terminal hỏi password ,nhập pass vào
gõ Enter
sau đó pha tách trà ngồi nhăm nhi, phì phà điếu thuốc chờ quá trình cài đặt.
Khi quá trình cài đặt kết thúc ,bạn reset lại apache2 bằng lệnh sau :
sudo /etc/init.d/apache2 restart
hoặc :
sudo service apache2 restart

2. Kiểm tra Apache 2 cài thành công chưa (Checking Apache 2 installation):
Mở trình duyệt lên, gõ vào thanh địa chỉ :
gõ Enter
nếu bạn thấy có các dòng chữ sau thì bạn đã cài thành công
! It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.

3. Sửa lỗi Apache2 ( Troubleshooting Apache2 ):
a. thấy có thông báo : could not determine the server's fully qualified domain name
tại terminal gõ:
gksu "gedit /etc/apache2/conf.d/fqdn"
sau đó copy và pass dòng sau vào, save lại :
ServerName localhost
b. lỗi đường dẫn : trong terminal gõ lệnh sau:
gksudo gedit /etc/ apache2/sites-available/mysite
tìm đến dòng :"DocumentRoot" thay phía sau nó thành "/var/www/" , dòng "<Directory " thay phía sau thành "/var/www/> " ,sau đó save lại .
gõ tiếp :
sudo a2dissite default
Enter
sudo a2ensite mysite
Enter
sudo /etc/init.d/apache2 restart
Enter
echo '<b>Hello! It is working!</b>' > /war/www/trangchu.html
mở trình duyệt :http://localhost , hoặc http://127.0.0.1
Chú ý: khi bạn không đủ quyền thưc thi thư mục nào đó ( đọc, ghi ,tạo ,xoá ) thì bạn nên dùng quyền superuser để phân quyền cho user.

II . Cài đặt PHP5 ( Installing PHP 5 ):
1. Cài PHP 5:
Mở terminal lên và gõ :
sudo apt-get install php5
Entersudo a2enmod php5
Enter
sudo cp /etc/apache2/mods-enabled/php5 /etc/apache2/mods-availble/php5
Enter
Mở file php.ini bàng quyền root, đổi "short_open_tag = on" thành "short_open_tag = off" , rồi save lại :
gksudo gedit /etc/php5/apache2/php.ini
Sau cùng rà reset lại server:
sudo service apache2 restart
2. Kiểm tra PHP5 ( Checking PHP 5 installation):
Trong thư mục "var/www", tạo file " test.php" , có nội dung " <?php May ha buoi ! ; ?> " . Sau đó mở trình duyệt, gõ :http://localhost/test.php ", nếu xuất hiện nội dung " May ha buoi " thì bạn cài thành công PHP5 rồi .

Sau khi cài xong bạn gõ tiếp 2 lệnh sau trong terminal:
sudo mv /etc/php5/apache2/php.ini /etc/php5/apache2/php.ini.bak
sudo cp -s /usr/share/php5/php.ini-development /etc/php5/apache2/php.ini

III . Cài đặt phpMyAdmin ( Installing phpMyAdmin ):
1. Cài đặt (install ):
Mở terminal, gõ vào :
mysql-server libapache2-mod-auth-mysql php5-mysql
Enter
gksu "gedit /etc/mysql/my.cnf"
Enter
sau đó tìm đến dòng " bind-address = localhost " thay bàng "bind-address = IP ( của máy bạn ) " ,rồi save lại.
mysql -u root -p
mysql> SET PASSWORD FOR 'root'@'localhost' = PASSWORD('password_de dang nhap phpmyadmin ')
Enter
Sau đó mở trình duyệt lên gõ : http://localhost/phpmyadmin để xem kết quả .

2. Kiểm tra :

Cách cài Unikey ,MS Office 2007 trên Linx Mint 15 để gõ Tiếng Việt

Posted by Z-CLICK Thứ Bảy, tháng 8 31, 2013, under | No comments

Mình không khuyến khích các bạn cài đặt MS Office 2007 trên Linux-Ubuntu nha !
Topic này hướng dẫn cài bộ MS Office 2007 trên Linux Mint 15 , bộ hỗ trợ gõ tiếng Việt Unikey , để chúng ta sử dụng khi ta dùng Linux, Ubuntu mà muốn các tính năng chuyên dụng của văn phòng MS Office 2007 trên Windows vậy .

1. Cài đặt Wine:
- Tại cửa sổ Terminal, gõ lệnh:
sudo apt-get install wine
2. Cài dặt Winetricks:
- Tại cửa sổ dòng lệnh Terminal, gõ lệnh:
- Sau khi hoàn thành, tiếp tục câu lệnh sau:
sudo apt-get install cabextract
sh winetricks corefonts tahoma vcrun2005sp1 wsh56js
- Chọn Yes để tiếp tục cài đặt Visual C++
- Tiếp tục chọn Yes để bắt đầu cài đặt Windows Script 5.6:
3. Thiết lập Wine:
- Gõ lệnh sau tại cửa sổ Terminal:
winecfg
- Chuyển tới thẻ Libraries:
- Tại ô New override for libraries, điền giá trị riched20 và nhấn nút Add
- Sau đó chọn tiếp Edit, tiếp tục lựa chọn “Native (Windows)” và OK
Điền tiếp giá trị usp10 vào ô New override for libraries, sau đó nhấn OK để kết thúc quá trình thiết lập thông số cho Wine.
4. Cài đặt Microsoft Office 2007:
- Cho đĩa cài đặt Microsoft Office 2007 vào ổ đĩa CD/DVD ( nếu không có các bạn tìm tải trên mạng bảng full nha ), tìm file setup.exe
- Kích chuột phải và chọn Open with other application, tiếp theo chọn Wine Windows Program Loader, và tiếp tục như khi cài đặt 1 ứng dụng bình thường trong môi trường Microsoft Windows.
- Điền số serial đăng ký, chọn Accept the User Agreement, nhấn nút Install Now để bắt đầu cài đặt( phần này giống cài trên Windows ).
5. Cài đặt Unikey ( bảng dùng cho Windows ):
- Tải UniKey Portable từ trang :
- Bun nén ra ,copy vào thư mực Program Files của wine ( Menu -> wine ->Brown :C Drive -> Program Files )
6. Demo :
- Mở Unikey bằng wine ->n thiết lập kiểu gõ -> đóng lại -> cho hiện trên thanh Panel ( lúc này bạn tắtibus-unikey nha : kích vào biểu tượng trên thanh Panel -> chọn " Input method Off " )
Mở MS Office ( MS Word 2007 chẳn hạn ) và tiến hành gõ tiếng Việt như ở Windows .

Thứ Tư, 3 tháng 7, 2013

Menu đa cấp với CSS3 cho Web - Blog

Posted by Z-CLICK Thứ Tư, tháng 7 03, 2013, under | 1 comment

  Bài này mình hương dẫn bạn tạo menu da cấp giống blog của mình chỉ dùng CSS không dùng jQuery mà mình thấy vẫn đẹp.
 1. Web: bạn nên tạo 2 file để khi nào cần chỉnh sửa thị dễ thực hiện  :

CSS :
body {
font: normal .8em/1.5em Arial, Helvetica, sans-serif;
background: #ebebeb;
width: 900px;
margin: 100px auto;
color: #666;
}
a {
color: #333;
}
#nav {
margin: 0;
padding: 7px 6px 0;
line-height: 100%;
border-radius: 2em;

-webkit-border-radius: 2em;
-moz-border-radius: 2em;

-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);

background: #8b8b8b; /* for non-css3 browsers */
filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#a9a9a9', endColorstr='#7a7a7a'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#00CC66), to(#7a7a7a)); /* for webkit browsers */
background: -moz-linear-gradient(top,  #a9a9a9,  #7a7a7a); /* for firefox 3.6+ */

border: solid 1px #6d6d6d;
}
#nav li {
margin: 0 5px;
padding: 0 0 8px;
float: left;
position: relative;
list-style: none;
}
/* main level link */
#nav a {
font-weight: bold;
color: #e7e5e5;
text-decoration: none;
display: block;
padding:  8px 20px;
margin: 0;
-webkit-border-radius: 1.6em;
-moz-border-radius: 1.6em;
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
/* main level link hover */
#nav .current a, #nav li:hover > a {
background: #d1d1d1; /* for non-css3 browsers */
filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#66CC00), to(#a1a1a1)); /* for webkit browsers */
background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */

color: #444;
border-top: solid 1px #f8f8f8;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
/* sub levels link hover */
#nav ul li:hover a, #nav li:hover li a {
background: none;
border: none;
color: #666;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
#nav ul a:hover {
background: #0399d4 !important; /* for non-css3 browsers */
filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#04acec', endColorstr='#0186ba'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#66CC00), to(#0186ba)) !important; /* for webkit browsers */
background: -moz-linear-gradient(top,  #04acec,  #0186ba) !important; /* for firefox 3.6+ */

color: #fff !important;
-webkit-border-radius: 0;
-moz-border-radius: 0;
text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
/* level 2 list */
#nav ul {
background: #ddd; /* for non-css3 browsers */
filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cfcfcf'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#3D3D3D), to(#cfcfcf)); /* for webkit browsers */
background: -moz-linear-gradient(top,  #fff,  #cfcfcf); /* for firefox 3.6+ */

display: none;
margin: 0;
padding: 0;
width: 185px;
position: absolute;
top: 35px;
left: 0;
border: solid 1px #b4b4b4;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* dropdown */
#nav li:hover > ul {
display: block;
}
#nav ul li {
float: none;
margin: 0;
padding: 0;
}
#nav ul a {
font-weight: normal;
text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}
/* level 3+ list */
#nav ul ul {
left: 181px;
top: -3px;
}
/* rounded corners for first and last child */
#nav ul li:first-child > a {
-webkit-border-top-left-radius: 9px;
-moz-border-radius-topleft: 9px;
-webkit-border-top-right-radius: 9px;
-moz-border-radius-topright: 9px;
}
#nav ul li:last-child > a {
-webkit-border-bottom-left-radius: 9px;
-moz-border-radius-bottomleft: 9px;
-webkit-border-bottom-right-radius: 9px;
-moz-border-radius-bottomright: 9px;
}
/* clearfix */
#nav:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#nav {
display: inline-block;
}
html[xmlns] #nav {
display: block;
}
* html #nav {
height: 1%;
}

HTML:

<body>
    <div>
    <ul id="nav">
<li class="current"><a href="http://toantinit.blogspot.com/">Home</a></li>
<li><a href=""> Mathematics </a>
<ul>
             <li><a href="">Elementary</a>
     <ul>
<li><a href="">Number natural</a></li>
<li><a href=""> Number fraction</a></li>
<li><a href="">The total signal</a></li>
<li><a href="">The total ratio</a></li>
     </ul>
    </li>
    <li><a href="">High School</a>
<ul>
 <li><a href="">Design Wall</a></li>
</ul>
     </li>
    <li><a href="">College University
</a></li>
   <li><a href="">Discrete Mathematics</a></li>
</ul>
</li>


<li><a href="#"> Informatics </a>
   <ul>
     <li><a href="#">Office</a>
<ul>
 <li><a href="#">MS Word</a></li>
  <li><a href="#">MS Excel</a>
                    <li><a href="#">MS Access</a></li>
                     <li><a href="#">MS </a>
   <ul> <li><a href="#">Sub-Level Item</a></li>
<li><a href="#">Sub-Level Item</a></li>
<li><a href="#">Sub-Level Item</a></li>
  </ul>
 </li>
</li></ul>
</li>
             <li><a href="#">Programming C++</a></li>
        <li><a href="#">Programming Java</a></li>
<li><a href="#">Design Web</a></li>
<li><a href="#">Network Security</a>
<ul>
<li><a href="#">Sub-Level Item</a></li>
<li><a href="#">Sub-Level Item</a></li>
<li><a href="#">Sub-Level Item</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">About</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>
</body>

2. Blog : bạn đăng nhập vào blog, vào phần chỉnh sửa mẫu và tìm đến đoạn </head> , chèn đoạn code css sau vào trước nó :
body {
font: normal .8em/1.5em Arial, Helvetica, sans-serif;
background: #ebebeb;
width: 900px;
margin: 100px auto;
color: #666;
}
a {
color: #333;
}
#nav {
margin: 0;
padding: 7px 6px 0;
line-height: 100%;
border-radius: 2em;

-webkit-border-radius: 2em;
-moz-border-radius: 2em;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .4);

background: #8b8b8b; /* for non-css3 browsers */
filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#a9a9a9', endColorstr='#7a7a7a'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#00CC66), to(#7a7a7a)); /* for webkit browsers */
background: -moz-linear-gradient(top,  #a9a9a9,  #7a7a7a); /* for firefox 3.6+ */

border: solid 1px #6d6d6d;
}
#nav li {
margin: 0 5px;
padding: 0 0 8px;
float: left;
position: relative;
list-style: none;
}
/* main level link */
#nav a {
font-weight: bold;
color: #e7e5e5;
text-decoration: none;
display: block;
padding:  8px 20px;
margin: 0;
-webkit-border-radius: 1.6em;
-moz-border-radius: 1.6em;
text-shadow: 0 1px 1px rgba(0, 0, 0, .3);
}
/* main level link hover */
#nav .current a, #nav li:hover > a {
background: #d1d1d1; /* for non-css3 browsers */
filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ebebeb', endColorstr='#a1a1a1'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#66CC00), to(#a1a1a1)); /* for webkit browsers */
background: -moz-linear-gradient(top,  #ebebeb,  #a1a1a1); /* for firefox 3.6+ */

color: #444;
border-top: solid 1px #f8f8f8;
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
text-shadow: 0 1px 0 rgba(255, 255, 255, .8);
}
/* sub levels link hover */
#nav ul li:hover a, #nav li:hover li a {
background: none;
border: none;
color: #666;
-webkit-box-shadow: none;
-moz-box-shadow: none;
}
#nav ul a:hover {
background: #0399d4 !important; /* for non-css3 browsers */
filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#04acec', endColorstr='#0186ba'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#66CC00), to(#0186ba)) !important; /* for webkit browsers */
background: -moz-linear-gradient(top,  #04acec,  #0186ba) !important; /* for firefox 3.6+ */

color: #fff !important;
-webkit-border-radius: 0;
-moz-border-radius: 0;
text-shadow: 0 1px 1px rgba(0, 0, 0, .1);
}
/* level 2 list */
#nav ul {
background: #ddd; /* for non-css3 browsers */
filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#cfcfcf'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#3D3D3D), to(#cfcfcf)); /* for webkit browsers */
background: -moz-linear-gradient(top,  #fff,  #cfcfcf); /* for firefox 3.6+ */

display: none;
margin: 0;
padding: 0;
width: 185px;
position: absolute;
top: 35px;
left: 0;
border: solid 1px #b4b4b4;
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
-webkit-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
-moz-box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
/* dropdown */
#nav li:hover > ul {
display: block;
}
#nav ul li {
float: none;
margin: 0;
padding: 0;
}
#nav ul a {
font-weight: normal;
text-shadow: 0 1px 1px rgba(255, 255, 255, .9);
}
/* level 3+ list */
#nav ul ul {
left: 181px;
top: -3px;
}
/* rounded corners for first and last child */
#nav ul li:first-child > a {
-webkit-border-top-left-radius: 9px;
-moz-border-radius-topleft: 9px;
-webkit-border-top-right-radius: 9px;
-moz-border-radius-topright: 9px;
}
#nav ul li:last-child > a {
-webkit-border-bottom-left-radius: 9px;
-moz-border-radius-bottomleft: 9px;
-webkit-border-bottom-right-radius: 9px;
-moz-border-radius-bottomright: 9px;
}
/* clearfix */
#nav:after {
content: ".";
display: block;
clear: both;
visibility: hidden;
line-height: 0;
height: 0;
}
#nav {
display: inline-block;
}
html[xmlns] #nav {
display: block;
}
* html #nav {
height: 1%;
}

Sau đó bạn vào phần bố cục, chọn thêm phần tử, thêm Java Script và chèn đoạn code sau vào :
<div>
    <ul id="nav">
<li class="current"><a href="http://toantinit.blogspot.com/">Home</a></li>
<li><a href=""> Mathematics </a>
<ul>
             <li><a href="">Elementary</a>
     <ul>
<li><a href="">Number natural</a></li>
<li><a href=""> Number fraction</a></li>
<li><a href="">The total signal</a></li>
<li><a href="">The total ratio</a></li>
     </ul>
    </li>
    <li><a href="">High School</a>
<ul>
 <li><a href="">Design Wall</a></li>
</ul>
     </li>
    <li><a href="">College University
</a></li>
   <li><a href="">Discrete Mathematics</a></li>
</ul>
</li>


<li><a href="#"> Informatics </a>
   <ul>
     <li><a href="#">Office</a>
<ul>
 <li><a href="#">MS Word</a></li>
  <li><a href="#">MS Excel</a>
                    <li><a href="#">MS Access</a></li>
                     <li><a href="#">MS </a>
   <ul> <li><a href="#">Sub-Level Item</a></li>
<li><a href="#">Sub-Level Item</a></li>
<li><a href="#">Sub-Level Item</a></li>
  </ul>
 </li>
</li></ul>
</li>
             <li><a href="#">Programming C++</a></li>
        <li><a href="#">Programming Java</a></li>
<li><a href="#">Design Web</a></li>
<li><a href="#">Network Security</a>
<ul>
<li><a href="#">Sub-Level Item</a></li>
<li><a href="#">Sub-Level Item</a></li>
<li><a href="#">Sub-Level Item</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">About</a></li>
<li><a href="#">Contact Us</a></li>
</ul>
</div>

3. Demo :


Thứ Ba, 26 tháng 3, 2013

Tích Hợp Nhiều Kiểu Gõ Cho UniKey-4.0 RC 2

Posted by Z-CLICK Thứ Ba, tháng 3 26, 2013, under | No comments

Vấn đề là chúng ta có một cái máy tinh nhưng nhiều người sử dụng va mõi người lại thạo một kiều gõ khác nhau.  Vậy làm sao mà ta chỉ cần Open UniKey lên là gõ mà không cần phải chuyển đổi giữa các kiểu gõ.
Ok cách làm khá dơn giản như sau:
1. Ghi  File kiểu gõ :
Mở : "UniKey-4.0RC2" lên:
 a. Kiểu gõ :-> chọn " Tự định nghĩa " -> nhấp chọn " ..." -> hiện ra hộp thoại mở rộng ->  ở phần " Nạp kiểu gõ " -> chọn " Telex " ( chẳn hạn ) -> sau đó nhấp vào nút " Ghi file ..." ->đặt tên file là " keymap_1.txt" ->Save.
b. Kiểu gõ :-> chọn " Tự định nghĩa " -> nhấp chọn " ..." -> hiện ra hộp thoại mở rộng ->  ở phần " Nạp kiểu gõ " -> chọn " VNI " ( chẳn hạn ) -> sau đó nhấp vào nút " Ghi file ..." ->đặt tên file là " keymap_2.txt" ->Save.
2. Tổng hợp nội dung các file thành 1 file :
a. Tạo file "keymap.txt" ở một trí bất kỳ trên máy tính. ( file này chưa có nội dung gì hết )
b. Mở file "keymap_1.txt" ra, copy nội dung nó, dán vô file "keymap.txt".
c. Mở file "keymap_2.txt" ra, copy nội dung nó, dán vô file "keymap.txt". ( nội dung này nằm dưới nội dung file "keymap_1.txt" )
d. Save file"keymap.txt" lại.
3. Chép đè nội dung file:
 Bây giời chúng ta copy file "keymap.txt" đến thư muc cài đặt "Unikey", đè lên file "keymap.txt" có sẵn trong thư mục đó.
4. Nạp kiểu gõ :
a .Mở : "UniKey-4.0RC2" lên:
b. Kiểu gõ :-> chọn " Tự định nghĩa " -> nhấp chọn " ..." -> hiện ra hộp thoại mở rộng -> nhấp chọn "Chọn file ..." -> ta chọn file "keymap.txt"-> "Open".
c. Nhấp nút "Lư trữ" -> ta thu nhỏ Chương trình Unikey lại va mở chương soạn thảo ra thử xem ta gõ được 2 loại kiểu gõ mà không cẩn chuyển đổi qua lại các kiểu gõ .


Nội dung file "keymap.txt" như sau:

; This is UniKey user-defined key mapping file, generated from UniKey (Windows)
0 = Tone0
1 = Tone1
2 = Tone2
3 = Tone3
4 = Tone4
5 = Tone5
6 = Roof-All
7 = Hook-UO
8 = Bowl
9 = D-Mark
Z = Tone0
S = Tone1
F = Tone2
R = Tone3
X = Tone4
J = Tone5
W = Telex-W
A = Roof-A
E = Roof-E
O = Roof-O
D = D-Mark
[ = o+
] = u+
{ = O+
} = U+



Hiện File Bị Ẩn Khi Nhiễm Virus ( đã diệt xong virus)

Posted by Z-CLICK Thứ Ba, tháng 3 26, 2013, under | No comments

Virus sau khi nhiễm vào máy tính của bạn thì chúng thục hiện một số thao tác nhất dịnh nào đó mà chủ sở hữu nó có ý định cụ thể. Thao tác là thực hiện những lệnh quản lý, điều khiển HDH. Ở Windows thao tác là " Registry" .
Sau khi diệt xong virú mà không hiện lập tin thì bạn vào :
Run -> gõ " regedit" -> tìm đến khóa sau: Hkey_local_machine\Software\Microsoft\Windows\Curr ent Version\ Explorer \ advanced\ Folder\ hiden\show all
Chọn: Default -> gõ 1
Chọn : checkedValie -> gõ 1
DefailtValie -> gõ 1



Thứ Năm, 21 tháng 2, 2013

Tóm tắt Toán lớp 11

Posted by Z-CLICK Thứ Năm, tháng 2 21, 2013, under | No comments

Thứ Năm, 26 tháng 7, 2012

Add Công Cụ Định Dạng Văn Bản Kind Editor Vào Forums

Posted by Z-CLICK Thứ Năm, tháng 7 26, 2012, under | No comments

Vấn đề là nếu chúng ta tạo 1 cái forum bằng code PHP thì nó  không có công cụ gì cho việc đinh dạng văn bản như : tô màu chữ, màu nền , .. , chèn hình ảnh , công thức toán nè ... thế thì cái forum của chúng ta nó quá điệu ( hay nó quá cùi ) . Vậy làm sao ta có được những thứ kể trên, ta dùng công cụ "  Kind Editor " , đây là chương trình định dạng văn bảng "free", các bạn tìm và tải nó trên mạng , sau khi tải về bạn giải nén ra  và thưc  hiện những bước sau:
1. Chép toàn bộ thư mục giải nén vào thư mục web root .

2. Vào thư mục "examples" của thư mục vừa copy trên, bạn sẽ  thấy rất nhiều file " *.html " và 1 file "index.css" . Mõi file " *.html" nó sẽ  cung cấp cho bạn cách đinh dạng khác nhau, ở đây mình chọn file " full mode ... .html " file này mình chọn là vì thấy nó cung cấp khá đầy đủ tính năng, những file " *.html" còn lại bạn không dùng có thể xóa bỏ để giảm dung lượng. Chú trọng phần chữ đỏ.

3. View code file " full mode... .html" sẽ có dạng như sau :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  <title>KindEditor</title>
  <style type="text/css" rel="stylesheet">
    form {
        margin: 0;
    }
    .editor {
        margin-top: 5px;
        margin-bottom: 5px;
    }
  </style>
  <script type="text/javascript" charset="utf-8" src="./../kindeditor.js"></script>
  <script type="text/javascript">
    KE.show({
        id : 'content1',
        cssPath : './index.css'
    });
  </script>

</head>
<body>

<h3>Default Mode</h3>
<form name="example" method="post" action="./../php/demo.php">
<div class="editor">
<textarea id="content1" name="content" tyle="width:530px;height:300px;visibility:hidden;">


<p>
Kind editor is a powerful yet easy to use, online web-base html editor, which allows users to edit web page in WYSIWYG way. It is compatible with IE, Firefox, Chrome, Safari, Opera and other popular browsers over different platforms.<br />
Written in Javascript, Kind editor could be integrated with any backend technology, such as Java, .NET, PHP, ASP and RoR.
Kind editor has been widely used in different CMS(Content Management System), shopping, forum, blog, wiki, email and other web based applications.  
With excellent user experience, it is becoming one of the most poplular editors.
</p>
</textarea>
</div>
<input type="button" name="button" value="Formate Text"
onclick="javascript:alert(KE.util.getData('content1'));" />
    <input type="button" name="button" value="Plain Text" onclick="javascript:alert(KE.util.getPureData('content1'));" />
    <input type="submit" name="button" value="Submit" />
  </form>
</body>
</html>
4. Đặt đoạn code sau vào phần " <head>... </head> " của file chứa form nhập liệu :
<style type="text/css" rel="stylesheet">    form {        margin: 0;    }    .editor {        margin-top: 5px;        margin-bottom: 5px;    }  </style>  <script type="text/javascript" charset="utf-8" src="./../kindeditor.js"></script> // thay doi duong dan theo web root cua ban */  <script type="text/javascript">    KE.show({        id : 'content1',        cssPath : './index.css' /* thay doi duong dan chua file  inde.css theo web root cua ban */    });  </script>



5. Thay thế form nhập liệu của bạn bằng form sau, chú ý <textarea id="content1" name="content" tyle="width:530px;height:300px;visibility:hidden;"> nên thay đổi phần "width " "height " cho phù hợp, nhớ tên name="" của thẻ " </textarea> </textarea> " ở form nhập liệu lúc đầu của bạn để sau này biết mà gọi biến để lấy giá trị . Sau đó dổi action="./../php/demo.php" như form lúc đầu của bạn.

<form name="example" method="post" action=" ./../php/demo.php"> /* thay doi cho phu hop */
<div class="editor">

<textarea id="content1" name="content" tyle="width:530px;height:300px;visibility:hidden;">
</textarea>

</div>
<input type="button" name="button" value="Formate Text"



6. Vào thư mục " php " ở thư mục copy trên , view code fiel "demo.php" sẽ thấy như sau 

:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>KindEditor 3.0</title><meta http-equiv="content-type"
content="text/html; charset=utf-8" />
<link href="../examples/index.css" rel="stylesheet" type="text/css" />
<link href="../skins/common/editor.css" rel="stylesheet" type="text/css" />

</head>
<body>
<div class="ke-content"><?php
if (get_magic_quotes_gpc()) {
echo(stripslashes($_POST['content']));
} else {
echo($_POST['content']);
}

?>
</div><center><br /><br /><input type="button" value="Go Back" onclick="javascript:history.back();" /></center>
</body>
</html>


7. Đặt đoạn code sau vào phần  đầu của file mà form " acction = " tới , nhớ thay đổi đường dẫn các file " *.css" cho phù hợp. 
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link href="../examples/index.css" rel="stylesheet" type="text/css" />
<link href="../skins/common/editor.css" rel="stylesheet" type="text/css" />
8. Đặt đoạn code sau vào trước phần xuất dữ liệu hoặc trước khi đưa dữ liệu vào table - CSDL của Server, giả sử bạn có tên name="replay_topic" của thẻ " </textarea> </textarea> " ở form nhập liệu lúc đầu , khi đưa vào CCSDL là $_POST['replay_topic'] .
if (get_magic_quotes_gpc()) {
$tmp=stripslashes($_POST['content']);
} else {
$tmp=$_POST['content'];
}
           $_POST['replay_topic'] =$tmp;

9. Demo : Khi nào rãnh mình demo sau nha : ))



Xem Nhiều

Bài đăng phổ biến

Lưu trữ blog

Blog Archive