Liên k t Web (module Web_Links)

Một phần của tài liệu Giáo án - Bài giảng: Hướng dẫn dùng web stile (Trang 76 - 79)

IV. H ng d n s a l i và tinh ch nh Nukeviet 1.0

2. Liên k t Web (module Web_Links)

N n t ng: Nukeviet 1.0 Ngày s a l i: 26-04-2006 T ng s l i đã phát hi n: 1

ã s a thành công: 1

S a l i b i Admin - http://xaydungcauduong.net - Laser

S a l i không hi n k t qu tìm ki m

Khi b n tìm ki m t i module này mà ch th y hi n ra m t lo t các dòng có d ng nh :

Code:

K t qu tìm ki m theo t khóa: xd603 Tên m c

Miêu t :

c thêm: S l n click vào liên k t: M c:

Miêu t :

c thêm: S l n click vào liên k t: M c:

ây là l i c a ph n tìm ki m t i Module, đ s a l i b n hãy th c hi n theo các b c sau:

1 M file: \modules\Web_Links\index.php

2 Tìm đ n đo n mã sau: Code:

function search($query, $min, $show) {

include("modules/Web_Links/l_config.php"); global $prefix, $db, $admin, $bgcolor2; if (!isset($min)) $min=0; if (!isset($max)) $max=$min+$linksresults; if ($show!="") { $linksresults = $show; } else { $show=$linksresults; }

$query = check_html($query, nohtml); $query = addslashes($query);

$sql = "select lid, cid, sid, title, url, description, date, hits from ".$prefix."_links_links where title LIKE '%$query%' OR description LIKE '%$query%' ORDER BY title ASC LIMIT $min,$linksresults";

$result = $db->sql_query($sql);

$sql2 = "select lid, title, description, date, hits from ".$prefix."_links_links where title LIKE '%$query%' OR description LIKE '%$query%'"; $fullcountresult = $db->sql_query($sql2); $totalselectedlinks = $db->sql_numrows($fullcountresult); $nrows = $db->sql_numrows($result); $x=0; include("header.php"); S a thành:

function search($query, $min, $show) {

include("modules/Web_Links/l_config.php"); include("header.php");

global $prefix, $db, $admin, $bgcolor2; if (!isset($min)) $min=0; if (!isset($max)) $max=$min+$linksresults; if ($show!="") { $linksresults = $show; } else { $show=$linksresults; }

$query = check_html($query, nohtml); $query = addslashes($query);

$sql = "select lid, cid, sid, title, url, description, date, hits from ".$prefix."_links_links where title LIKE '%$query%' OR description LIKE '%$query%' ORDER BY title ASC LIMIT $min,$linksresults";

$result = $db->sql_query($sql);

$sql2 = "select lid, title, description, date, hits from ".$prefix."_links_links where title LIKE '%$query%' OR description LIKE '%$query%'";

$fullcountresult = $db->sql_query($sql2);

$totalselectedlinks = $db->sql_numrows($fullcountresult); $nrows = $db->sql_numrows($result);

(Th c ch t là đ y dòng l nh Code:

include("header.php");

t dòng th 790 lên dòng 772)

3 Save và đóng file l i.

Nh v y đã s a xong l i Module Web_Links!

Một phần của tài liệu Giáo án - Bài giảng: Hướng dẫn dùng web stile (Trang 76 - 79)