Hãy đăng nhập để được xem nhiều hơn nhé
Bạn phải đăng nhập để xem được nội dung, nếu bạn chưa có tài khoản? hãy Đăng ký
x
Điều trước hết đòi hỏi bạn phải có một Tài khoản của Google Mail, nếu chưa có thì tạo
một cái, nếu có rồi thì thôi!
https://www.google.com/accounts/NewAccount
Sau đó bạn vào trang này: http://www.google.com/cse/manage/create, nhập tài khoản
Google Mail vào
Nhấn vào: Create a new search engine
Bước 1: Điền thông tin vào
Mấy phần khác bạn thích điền sao cũng được.
Phần quan trọng là Sites to search: bạn điền dạng *.domain.com
Chổ Select an edition chọn Standard edition
Check vào I have read and agree to the Terms of Service.
Xong xuôi nhấn Next
Bạn nhấn tiếp Finish để hoàn thành.
Nếu bạn không muốn tạo tài khoản hãy copy đoạn code sau và pase vào
- <form action="http://www.google.com" id="cse-search-box">
- <div>
- <input type="hidden" name="cx" value="partner-pub-9336060018098366:9465865832" />
- <input type="hidden" name="ie" value="UTF-8" />
- <input type="text" name="q" size="100" />
- <input type="submit" name="sa" value="Search" />
- </div>
- </form>
- <script type="text/javascript" src="http://www.google.com/jsapi"></script>
- <script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script>
- <script type="text/javascript" src="http://www.google.com/cse/t13n?form=cse-search-box&t13n_langs=en"></script>
- <script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
-
Sao chép mã
Tiếp theo bạn vào
Sign-up for an API Key - Google Loader - Google Code
để đăng ký API key cho web của bạn, chỉ cần điền tên site và bấm Genarate là xong.
Bạn lưu cái API key đó lại, vd của tớ là
ABQIAAAA6mP3nX8YLweV7sMpVlAXxTP4lxYL9SOIiwiOxMPdEWcZhGHvhR7QQNSE2VjqqKLC08l9RZ4xzw7IQ
Bước 2: Bạn trở lại chỗ khi nãy http://www.google.com/coop/manage/cse/ Bấm vào cái
chữ custom search element bên cạnh cái search vừa tạo.
Bạn lấy cái code search của nó trong cái ô thứ 2, của tớ là
007467129492176356747 0fvcnftvis
Điền các thông tin của
007467129492176356747 0fvcnftvis
(mà các bạn đã tạo) vào mẫu sau:
Phần 1
- <!-- Google Ajax search -->
- <form action="http://mocua.com/forum/"
- id="searchbox_007467129492176356747:x0fvcnftvis">
- <h3><strong><font size="+2" color="#FF0000">Hãy nhập vào
- để »</font></strong>
- <input type="hidden" name="cx" value="007467129492176356747:x0fvcnftvis"
- />
- <input type="hidden" name="cof" value="FORID:11" />
- <input type="text" name="q" size="50" />
- <input type="submit" name="sa" value=" TÌM KIẾM NGAY " />
- <font size="+2" color="#FF0000"> »các thông tin
- bạn cần</font> </h3>
- </form>
- <script type="text/javascript"
- src="http://www.google.com/coop/cse/brand?form=searchbox_00746712949217635674
- 7:x0fvcnftvis"></script>
- <div id="results_007467129492176356747:x0fvcnftvis" style="display:none">
- <div class="cse-closeResults">
- <a>× CLOSE </a>
- </div>
- <div class="cse-resultsContainer"></div>
- </div>
- <!-- /Google Ajax search -->
- </div>
Sao chép mã
Sau đó tìm phần search,
phần search thường nằm ở themes/folder/tên themes/
1. Một số trang thì phần search nằm ở file
library/search_form.lbi
và một số thì phần search nằm ở file
page_header.lbi
Tuy nhiên các bạn có thể tìm phần đó rất dễ
mở phần search ra và làm theo hướng dẫn tìm:
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
Sao chép mã
cho vào bên dƣới
- <style type="text/css">
- @import url([url]http://www.mocua.com/google/overlay.css[/url]);
- </style>
- <script src="http://www.google.com/uds/api?file=uds.js&v=1.0&key=ABQIAAAA6mP3nX8YLweV7sMpVlAXxTP4lxYL9SOIiwiOxMPdEWcZhGHvhR7QQNSE2VjqqKLC08l9RZ4xzw7IQ"
- type="text/javascript"></script>
- <script src="http://www.mocua.com/google/overlay.js"></script>
- <script type="text/javascript">
- function OnLoad() {
- new CSEOverlay("007467129492176356747:x0fvcnftvis",
- document.getElementById("searchbox_007467129492176356747:x0fvcnftvis"),
- document.getElementById("results_007467129492176356747:x0fvcnftvis"));
- }
- GSearch.setOnLoadCallback(OnLoad);
- </script
Sao chép mã
Tìm tiếp
<input name="keywords" type="text" id="keyword"
value="{$search_keywords|escape}" onkeyu</select>
<input name="keywords" type="text"/>
Đó là 1 đoạn của search, bạn có thể thay nguyên toàn bộ phần search bằng code mà bạn đã tạo ra
ở phần 1
|
|