Tải bản đầy đủ (.pdf) (8 trang)

Hướng dẫn thiết kế : Thiết kế Forum nhanh chóng và đơn giản phần 2 pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (87.56 KB, 8 trang )

Bài 3: Chào mừng


1. Mở file ha_language_file_inc.asp
a.1. Tìm dòng code
Const strTxtFemale = "Nữ"
a.2. Thêm xuống dưới
Const strTxtWelcomeHA = "Chào mừng bạn
đến với Cộng đồng
ASP Việt Nam"
Const strTxtWelcomeDetail1 = "Nếu là lần
đầu tiên bạn duyệt
Diễn đàn này, hãy click
chuột vào"
Const strTxtWelcomeDetail2 = "để xem
hướng dẫn. Bạn nên"
Const strTxtWelcomeDetail3 = "trước khi gửi
bài. Để xem các bài viết,
hãy chọn các Diễn đàn
mà bạn muốn ở bên
dưới. "
2. Mở file default.asp
a.1. Tìm dòng code
vbCrLf & " </td>")
End If


%>
</table>
a.2. Thêm xuống dưới
<table cellspacing="1" cellpadding="3" class="tableBorder"


align="center">
<tr class="tableLedger">
<td> + <% = strTxtWelcomeHA %> + </td>
</tr>
<tr>
<td colspan="5" class="tableRow"><% =
strTxtWelcomeDetail1 %> <a href="help.asp"><% = strTxtHelp
%></a> <% = strTxtWelcomeDetail2 %> <a
href="registration_rules.asp?FID=0"><% = strTxtRegister %></a>
<% = strTxtWelcomeDetail3 %></td>
</tr>
</table><br />


Bài 4: Thành viên tích cực – thành viên mới – chủ đề mới – bài viết
mới


1. Mở file ha_language_file_inc.asp
a.1. Tìm dòng code
Const strTxtWelcomeDetail3 = "tr&#432;&#7899;c khi g&#7917;i
b&#224;i. &#272;&#7875; xem c&#225;c b&#224;i vi&#7871;t,
h&#227;y ch&#7885;n c&#225;c Di&#7877;n &#273;&#224;n
m&#224; b&#7841;n mu&#7889;n &#7903; b&#234;n
d&#432;&#7899;i. "
a.2. Thêm xuống dưới
Const strTxtBestMember = "Th&#224;nh vi&#234;n t&#237;ch
c&#7921;c"
Const strTxtNewMember = "Th&#224;nh vi&#234;n m&#7899;i"
Const strTxtLastNewTopic = "Ch&#7911; &#273;&#7873;

m&#7899;i"
Const strTxtLastNewPost = "B&#224;i vi&#7871;t m&#7899;i"
Const strTxtNoMember = "Kh&#244;ng c&#243; Th&#224;nh
vi&#234;n n&#224;o c&#7843;"
Const strTxtNoTopic = "Kh&#244;ng c&#243; Ch&#7911;
&#273;&#7873; n&#224;o c&#7843;"
Const strTxtNoPost = "Kh&#244;ng c&#243; B&#224;i
vi&#7871;t n&#224;o c&#7843;"
2. Mở file default.asp
a.1. Tìm dòng code
'Clean up
Call closeDatabase()
a.2. Thay thế bằng
'Clean up
'Call closeDatabase()
b.1. Tìm dòng code
%>
</table>
<br />
<table class="basicTable" border="0" cellspacing="0"
cellpadding="2" align="center" style="width:550px;">
<tr class="smText">
b.2. Thêm lên trên
'Clean up
Set rsCommon = Nothing
Call closeDatabase()
c.1. Tìm dòng code
<td colspan="5" class="tableRow"><% = strTxtWelcomeDetail1
%> <a href="help.asp"><% = strTxtHelp %></a> <% =
strTxtWelcomeDetail2 %> <a

href="registration_rules.asp?FID=0"><% = strTxtRegister %></a>
<% = strTxtWelcomeDetail3 %></td>
</tr>
</table><br />
c.2. Thêm xuống dưới
<%Dim intLoop%>
<table cellspacing="1" cellpadding="3" class="tableBorder"
align="center">
<tr class="tableLedger">
<td width="25%" align="center"> + <% = strTxtBestMember %>
+ </td>
<td width="25%" align="center"> + <% = strTxtNewMember %>
+ </td>
<td width="25%" align="center"> + <% = strTxtLastNewTopic
%> + </td>
<td width="25%" align="center"> + <% = strTxtLastNewPost
%> + </td>
</tr>
<tr class="tableRow">
<td valign=top align="left">
<%
strSQL = "SELECT TOP 10 " & strDbTable &
"Author.Username, " & strDbTable & "Author.Author_ID , " &
strDbTable & "Author.No_of_posts " & _
"FROM " & strDbTable & "Author" & strDBNoLock & " "
& _
"WHERE " & strDbTable & "Author.No_of_posts > 0 " & _
"ORDER BY " & strDbTable & "Author.No_of_posts
DESC;"


