Chuyên m c tin t c (module News)

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 72 - 76)

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

1. Chuyên m c tin t c (module News)

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

ã s a thành công: 8

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

Tham kh o 1 s b n s a l i c a: Nukevn.com; Hero & member - nguoiquangnam.de; Admin - doisongso.net ...

1.1. S a l i không hi n b n tin "Chùm tin s ki n"

Khi b n click vào link t i m c "Tham kh o thêm s ki n" (t o ra t ph n “qu n lý nhóm tin liên quan" trong Admin CP) b n s th y hi n ra trang tr ng v i 1 lo t dòng d ng nh sau:

Code:

[ - Xây d英ng C医u A姶噂ng .net]

[ - Xây d英ng C医u A姶噂ng .net]

[ - Xây d英ng C医u A姶噂ng .net]

khung nh), n i dung trong khung s là n i dung trang Web mà iFrame liên k t t i.

Mu n s a l i này, b n th c hi n theo trình t sau:

1 M file topics.php th m c \modules\News\

2 Tìm đo n: Code:

$result = $db->sql_query("SELECT * FROM ".$prefix."_stories WHERE topicid='$topicid' $querylang ORDER BY sid DESC limit $offset, $newspagenum");

include("header.php");

S a thành: Code:

include("header.php");

$result = $db->sql_query("SELECT * FROM ".$prefix."_stories WHERE topicid='$topicid' $querylang ORDER BY sid DESC limit $offset, $newspagenum");

(chuy n include lên tr c bi n $result)

3 Save và đóng file l i.

1.2. L i hi n th Các b n tin, Tra c u bài vi t, Xem th o lu n

Cách kh c ph c c ng t ng t nh trên đ i v i các m c:

Các b n tin (theo chuyên m c): ---> S a file categories.php Khi tra c u bài vi t (theo ngày): ---> S a file archive.php Riêng m c Xem th o lu n s a nh sau:

1 Dùng EmEditor m file article.php

2 S a: Code:

$result = $db->sql_query("SELECT * FROM ".$prefix."_stories_comments WHERE sid='$sid' ORDER BY date desc LIMIT $offset, $newspagenum");

if ($db->sql_numrows($result) == 0) { Header("Location: index.php");

exit; }

include("header.php");

Thành

include("header.php");

$result = $db->sql_query("SELECT * FROM ".$prefix."_stories_comments WHERE sid='$sid' ORDER BY date desc LIMIT $offset, $newspagenum");

if ($db->sql_numrows($result) == 0) { Header("Location: index.php");

exit; }

(Chuy n include lên tr c bi n $result nh ng chú ý file này có 2 l n dòng

include("header.php"); và ta ch s a cái đ u tiên)

3 Save và đóng t t c các file l i.

1.3. L i c a Block top 10 b n tin đ c đ c nhi u nh t

S a file: \blocks\block-Last_10_Articles2.php

1.4. L i c a Block top 10 b n tin m i nh t

S a file: \blocks\block-Top_New.php C hai file trên đ u s a nh sau:

1 M file \blocks\block-Last_10_Articles2.php và file \blocks\block-

Top_New.php 2 Tìm: Code: <a href=\"op?name= Thay b ng: <a href=\"".$themepath."modules.php?name=

1.5. L i c a Block Hình t li u: Click vào hình thu nh (thumb) nh ng không th y hi n ra hình chính. Các s a nh sau: 1 M file \modules\News\article.php 2 Tìm đo n mã : Code: 'modules.php?name=$module_name&amp;file=article&amp; op=viewimg&amp;id='$imgid'&amp;val=1' S a thành: 'modules.php?name=$module_name&amp;file=article&amp; op=viewimg&amp;id=$imgid&amp;val=1' 3 Ghi và đóng file l i.

1.6. L i sai ngày b n tin trên trang ch website

Các b c đ s a l i nh sau: 1 M file modules/News/index.php 2 Tìm đ n dòng : Code: $time = $row2['time']; S a thành: $time = formatTimestamp($row2['time']); Tìm và xóa 2 l n: Code: formatTimestamp($time); Tìm dòng: Code:

themeindex ( $aid, $datetime, $title, $hometext, $story_pic, $notes, $story_link, $com_link, $tot_hits);

S a thành:

themeindex ( $aid, $time, $title, $hometext, $story_pic, $notes, $story_link, $com_link, $tot_hits);

(2 l n thay $datetime b ng $time) Ti p t c tìm (2 l n): Code: $time = $row['time']; S a thành: $time = formatTimestamp($row['time']); 3 L u file l i.

Nh v y b n đã s a xong 8 l i t i Modules News

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 72 - 76)