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

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

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 (84.72 KB, 5 trang )

Bài 9: Số bài viết trung bình mỗi ngày


1. Mở file forum_posts.asp
a.1. Tìm dòng code
Response.Write(vbCrLf & " <br />" & strTxtPosts & ": " &
lngAuthorNumOfPosts)
a.2. Thay thế bằng
Response.Write("<br />" & strTxtPosts & ": ")
%>
<% = lngAuthorNumOfPosts %> <% If lngAuthorNumOfPosts > 0
AND DateDiff("d", dtmAuthorRegistration, Now()) > 0 Then
Response.Write(" [" & FormatNumber(lngAuthorNumOfPosts /
DateDiff("d", dtmAuthorRegistration, Now()), 2) & " " &
strTxtPostsPerDay) & "]" %>
<%


Bài 10: Kinh nghiệm


1. Mở file forum_posts.asp
a.1. Tìm dòng code
Dim strSex 'Hold the sex of member
a.2. Thêm xuống dưới
Dim lngExp, lngAuthorNumOfPostsExp, rsPostExp
lngAuthorNumOfPostsExp = 0
Set rsPostExp = Server.CreateObject("ADODB.Recordset")

strSQL = "SELECT " & strDbTable & "Author.No_of_posts "
strSQL = strSQL & "FROM " & strDbTable & "Author; "



'Set the cursor type property of the record set to dynamic so we can
naviagate through the record set
rsPostExp.CursorType = 1

'Query the database
rsPostExp.Open strSQL, adoCon
Do While NOT rsPostExp.EOF
lngAuthorNumOfPostsExp = lngAuthorNumOfPostsExp +
CLng(rsPostExp("No_of_posts"))
rsPostExp.MoveNext
Loop
rsPostExp.Close()
Set rsPostExp = Nothing
b.1. Tìm dòng code
Response.Write("<br />" & strTxtPosts & ": ")
%>
<% = lngAuthorNumOfPosts %> <% If lngAuthorNumOfPosts > 0
AND DateDiff("d", dtmAuthorRegistration, Now()) > 0 Then
Response.Write(" [" & FormatNumber(lngAuthorNumOfPosts /
DateDiff("d", dtmAuthorRegistration, Now()), 2) & " " &
strTxtPostsPerDay) & "]" %>
<%
b.2. Thêm xuống dưới
Response.Write("<br />" & strTxtExp & ": ")
lngExp =
FormatPercent(lngAuthorNumOfPosts/lngAuthorNumOfPostsExp,
2)
%>
<img src="<% = strImagePath %>bar_graph_image.gif"

width="<% = CInt(Replace(CStr(lngExp), "%", "", 1, -1, 1)) * 2
%>" height="11" align="middle"> [<% = lngExp %>]
<%


Bài 11: Nút Music – Flash


1. Tạo file RTE_function.asp trong thư mục RTE_configuration có
nội dung
//Add by flash, music,real, math by
function paste_embed(type){
var url = prompt("Enter url:", "http://");
if (url !="" && url !="http://" && url != null){
var emwidth = prompt("Width:", "300");
var emheight = prompt("height:", "300");
if (type == "flash") {
url = "[FLASH WIDTH=" + emwidth + "
HEIGHT=" + emheight + "]" + url + "[/FLASH]";
}
if (type == "media") {
url = "[MUSIC WIDTH=" + emwidth + "
HEIGHT=" + emheight + "]" + url + "[/MUSIC]";
}

FormatText("paste", url);

}
}
2. Mở file RTE_javascript.asp

a.1. Tìm dòng code
<! #include file="RTE_configuration/RTE_setup.asp" >
a.2. Thêm xuống dưới
<! #include file="RTE_configuration/RTE_function.asp" >
3. Mở file RTE_quick_reply_toolbar_inc.asp
a.1. Tìm dòng code
Response.Write("');")
End If
a.2. Thêm xuống dưới
Response.Write(vbCrLf & " document.writeln('<img src=""" &
strImagePath & "toolbar_separator.gif"" align=""absmiddle"">")
Response.Write("<img src=""" & strImagePath & "
mod/post_button_flash.gif"" align=""absmiddle"" border=""0""
onClick=""paste_embed(\'flash\')"" title=""" & strTxtAddFlash &
""" class=""WebWizRTEbutton""
onmouseover=""overIcon(this)"" onmouseout=""outIcon(this)"">")
Response.Write("<img src=""" & strImagePath & "
mod/post_button_media.gif"" align=""absmiddle"" border=""0""
onClick=""paste_embed(\'media\')"" title=""" & strTxtAddMedia
& """ class=""WebWizRTEbutton""
onmouseover=""overIcon(this)"" onmouseout=""outIcon(this)"">")
Response.Write("');")
4. Mở file RTE_toolbar_inc.asp
a.1. Tìm dòng code
If blnOrderList OR blnUnOrderList OR blnOutdent OR blnIndent
Or blnHorizontalRule Then Response.Write("');")
a.2. Thêm xuống dưới
Response.Write(vbCrLf & " document.writeln('<img src=""" &
strImagePath & "toolbar_separator.gif"" align=""absmiddle"">")
Response.Write("<img src=""" & strImagePath & "

mod/post_button_flash.gif"" align=""absmiddle"" border=""0""
onClick=""paste_embed(\'flash\')"" title=""" & strTxtAddFlash &
""" class=""WebWizRTEbutton""
onmouseover=""overIcon(this)"" onmouseout=""outIcon(this)"">")
Response.Write("<img src=""" & strImagePath &
"mod/post_button_media.gif"" align=""absmiddle"" border=""0""
onClick=""paste_embed(\'media\')"" title=""" & strTxtAddMedia
& """ class=""WebWizRTEbutton""
onmouseover=""overIcon(this)"" onmouseout=""outIcon(this)"">")
Response.Write("');")
5. Mở file ha_language_file_inc.asp
a.1. Tìm dòng code
Const strTxtExp = "Kinh nghi&#7879;m"
a.2. Thêm xuống dưới
Const strTxtAddFlash = "Ho&#7841;t h&#236;nh Flash"
Const strTxtAddMedia = "Nh&#7841;c Media"
6. Copy file music vào thư mục forum_images/mod



×