'Query the database
rsCommon.Open strSQL, adoCon, 3, 3
if rsCommon.RecordCount > 0 then
For intLoop = 1 To rsCommon.RecordCount
if rsCommon.EOF then exit For
if Len(intLoop) < 2 then intLoop = 0 & intLoop
Response.Write intLoop & ". <A
HREF=""member_profile.asp?PF=" & rsCommon("Author_ID")
& " & rsCommon("Username") & "</A> [" & strTxtPosts & ": " &
rsCommon("No_of_posts") & "]<BR>"
rsCommon.MoveNext
Next
else
Response.Write(vbCrLf & "<img src=" &
strImagePath & "moved_icon.gif border=0> " & strTxtNoMember)
end if

'Clean up
rsCommon.close
%>
</td>
<td valign=top align="left">
<%
strSQL = "SELECT TOP 10 " & strDbTable &
"Author.Username, " & strDbTable & "Author.Author_ID , " &
strDbTable & "Author.No_of_posts " & _
"FROM " & strDbTable & "Author" & strDBNoLock & " "
& _
"WHERE " & strDbTable & "Author.Author_ID > 2 " & _
"ORDER BY " & strDbTable & "Author.Author_ID DESC;"


'Query the database
rsCommon.Open strSQL, adoCon, 3, 3
if rsCommon.RecordCount > 0 then
For intLoop = 1 To rsCommon.RecordCount
if rsCommon.EOF then exit For
if Len(intLoop) < 2 then intLoop = 0 & intLoop
Response.Write intLoop & ". <A
HREF=""member_profile.asp?PF=" & rsCommon("Author_ID")
& """>" & rsCommon("Username") & "</A> [" & strTxtPosts & ":
" & rsCommon("No_of_posts") & "]<BR>"
rsCommon.MoveNext
Next
else
Response.Write(vbCrLf & "<img src=" &
strImagePath & "moved_icon.gif border=0> " & strTxtNoMember)
end if

'Clean up
rsCommon.close
%>
</td>
<td valign=top align="left">
<%
strSQL = "SELECT TOP 10 " & strDbTable &
"Topic.Topic_ID, " & strDbTable & "Topic.Subject , " &
strDbTable & "Topic.No_of_replies " & _
"FROM " & strDbTable & "Topic" & strDBNoLock & " " &
_
"ORDER BY " & strDbTable & "Topic.Topic_ID DESC;"


'Query the database
rsCommon.Open strSQL, adoCon, 3, 3
if rsCommon.RecordCount > 0 then
For intLoop = 1 To rsCommon.RecordCount
if rsCommon.EOF then exit For
if Len(intLoop) < 2 then intLoop = 0 & intLoop
Response.Write intLoop & ". <A
HREF=""forum_posts.asp?TID=" & rsCommon("Topic_ID") &
""">" & Left(rsCommon("Subject"), 20) & "</A> [" &
strTxtReplies & ": " & rsCommon("No_of_replies") & "]<BR>"
rsCommon.MoveNext
Next
else
Response.Write(vbCrLf & "<img src=" &
strImagePath & "moved_icon.gif border=0> " & strTxtNoTopic)
end if

'Clean up
rsCommon.close
%>
</td>
<td valign=top align="left">
<%
strSQL = "SELECT TOP 10 " & strDbTable &
"Topic.Topic_ID, " & strDbTable & "Topic.Subject , " &
strDbTable & "Topic.No_of_replies, " & strDbTable &
"Topic.Last_Thread_ID, " & strDbTable & "Thread.Message, " &
strDbTable & "Thread.Message_date, " & strDbTable &
"Thread.Thread_ID " & _

"FROM " & strDbTable & "Topic" & strDBNoLock & "," &
strDbTable & "Thread" & strDBNoLock & " " & _
"WHERE " & strDbTable & "Topic.Last_Thread_ID = " &
strDbTable & "Thread.Thread_ID " & _
"ORDER BY " & strDbTable & "Topic.Last_Thread_ID
DESC;"

'Query the database
rsCommon.Open strSQL, adoCon, 3, 3
if rsCommon.RecordCount > 0 then
For intLoop = 1 To rsCommon.RecordCount
if rsCommon.EOF then exit For
if Len(intLoop) < 2 then intLoop = 0 & intLoop
Response.Write intLoop & ". <A TITLE=""" &
removeHTML(rsCommon("Message"), 150, true) & """
HREF=""forum_posts.asp?TID=" & rsCommon("Topic_ID") &
"&get=last#" & rsCommon("Thread_ID") & """>" &
Left(rsCommon("Subject"), 20) & "</A> [" & strTxtReplies & ": "
& rsCommon("No_of_replies") & "]<BR>"
rsCommon.MoveNext
Next
else
Response.Write(vbCrLf & "<img src=" &
strImagePath & "moved_icon.gif border=0> " & strTxtNoTopic)
end if

'Clean up
rsCommon.close
%>
</td>

</tr>
</tr>
</table><br />



×