PDA

View Full Version : làm fourum với ASP Web wizforums 8.3


killer_nghiem8787
05-27-2009, 10:05 PM
Bài 1: Việt hóa


[Only registered and activated users can see links]



Down code Wwf 8.03
Thông tin đăng nhập:

Username: admin
Password: admin
Mở file browser_page_encoding_inc.asp
a.1. T́m ḍng code

Const strPageEncoding = "iso-8859-1"

a.2. Thay thế bằng

'Const strPageEncoding = "iso-8859-1"

b.1. T́m ḍng code

'Const strPageEncoding = "utf-8"

b.2. Thay thế bằng

Const strPageEncoding = "utf-8"

Mở file common.asp
a.1. T́m ḍng code

Server.ScriptTimeout = 90

Session.Timeout = 20

a.2. Thêm xuống dưới

Session.Codepage=65001

Mở file footer.asp
a.1. T́m ḍng code

</body>

</html>

a.2. Thêm lên trên

<div align=center>

<br />

<hr style="width: 50%;">

<!--#includes file="../Viettyping/Viettyping.asp"-->

<% Call VietTypeMod()%>

<%="<span class=""smText""><A target=_blank HREF=""[Only registered and activated users can see links]"">" & strWebsiteName & "</A> - Website của những người đam m&#234; lập tr&#236;nh ASP<br /></span>"%>

<!-- #include file="../clock.asp" -->

<%="<span class=""smText"">Xem tốt nhất với IE 6.0, độ ph&#226;n giải m&#224;n h&#236;nh 800x600 pixels<br />Developed by <A target=_blank HREF=""[Only registered and activated users can see links]"">Hoai An Net</A></span>"%>

<br />

</div>

Mở file admin_footer_inc.asp
a.1. T́m ḍng code

</td>

</tr>

a.2. Thêm lên trên

<!--#includes file="footer.asp"-->

Tạo file ha_language_file_inc.asp trong thư mục language_files có nội dung
<%

Const strTxtAuto = "Tự động"

Const strTxtTELEX = "TELEX"

Const strTxtVNI = "VNI"

Const strTxtVIQR = "VIQR"

Const strTxtOff = "Tắt"

Const strTxtRemember = "Ghi nhớ"

%>

Mở file language_file_inc.asp
a.1. T́m ḍng code

Const strTxtSecurityCodeDidNotMatch2 = "The Security Code entered did not match that displayed."

%>

a.2. Thêm xuống dưới

<!--#include file="ha_language_file_inc.asp"-->

Copy thư mục Viettyping vào website của bạn (wwf)
Copy file clock vào website của bạn (wwf)
Down Unikey 3.63, sau khi install xong, chọn bảng mă là NCR Decimal
a.1. H́nh vẽ


a.2. Mở file language_file_inc.asp

a.1.1. T́m ḍng code

Const strTxtWelcome = "Welcome"

a.1.2. Thay thế bằng

Const strTxtWelcome = "Ch&#224;o mừng"

a.1.3. Việc thay thế ở đây chính là việc bạn nhập chữ “Chào mừng” thay cho chữ “Welcome” theo kiểu gơ bạn đang chọn bằng bảng mă NCR Decimal mà bạn đă chọn ở trên. Nó tự động hiện ra chữ "Ch&#224;o mừng"

a.1.4. Làm tương tự cho các ḍng c̣n lại trong file này và các file khác trong thư mục language_files


:monkey61:

killer_nghiem8787
05-27-2009, 10:09 PM
Bài 2: Giới tính


[Only registered and activated users can see links]



Mở table wwForum.mdb
a.1. Mở tblAuthor, thêm trường: Sex, kiểu: Yes/No, giá trị default: True

a.2. H́nh vẽ


Mở file register.asp
a.1. T́m ḍng code

Dim strAdminNotes 'Holds admin/modertor info/notes about the user

a.2. Thêm xuống dưới

Dim blnSex 'Holds the member Sex

b.1. T́m ḍng code

blnConfirmPassOK = true

b.2. Thêm xuống dưới

blnSex = true

c.1. T́m ḍng code

blnShowEmail = CBool(Request.Form("emailShow"))

c.2. Thêm xuống dưới

blnSex = CBool(Request.Form("sex"))

d.1. T́m ḍng code

.Fields("Show_email") = blnShowEmail

d.2. Thêm xuống dưới

.Fields("Sex") = blnSex

e.1. T́m ḍng code

blnShowEmail = CBool(rsCommon("Show_email"))

e.2. Thêm xuống dưới

blnSex = CBool(rsCommon("Sex"))

f.1. T́m ḍng code

<tr class="tableRow">

<td><% = strTxtEmail %><%

f.2. Thêm lên trên

<tr class="tableRow">

<td><% = strTxtSex %></td>

<td>&nbsp;&nbsp;

<img border="0" src="forum_images/mod/male.gif">&nbsp;&nbsp;<% = strTxtMale %>&nbsp;&nbsp;<input type="radio" name="sex" value="True" <% If blnSex = True Then Response.Write "checked" %> checked>

&nbsp;&nbsp;&nbsp;&nbsp;

<img border="0" src="forum_images/mod/female.gif">&nbsp;&nbsp;<% = strTxtFemale %>&nbsp;&nbsp;<input type="radio" name="sex" value="False" <% If blnSex = False Then Response.Write "checked" %> />

</td>

</tr>

Mở file ha_language_file_inc.asp
a.1. T́m ḍng code

Const strTxtRemember = "Ghi nhớ"

a.2. Thêm xuống dưới

Const strTxtSex = "Giới t&#237;nh"

Const strTxtMale = "Nam"

Const strTxtFemale = "Nữ"

Mở file member_profile.asp
a.1. T́m ḍng code

Dim blnAccSuspended 'Holds if the user account is suspended

a.2. Thêm xuống dưới

Dim strSex 'Hold the sex of member

b.1. T́m ḍng code

strEmail = rsCommon("Author_email")

b.2. Thêm xuống dưới

strSex = CBool(rsCommon("Sex"))

c.1. T́m ḍng code

<tr>

<td><% = strTxtInterests %>:</td>

<td><% If strInterests = "" OR IsNull(strInterests) Then Response.Write(strTxtNotGiven) Else Response.Write(strInterests) %></td>

</tr>

c.2. Thêm xuống dưới

<tr>

<td><% = strTxtSex %>:</td>

<td><% If strSex = True Then Response.Write("<img src='forum_images/mod/male.gif'>") Else Response.Write("<img src='forum_images/mod/female.gif'>") %></td>

</tr>

Mở file forum_posts.asp
a.1. T́m ḍng code

Dim strForumPassword 'Holds the forum password

a.2. Thêm xuống dưới

Dim strSex 'Hold the sex of member

b.1. T́m ḍng code

& "Author.Avatar_title, "

b.2. Thêm xuống dưới

& strDbTable & "Author.Sex, "

c.1. T́m ḍng code

'16 = tblGroup.Name,

'17 = tblGroup.Stars,

'18 = tblGroup.Custom_stars

'19 = tblGuestName.Name

c.2. Thay thế bằng

'16 = tblAuthor.Sex,

'17 = tblGroup.Name,

'18 = tblGroup.Stars,

'19 = tblGroup.Custom_stars

'20 = tblGuestName.Name

d.1. T́m ḍng code

'16 = tblGroup.Name,

'17 = tblGroup.Stars,

'18 = tblGroup.Custom_stars

'19 = tblGuestName.Name

d.2. Thay thế bằng

'16 = tblAuthor.Sex,

'17 = tblGroup.Name,

'18 = tblGroup.Stars,

'19 = tblGroup.Custom_stars

'20 = tblGuestName.Name

e.1. T́m ḍng code

strGroupName = sarryPosts(16,intCurrentRecord)

intRankStars = CInt(sarryPosts(17,intCurrentRecord))

intRankStars = CInt(sarryPosts(17,intCurrentRecord))



strGuestUsername = sarryPosts(19,intCurrentRecord)

e2. Thay thế bằng

strSex = sarryPosts(16,intCurrentRecord)

strGroupName = sarryPosts(17,intCurrentRecord)

intRankStars = CInt(sarryPosts(18,intCurrentRecord))

strRankCustomStars = sarryPosts(19,intCurrentRecord)



strGuestUsername = sarryPosts(20,intCurrentRecord)

f.1. T́m ḍng code

Response.Write(vbCrLf & " <br /><br />" & strTxtJoined & ": " & DateFormat(dtmAuthorRegistration))

f.2. Thêm xuống dưới

'Show the sex

Response.Write(vbCrLf & " <br />" & strTxtSex & ": ")

If strSex = True then

strSex = "<img src='forum_images/mod/male.gif'>"

Elseif strSex = False then

strSex = "<img src='forum_images/mod/female.gif'>"

End If

Response.Write(vbCrLf & strSex)

Copy thư mục sex vào thư mục forum_images

killer_nghiem8787
05-27-2009, 10:10 PM
Bài 3: Chào mừng


[Only registered and activated users can see links]



Mở file ha_language_file_inc.asp
a.1. T́m ḍng code

Const strTxtFemale = "Nữ"

a.2. Thêm xuống dưới

Const strTxtWelcomeHA = "Ch&#224;o mừng bạn đến với Cộng đồng ASP Việt Nam"

Const strTxtWelcomeDetail1 = "Nếu l&#224; lần đầu ti&#234;n bạn duyệt Diễn đ&#224;n n&#224;y, h&#227;y click chuột v&#224;o"

Const strTxtWelcomeDetail2 = "để xem hướng dẫn. Bạn n&#234;n"

Const strTxtWelcomeDetail3 = "trước khi gửi b&#224;i. Để xem c&#225;c b&#224;i viết, h&#227;y chọn c&#225;c Diễn đ&#224;n m&#224; bạn muốn ở b&#234;n dưới. "

Mở file default.asp
a.1. T́m ḍ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 />

killer_nghiem8787
05-27-2009, 10:12 PM
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


[Only registered and activated users can see links]



Mở file ha_language_file_inc.asp
a.1. T́m ḍng code

Const strTxtWelcomeDetail3 = "trước khi gửi b&#224;i. Để xem c&#225;c b&#224;i viết, h&#227;y chọn c&#225;c Diễn đ&#224;n m&#224; bạn muốn ở b&#234;n dưới. "

a.2. Thêm xuống dưới

Const strTxtBestMember = "Th&#224;nh vi&#234;n t&#237;ch cực"

Const strTxtNewMember = "Th&#224;nh vi&#234;n mới"

Const strTxtLastNewTopic = "Chủ đề mới"

Const strTxtLastNewPost = "B&#224;i viết mới"

Const strTxtNoMember = "Kh&#244;ng c&#243; Th&#224;nh vi&#234;n n&#224;o cả"

Const strTxtNoTopic = "Kh&#244;ng c&#243; Chủ đề n&#224;o cả"

Const strTxtNoPost = "Kh&#244;ng c&#243; B&#224;i viết n&#224;o cả"

Mở file default.asp
a.1. T́m ḍng code

'Clean up

Call closeDatabase()

a.2. Thay thế bằng

'Clean up

'Call closeDatabase()

b.1. T́m ḍ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 ḍ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 />

killer_nghiem8787
05-27-2009, 10:13 PM
Bài 5: Quảng cáo


[Only registered and activated users can see links]



Mở file ha_language_file_inc.asp
a.1. T́m ḍng code

Const strTxtNoPost = "Kh&#244;ng c&#243; B&#224;i viết n&#224;o cả"

a.2. Thêm xuống dưới

Const strTxtAdv = "D&#224;nh cho Quảng c&#225;o"

Mở file default.asp
a.1. T́m ḍng code

<!-- #include file="includes/footer.asp" -->

a.2. Thêm lên trên

<br /><table cellspacing="1" cellpadding="3" class="tableBorder" align="center">

<tr class="tableLedger">

<td> + <% = strTxtAdv %> + </td>

</tr>

<tr>

<td colspan="5" class="tableRow"><div align="center"><img src="forum_images/adv/qc.gif" width="468" height="60" border="0"></div></td>

</tr>

</table>

Copy thư mục adv vào thư mục forum_images



:monkey61:

killer_nghiem8787
05-27-2009, 10:14 PM
Bài 6: Sắp xếp lại trang default.asp


[Only registered and activated users can see links]



H́nh vẽ

Mở file default.asp
a.1. T́m ḍng code

<td width="56%"><% = strTxtForum %></td>

<td width="6%" align="center"><% = strTxtTopics %></td>

<td width="6%" align="center"><% = strTxtPosts %></td>

<td width="28%" align="center"><% = strTxtLastPost %></td>

</tr>

<tr>

<td colspan="5" class="tableRow"><% = strTxtNoForums %></td></tr>

a.2. Thay thế bằng

<td width="52%"><% = strTxtForum %></td>

<td width="25%" align="center"><% = strTxtLastPost %></td>

<td width="8%" align="center"><% = strTxtTopics %></td>

<td width="8%" align="center"><% = strTxtPosts %></td>

<td width="3%" align="center">&nbsp;</td>

</tr>

<tr>

<td colspan="6" class="tableRow"><% = strTxtNoForums %></td></tr>

b.1. T́m ḍng code

<td width="56%"><% = strTxtForum %></td>

<td width="6%" align="center"><% = strTxtTopics %></td>

<td width="6%" align="center"><% = strTxtPosts %></td>

<td width="28%" align="center"><% = strTxtLastPost %></td>

</tr><%

b.2. Thay thế bằng

<td width="52%"><% = strTxtForum %></td>

<td width="25%" align="center"><% = strTxtLastPost %></td>

<td width="8%" align="center"><% = strTxtTopics %></td>

<td width="8%" align="center"><% = strTxtPosts %></td>

<td width="3%" align="center">&nbsp;</td>

</tr><%

c.1. T́m ḍng code

Response.Write vbCrLf & " <tr class=""tableSubLedger""><td colspan=""5""><a href=""default.asp?C=" & intCatID & strQsSID2 & """>" & strCategory & "</a></td></tr>"

c.2. Thay thế bằng

Response.Write vbCrLf & " <tr class=""tableSubLedger""><td colspan=""6""><a href=""default.asp?C=" & intCatID & strQsSID2 & """>" & strCategory & "</a></td></tr>"

d.1. T́m ḍng code

If strSubForums <> "" Then strSubForums = strSubForums & ", "

d.2. Thay thế bằng

If strSubForums <> "" Then strSubForums = strSubForums

e.1. T́m ḍng code

strSubForums = strSubForums & "<a href=""forum_topics.asp?FID=" & intSubForumID & strQsSID2 & """ class=""smLink"">" & strSubForumName & "</a>"

e.2. Thay thế bằng

strSubForums = strSubForums & "<br /><img src=""" & strImagePath & "mod/folder_line.gif"" border=""0"" align=""absmiddle"">&nbsp;<a href=""forum_topics.asp?FID=" & intSubForumID & strQsSID2 & """ class=""smLink"">" & strSubForumName & "</a>"

f.1. T́m ḍng code

vbCrLf & " <td align=""center"">" & lngNumberOfTopics & "</td>" & _

vbCrLf & " <td align=""center"">" & lngNumberOfPosts & "</td>" & _

vbCrLf & " <td class=""smText"" align=""right"" nowrap>")

If lngNumberOfPosts <> 0 Then 'Don't disply last post details if there are none

Response.Write(DateFormat(dtmLastEntryDate) & "&nbsp;" & strTxtAt & "&nbsp;" & TimeFormat(dtmLastEntryDate) & "" & _

"<br />" & strTxtBy & "&nbsp;<a href=""member_profile.asp?PF=" & lngLastEntryUserID & strQsSID2 & """ class=""smLink"">" & strLastEntryUser & "</a> <a href=""get_last_post.asp?FID=" & intLastForumEntryID & strQsSID2 & """><img src=""" & strImagePath & "right_arrow.gif"" align=""absmiddle"" border=""0"" alt=""" & strTxtViewLastPost & """ /></a>")

End If

Response.Write("</td>" & _

f.2. Thay thế bằng

vbCrLf & " <td class=""smText"" align=""right"" nowrap>")

If lngNumberOfPosts <> 0 Then 'Don't disply last post details if there are none

Response.Write(DateFormat(dtmLastEntryDate) & "&nbsp;" & strTxtAt & "&nbsp;" & TimeFormat(dtmLastEntryDate) & "" & _

"<br />" & strTxtBy & "&nbsp;<a href=""member_profile.asp?PF=" & lngLastEntryUserID & strQsSID2 & """ class=""smLink"">" & strLastEntryUser & "</a> <a href=""get_last_post.asp?FID=" & intLastForumEntryID & strQsSID2 & """><img src=""" & strImagePath & "right_arrow.gif"" align=""absmiddle"" border=""0"" alt=""" & strTxtViewLastPost & """ /></a>")

End If

Response.Write("</td>" & _

vbCrLf & " <td align=""center"">" & lngNumberOfTopics & "</td>" & _

vbCrLf & " <td align=""center"">" & lngNumberOfPosts & "</td><td>")

%>

<a href="new_topic_form.asp?FID=<% = intForumID %>" target="_self"><img src="<% = strImagePath %>mod/icon_post.gif" border="0" align="absmiddle" alt="<% = strTxtNewTopic %>"></a>

<a href="search_form.asp?FID=<% = intForumID %>" target="_self"><img src="<% = strImagePath %>mod/icon_search.gif" border="0" align="absmiddle" alt="<% = strTxtSearch %>"></a>

<%

Response.Write(vbCrLf & " </td></tr>")

Copy file icon vào thư mục forum_images/mod




Thông cảm v́ h́nh vẽ ko up được :( do không lấy ra được bị khoá rồi lấy mất thời gian lắm :monkey49:

killer_nghiem8787
05-27-2009, 10:16 PM
Bài 7: Thay skin


[Only registered and activated users can see links]



H́nh vẽ

Copy images đè lên các file trong thư mục forum_images
Copy default_style vào thư mục css_styles



:monkey61:

killer_nghiem8787
05-27-2009, 10:18 PM
Bài 8: Music


[Only registered and activated users can see links]



Mở file functions_format_post.asp
a.1. T́m ḍng code

'Return the function

searchHighlighter = strTempMessage

End Function

a.2. Thêm xuống dưới

Function formatWMAPL(ByVal strMessage)





'Declare variables

Dim lngStartPos 'Holds search start postions

Dim lngEndPos 'Holds end start postions

Dim saryWMAAttributes 'Holds the features of the input WMA file

Dim intAttrbuteLoop 'Holds the attribute loop counter

Dim strWMAWidth 'Holds the string value of the width of the WMA file

Dim intWMAWidth 'Holds the interger value of the width of the WMA file

Dim strWMAHeight 'Holds the string value of the height of the WMA file

Dim intWMAHeight 'Holds the interger value of the height of the WMA file

Dim strBuildWMALink 'Holds the converted BBcode for the WMA file

Dim strTempWMAMsg 'Tempoary store for the BBcode

Dim strWMALink 'Holds the link to the WMA file







'Loop through all the codes in the message and convert them to formated WMA links

Do While InStr(1, strMessage, "", 1) > 0



'Initiliase variables

intWMAWidth = 300

intWMAHeight = 300

strWMALink = ""

strBuildWMALink = ""

strTempWMAMsg = ""



'Get the WMA BBcode from the message

lngStartPos = InStr(1, strMessage, "[MUSIC", 1)

lngEndPos = InStr(lngStartPos, strMessage, "", 1) + 8



'Make sure the end position is not in error

If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 6



'Get the original WMA BBcode from the message

strTempWMAMsg = Trim(Mid(strMessage, lngStartPos, lngEndPos-lngStartPos))









'Get the start and end in the message of the attributes of the WMA file

lngStartPos = InStr(1, strTempWMAMsg, "", 1)



'Make sure the end position is not in error

If lngEndPos < lngStartPos Then lngEndPos = lngStartPos



'If there is something returned get the details (eg. dimensions) of the WMA file

If strTempWMAMsg <> "" Then



'Place any attributes for the WMA file in an array

saryWMAAttributes = Split(Trim(Mid(strTempWMAMsg, lngStartPos, lngEndPos-lngStartPos)), " ")



'Get the dimensions of the WMA file

'Loop through the array of atrributes that are for the falsh file to get the dimentions

For intAttrbuteLoop = 0 To UBound(saryWMAAttributes)



'If this is the width attribute then read in the width dimention

If InStr(1, saryWMAAttributes(intAttrbuteLoop), "WIDTH=", 1) Then



'Get the width dimention

strWMAWidth = Replace(saryWMAAttributes(intAttrbuteLoop), "WIDTH=", "", 1, -1, 1)



'Make sure we are left with a numeric number if so convert to an interger and place in an interger variable

If isNumeric(strWMAWidth) Then intWMAWidth = CInt(strWMAWidth)

End If



'If this is the height attribute then read in the height dimention

If InStr(1, saryWMAAttributes(intAttrbuteLoop), "HEIGHT=", 1) Then



'Get the height dimention

strWMAHeight = Replace(saryWMAAttributes(intAttrbuteLoop), "HEIGHT=", "", 1, -1, 1)



'Make sure we are left with a numeric number if so convert to an interger and place in an interger variable

If isNumeric(strWMAHeight) Then intWMAHeight = CInt(strWMAHeight)

End If

Next







'Get the link to the WMA file

lngStartPos = InStr(1, strTempWMAMsg, "]", 1) + 1

lngEndPos = InStr(lngStartPos, strTempWMAMsg, "", 1)



'Make sure the end position is not in error

If lngEndPos < lngStartPos Then lngEndPos = lngStartPos + 8



'Read in the code to be converted into a hyperlink from the message

strWMALink = Trim(Mid(strTempWMAMsg, lngStartPos, (lngEndPos - lngStartPos)))





'Build the HTML for the displying of the WMA file

If strWMALink <> "" Then

'

killer_nghiem8787
05-27-2009, 10:19 PM
================================================== ====================

strBuildWMALink="<object id=""mediaPlayer"" height="& intWMAHeight &" width="& intWMAWidth &" classid=""clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"" name=""mediaPlayer"" valign=""top"" bgcolor=#000000>" & _

"<param NAME=""URL"" VALUE="""& strWMALink &""">"& _

"<PARAM NAME=""ShowStatusBar"" VALUE=""-1"">"& _

"<param NAME=""rate"" VALUE=""1"">"& _

"<param NAME=""balance"" VALUE=""0"">"& _

"<param NAME=""currentPosition"" VALUE=""0"">"& _

"<param NAME=""defaultFrame"" VALUE>"& _

"<param NAME=""playCount"" VALUE=""100"">"& _

"<param NAME=""autoStart"" VALUE=""0"">"& _

"<param NAME=""currentMarker"" VALUE=""0"">"& _

"<param NAME=""invokeURLs"" VALUE=""-1"">"& _

"<param NAME=""baseURL"" VALUE>"& _

"<param name=""BufferingTime"" value=""5"">"& _

"<param NAME=""volume"" VALUE=""100"">"& _

"<param NAME=""mute"" VALUE=""0"">"& _

"<param NAME=""uiMode"" VALUE=""full"">"& _

"<param NAME=""stretchToFit"" VALUE=""0"">"& _

"<param NAME=""windowlessVideo"" VALUE=""0"">"& _

"<param NAME=""enabled"" VALUE=""-1"">"& _

"<param NAME=""enableContextMenu"" VALUE=""0"">"& _

"<param NAME=""fullScreen"" VALUE=""0"">"& _

"<param NAME=""SAMIStyle"" VALUE>"& _

"<param NAME=""SAMILang"" VALUE>"& _

"<param NAME=""SAMIFilename"" VALUE>"& _

"<param NAME=""captioningID"" VALUE>"& _

"<param NAME=""enableErrorDialogs"" VALUE=""0"">"& _

"<param NAME=""_cx"" VALUE=""7541"">"& _

"<param NAME=""_cy"" VALUE=""1058"">"& _

"</object>"



End If

End If





'Replace the WMA codes in the message with the new formated WMA link

If strBuildWMALink <> "" Then

strMessage = Replace(strMessage, strTempWMAMsg, strBuildWMALink, 1, -1, 1)

Else

strMessage = Replace(strMessage, strTempWMAMsg, Replace(strTempWMAMsg, "[", "&#91;", 1, -1, 1), 1, -1, 1)

End If

Loop



'Return the function

formatWMAPL= strMessage

End Function

Mở file forum_posts.asp
a.1. T́m ḍng code

If blnFlashFiles Then

If InStr(1, strMessage, "", 1) > 0 Then strMessage = formatFlash(strMessage)

If InStr(1, strAuthorSignature, "[Only registered and activated users can see links]>

</tr><%

End If

a.2. Thay thế bằng

If blnFlashFiles Then

%>

<tr class="tableLedger">

<td width="62%"><% = strTxtTypedForumCode %></td>

<td width="62%"><% = strTxtConvetedCode %></td>

<tr />

<tr class="tableSubLedger">

<td colspan="2"><% = strTxtFlashFilesImages %></td>

</tr>

<tr class="tableRow">

<td colspan="2">[Only registered and activated users can see links]>

</tr>

<tr class="tableLedger">

<td width="62%"><% = strTxtTypedForumCode %></td>

<td width="62%"><% = strTxtConvetedCode %></td>

<tr />

<tr class="tableSubLedger">

<td colspan="2"><% = strTxtMediaFiles %></td>

</tr>

<tr class="tableRow">

<td colspan="2">[MUSIC WIDTH=300 HEIGHT=300][Only registered and activated users can see links]>

</tr><%

End If

Mở file ha_language_file_inc.asp
a.1. T́m ḍng code

Const strTxtAdv = "D&#224;nh cho Quảng c&#225;o"

a.2. Thêm xuống dưới

Const strTxtMediaFiles = "Music"

killer_nghiem8787
05-27-2009, 10:20 PM
Bài 9: Số bài viết trung b́nh mỗi ngày


[Only registered and activated users can see links]



Mở file forum_posts.asp
a.1. T́m ḍ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) & "]" %>

<%

killer_nghiem8787
05-27-2009, 10:21 PM
Bài 10: Kinh nghiệm


[Only registered and activated users can see links]



Mở file forum_posts.asp
a.1. T́m ḍ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 ḍ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 %>]

<%

killer_nghiem8787
05-27-2009, 10:21 PM
Bài 11: Nút Music – Flash


[Only registered and activated users can see links]



Tạo file RTE_function.asp trong thư mục RTE_configuration có nội dung
[Only registered and activated users can see links]

function paste_embed(type){

var url = prompt("Enter url:", "[Only registered and activated users can see links]");

if (url !="" && url !="[Only registered and activated users can see links]" && url != null){

var emwidth = prompt("Width:", "300");

var emheight = prompt("height:", "300");

if (type == "flash") {

url = "" + url + "";

}

if (type == "media") {

url = "" + url + "";

}



FormatText("paste", url);



}

}

Mở file RTE_javascript.asp
a.1. T́m ḍng code

<!--#include file="RTE_configuration/RTE_setup.asp" -->

a.2. Thêm xuống dưới

<!--#include file="RTE_configuration/RTE_function.asp" -->

Mở file RTE_quick_reply_toolbar_inc.asp
a.1. T́m ḍ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("');")

Mở file RTE_toolbar_inc.asp
a.1. T́m ḍ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("');")

Mở file ha_language_file_inc.asp
a.1. T́m ḍng code

Const strTxtExp = "Kinh nghiệm"

a.2. Thêm xuống dưới

Const strTxtAddFlash = "Hoạt h&#236;nh Flash"

Const strTxtAddMedia = "Nhạc Media"

Copy file music vào thư mục forum_images/mod

killer_nghiem8787
05-27-2009, 10:22 PM
Bài 12: Bài viết cuối theo từng Diễn đàn


[Only registered and activated users can see links]



Mở file default.asp
a.1. T́m ḍng code

Dim intTotalViewingForum 'Holds the number of people viewing the forum, including sub forums

a.2. Thêm xuống dưới

Dim strSubject

b.1. T́m ḍng code

If lngNumberOfPosts <> 0 Then 'Don't disply last post details if there are none

b.2. Thêm xuống dưới

strSQL = "SELECT TOP 1 " & strDbTable & "Topic.Subject, " & strDbTable & "Topic.Topic_ID, "& strDbTable & "Topic.Last_Thread_ID, "& strDbTable & "Topic.Icon FROM " & strDbTable & "Topic WHERE " & strDbTable & "Topic.Forum_ID=" & intForumID & " ORDER BY " & strDbTable & "Topic.Last_Thread_ID DESC;"

rsCommon.Open strSQL, adoCon

If NOT rsCommon.EOF Then

strSubject = "<a href=""forum_posts.asp?TID=" & rsCommon("Topic_ID") & strQsSID2 & """>" & rsCommon("Subject") & "</a>"

else

strSubject = ""

End If

rsCommon.Close

Response.Write(strSubject & "<br />")

killer_nghiem8787
05-27-2009, 10:23 PM
Bài 13: Bạn có gửi bài/không gửi bài theo từng Chủ đề


[Only registered and activated users can see links]



1. Tạo file participated_inc.asp trong thư mục inlcudes có nội dung

<%

Dim rsParticipated

if(lngLoggedInUserID <> 2) then 'checks to see if it's a guest -- i'm not sure exactly how to check if no user is logged in :(



set rsParticipated = server.createobject("ADODB.recordset")



rsParticipated.CursorType = 1

rsParticipated.Open "select top 1 tblThread.Thread_ID from tblThread where tblThread.Topic_Id = " & lngTopicID & " AND tblThread.Author_ID = " & lngLoggedInUserID, adoCon





if(NOT rsParticipated.EOF)then 'a thread was found authored by them and they are not a guest

Response.Write("<img src=""" & "./forum_images/mod/topic_read.gif"" border=""0"" alt=""" & strTxtYouHavePost & """>")'Whatever u need to indicate to the user that he/she has participated in the forum

else

Response.Write("<img src=""" & "./forum_images/mod/topic_not_read.gif"" border=""0"" alt=""" & strTxtYouHaveNot & """>")'Whatever u need to indicate to the user that he/she has participated in the forum

end if



rsParticipated.close

set rsParticipated = Nothing



end if

%>

Mở file active_topics.asp
a.1. T́m ḍng code

If blnAdmin OR blnModerator Then Response.Write("<a href=""javascript:winOpener('pop_up_topic_admin.asp?TID=" & lngTopicID & strQsSID2 & "','admin',1,1,480,265)""><img src=""" & strImagePath & "small_admin_icon.gif"" align=""absmiddle"" border=""0"" alt=""" & strTxtTopicAdmin & """></a>")

a.2. Thêm xuống dưới

Response.Write(vbCrLf)

%><!--#include file="includes/participated_inc.asp" --><%

Response.Write(vbCrLf)

Mở file forum_topics.asp
a.1. T́m ḍng code

If blnAdmin OR blnModerator Then Response.Write("<a href=""javascript:winOpener('pop_up_topic_admin.asp?TID=" & lngTopicID & strQsSID2 & "','admin',1,1,480,265)""><img src=""" & strImagePath & "small_admin_icon.gif"" align=""absmiddle"" border=""0"" alt=""" & strTxtTopicAdmin & """></a>")

a.2. Thêm xuống dưới

Response.Write(vbCrLf)

%><!--#include file="includes/participated_inc.asp" --><%

Response.Write(vbCrLf)

Mở file _language_file_inc.asp
a.1. T́m ḍng code

Const strTxtAddMedia = "Nhạc Media"

a.2. Thêm xuống dưới

Const strTxtYouHavePost = "Bạn c&#243; gửi b&#224;i"

Const strTxtYouHaveNot = "Bạn kh&#244;ng c&#243; gửi b&#224;i"

Copy file post vào thư mục forum_images/mod

killer_nghiem8787
05-27-2009, 10:23 PM
Bài 14: Sắp xếp bài viết trong từng Box cho việc hiển thị


[Only registered and activated users can see links]



H́nh vẽ

Tạo file form_sort_inc.asp trong thư mục inlcudes có nội dung
<br />

<fieldset STYLE="PADDING: 2px;BORDER: solid 1px;WIDTH: 250px;">

<legend STYLE="FONT-WEIGHT: bold;"><%=strTxtSortBy%></legend>

<div>

<table>

<form name=frmsort action="" method=Get>

<input type=hidden name=FID value="<%=intForumID%>" />

<tr>

<td>

<select name=SO onchange="frmsort.submit()">

<%

Dim arrSortBy(5), arrLabelSortBy(5), nSortBy

arrSortBy(1) = "T"

arrLabelSortBy(1) = strtxtTopics

arrSortBy(2) = "A"

arrLabelSortBy(2) = strtxtAuthor

arrSortBy(3) = "R"

arrLabelSortBy(3) = strtxtReplies

arrSortBy(4) = "V"

arrLabelSortBy(4) = strtxtViews

arrSortBy(5) = ""

arrLabelSortBy(5) = strTxtLastPost

For nSortBy = 1 to Ubound(arrSortBy)

if Request.QueryString("SO") = arrSortBy(nSortBy) then

Response.Write "<option selected value=" & arrSortBy(nSortBy) & ">" & arrLabelSortBy(nSortBy) & "</option>"

else

Response.Write "<option value=" & arrSortBy(nSortBy) & ">" & arrLabelSortBy(nSortBy) & "</option>"

end if

Next

%>



</select>

</td>

<td><%=strTxtOrderBy%></td>

<td>

<select name=OB onchange="frmsort.submit()">

<option value="desc"><%=strTxtDESC%></option>

<option <%if Request.QueryString("OB") = "asc" then Response.Write "Selected"%> value="asc"><%=strTxtASC%></option>

</select>

</td>

<td><input class=button type=submit value="<%=strTxtResult%>" /></td>

</tr>

</form>

</table>

</div>

</fieldset>

<br />

Mở file forum_topics.asp
a.1. T́m ḍng code

%></td>

<td align="right" nowrap><!-- #include file="includes/page_link_inc.asp" --></td>

a.2. Thay thế bằng

%>

<!-- #include file="includes/form_sort_inc.asp" -->

</td>

<td align="right" nowrap><!-- #include file="includes/page_link_inc.asp" --></td>

Mở file ha_language_file_inc.asp
a.1. T́m ḍng code

Const strTxtYouHaveNot = "Bạn kh&#244;ng c&#243; gửi b&#224;i"

a.2. Thêm xuống dưới

Const strTxtSortBy = "Sắp xếp theo"

Const strTxtOrderBy = "chiều"

Const strTxtASC = "Tăng dần"

Const strTxtDESC = "Giảm dần"

Const strTxtResult = "Kết quả"

killer_nghiem8787
05-27-2009, 10:24 PM
Bài 15: Tỷ lệ hoạt động của từng Box


[Only registered and activated users can see links]



Mở file ha_language_file_inc.asp
a.1. T́m ḍng code

Const strTxtResult = "Kết quả"

a.2. Thêm xuống dưới

Const strTxtActivity = "Hoạt động"

2. Mở file default.asp

a.1. T́m ḍng code

Dim strSubject

a.2. Thêm xuống dưới

Dim rsNoofPostAll

Dim lngTotalNumberOfPostsAll

Dim lngNumberOfPostsAll

Dim lngTmp

Dim intNumOfForums

b.1. T́m ḍng code

lngLastEntryUserID = lngLastSubEntryUserID

dtmLastEntryDateAllForums = dtmLastSubEntryDate

End If

b.2. Thêm xuống dưới

lngTmp = 0

intNumOfForums = 0

lngTmp = lngSubForumNumberOfPosts

intNumOfForums = intNumOfForums + lngTmp



strSQL = "SELECT " & strDbTable & "Forum.* FROM " & strDbTable & "Forum ORDER BY " & strDbTable & "Forum.Forum_Order ASC;"



Set rsNoofPostAll = Server.CreateObject("ADODB.Recordset")



rsNoofPostAll.Open strSQL, adoCon



lngTotalNumberOfPostsAll = 0

lngNumberOfPostsAll = 0



Do While NOT rsNoofPostAll.EOF

lngNumberOfPostsAll = CLng(rsNoofPostAll("No_of_posts"))

lngTotalNumberOfPostsAll = lngTotalNumberOfPostsAll + lngNumberOfPostsAll

rsNoofPostAll.MoveNext

Loop

rsNoofPostAll.Close

Set rsNoofPostAll = Nothing

c.1 T́m ḍng code

strSubForums = strSubForums & "<br /><img src=""" & strImagePath & "mod/folder_line.gif"" border=""0"" align=""absmiddle"">&nbsp;<a href=""forum_topics.asp?FID=" & intSubForumID & strQsSID2 & """ class=""smLink"">" & strSubForumName & "</a>"

c.2. Thay thế bằng

strSubForums = strSubForums & "<br /><img src=""" & strImagePath & "mod/folder_line.gif"" border=""0"" align=""absmiddle"">&nbsp;<a href=""forum_topics.asp?FID=" & intSubForumID & strQsSID2 & """ class=""smLink"">" & strSubForumName & "</a>" & " (" & Round((intNumOfForums/lngTotalNumberOfPostsAll)*100,2) & "%)"

d.1 T́m ḍng code

Response.Write("<br />" & strForumDiscription & strSubForums & "</td>" & _

vbCrLf & " <td class=""smText"" align=""right"" nowrap>")

d.2. Thay thế bằng

Response.Write("<br />" & strForumDiscription & strSubForums)



strSQL = "SELECT " & strDbTable & "Forum.* FROM " & strDbTable & "Forum ORDER BY " & strDbTable & "Forum.Forum_Order ASC;"



Set rsNoofPostAll = Server.CreateObject("ADODB.Recordset")



rsNoofPostAll.Open strSQL, adoCon



lngTotalNumberOfPostsAll = 0

lngNumberOfPostsAll = 0



Do While NOT rsNoofPostAll.EOF

lngNumberOfPostsAll = CLng(rsNoofPostAll("No_of_posts"))

lngTotalNumberOfPostsAll = lngTotalNumberOfPostsAll + lngNumberOfPostsAll

rsNoofPostAll.MoveNext

Loop

rsNoofPostAll.Close

Set rsNoofPostAll = Nothing



strSQL = "SELECT " & strDbTable & "Forum.* FROM " & strDbTable & "Forum WHERE " & strDbTable & "Forum.Sub_ID = " & intForumID & " ORDER BY " & strDbTable & "Forum.Forum_Order ASC;"



Dim rsNoofPostSubForum

Set rsNoofPostSubForum = Server.CreateObject("ADODB.Recordset")



rsNoofPostSubForum.CursorType = 1



'Query the database

rsNoofPostSubForum.Open strSQL, adoCon



lngTmp = 0

intNumOfForums = 0

Do While NOT rsNoofPostSubForum.EOF

lngTmp = CLng(rsNoofPostSubForum("No_of_posts"))

intNumOfForums = intNumOfForums + lngTmp

rsNoofPostSubForum.MoveNext

Loop

Response.Write(vbCrLf & "<br /><span class=""tiText"">")

Response.Write( strTxtActivity & ": " & "</span>")

If lngNumberOfPosts <> 0 Then

If intNumOfForums <> 0 Then

Dim dblPollVotePercentageSub

dblPollVotePercentageSub = FormatPercent(((lngNumberOfPosts+intNumOfForums)/lngTotalNumberOfPostsAll), 2)

%>

<img src="<% = strImagePath %>bar_graph_image.gif" width="<% = CInt(Replace(CStr(dblPollVotePercentageSub), "%", "", 1, -1, 1)) * 2 %>" height="11" align="middle"> [<% = dblPollVotePercentageSub %>]

<%

Else

Dim dblPollVotePercentage

dblPollVotePercentage = FormatPercent((lngNumberOfPosts/lngTotalNumberOfPostsAll), 2)

%>

<img src="<% = strImagePath %>bar_graph_image.gif" width="<% = CInt(Replace(CStr(dblPollVotePercentage), "%", "", 1, -1, 1)) * 2 %>" height="11" align="middle"> [<% = dblPollVotePercentage %>]

<%

End If

Else

If intNumOfForums <> 0 Then

dblPollVotePercentageSub = FormatPercent(((lngNumberOfPosts+intNumOfForums)/lngTotalNumberOfPostsAll), 2)

%>

<img src="<% = strImagePath %>bar_graph_image.gif" width="<% = CInt(Replace(CStr(dblPollVotePercentageSub), "%", "", 1, -1, 1)) * 2 %>" height="11" align="middle"> [<% = dblPollVotePercentageSub %>]

<%

Else

%>

<img src="<% = strImagePath %>bar_graph_image.gif" width="<% = CInt(Replace(CStr(0), "%", "", 1, -1, 1)) * 2 %>" height="11" align="middle"> [0%]

<%

End If



End If

rsNoofPostSubForum.Close()

killer_nghiem8787
05-27-2009, 10:25 PM
Bài 16: Độ dài chữ kư 1000 kư tự


[Only registered and activated users can see links]



Mở file register.asp
a.1. T́m ḍng code

strSignature = Mid(Request.Form("signature"), 1, 200)

a.2. Thay thế bằng

strSignature = Mid(Request.Form("signature"), 1, 1000)

b.1. T́m ḍng code

'Trim signature down to a 255 max characters to prevent database errors

strSignature = Mid(strSignature, 1, 255)

b.2. Thay thế bằng

'Trim signature down to a 1200 max characters to prevent database errors

strSignature = Mid(strSignature, 1, 1200)

c.1. T́m ḍng code

//Check that the signature is not above 200 chracters

if (formArea.signature.value.length > 200){

c.2. Thay thế bằng

//Check that the signature is not above 1000 chracters

if (formArea.signature.value.length > 1000){

d.1. T́m ḍng code

<td valign="top"><% = strTxtSignature %><br /><span class="smText"><% = strTxtSignatureLong %>&nbsp;(max 200 characters)

d.2. Thay thế bằng

<td valign="top"><% = strTxtSignature %><br /><span class="smText"><% = strTxtSignatureLong %>&nbsp;(max 1000 characters)

Mở table wwForum.mdb
a.1. Mở tblAuthor, sửa trường: Signature, kiểu: Text -> Memo

a.2. H́nh vẽ

killer_nghiem8787
05-27-2009, 10:26 PM
Bài 17: Sắp xếp lại trang hiển thị phụ mục giống trang default.asp


[Only registered and activated users can see links]



Mở file forum_topics.asp
a.1. T́m ḍng code

<td width="56%"><% = strTxtSub & " " & strTxtForums %></td>

<td width="7%"><% = strTxtTopics %></td>

<td width="7%"><% = strTxtPosts %></td>

<td width="29%"><% = strTxtLastPost %></td>

a.2. Thay thế bằng

<td width="52%"><% = strTxtSub & " " & strTxtForums %></td>

<td width="25%" align="center"><% = strTxtLastPost %></td>

<td width="8%" align="center"><% = strTxtTopics %></td>

<td width="8%" align="center"><% = strTxtPosts %></td>

<td width="3%" align="center">&nbsp;</td>

b.1. T́m ḍng code

vbCrLf & " <td align=""center"">" & lngNumberOfTopics & "</td>" & _

vbCrLf & " <td align=""center"">" & lngNumberOfPosts & "</td>" & _

vbCrLf & " <td class=""smText"" align=""right"" nowrap>")

If lngNumberOfPosts <> 0 Then 'Don't disply last post details if there are none

Response.Write(DateFormat(dtmLastEntryDate) & "&nbsp;" & strTxtAt & "&nbsp;" & TimeFormat(dtmLastEntryDate) & "" & _

"<br />" & strTxtBy & "&nbsp;<a href=""member_profile.asp?PF=" & lngLastEntryUserID & strQsSID2 & """ class=""smLink"">" & strLastEntryUser & "</a> <a href=""get_last_post.asp?FID=" & intSubForumID & strQsSID2 & """><img src=""" & strImagePath & "right_arrow.gif"" align=""absmiddle"" border=""0"" alt=""" & strTxtViewLastPost & """></a>")

End If

Response.Write("</td>" & _

vbCrLf & " </tr>")

b.2. Thay thế bằng

vbCrLf & " <td class=""smText"" align=""right"" nowrap>")

If lngNumberOfPosts <> 0 Then 'Don't disply last post details if there are none

Response.Write(DateFormat(dtmLastEntryDate) & "&nbsp;" & strTxtAt & "&nbsp;" & TimeFormat(dtmLastEntryDate) & "" & _

"<br />" & strTxtBy & "&nbsp;<a href=""member_profile.asp?PF=" & lngLastEntryUserID & strQsSID2 & """ class=""smLink"">" & strLastEntryUser & "</a> <a href=""get_last_post.asp?FID=" & intSubForumID & strQsSID2 & """><img src=""" & strImagePath & "right_arrow.gif"" align=""absmiddle"" border=""0"" alt=""" & strTxtViewLastPost & """></a>")

End If

Response.Write("</td>" & _

vbCrLf & " <td align=""center"">" & lngNumberOfTopics & "</td>" & _

vbCrLf & " <td align=""center"">" & lngNumberOfPosts & "</td><td>")

%>

<a href="new_topic_form.asp?FID=<% = intSubForumID %>" target="_self"><img src="<% = strImagePath %>mod/icon_post.gif" border="0" align="absmiddle" alt="<% = strTxtNewTopic %>"></a>

<a href="search_form.asp?FID=<% = intSubForumID %>" target="_self"><img src="<% = strImagePath %>mod/icon_search.gif" border="0" align="absmiddle" alt="<% = strTxtSearch %>"></a>

<%

Response.Write(vbCrLf & " </td></tr>")

killer_nghiem8787
05-27-2009, 10:27 PM
Bài 18: Nút top – down trong forum_posts.asp


[Only registered and activated users can see links]



Mở file forum_posts.asp
a.1. T́m ḍng code

<tr class="<% = strPostTableRowClass %>">

<td nowrap>

<span style="float:right">

a.2. Thêm xuống dưới

<% Response.Write(" <a href=""#top""><img src=""" & strImagePath & "mod/jump_up.gif"" align=""absmiddle"" border=""0""/></a> <a href=""#bottom""><img src=""" & strImagePath & "mod/jump_down.gif"" align=""absmiddle"" border=""0""/></a>")%>

b.1. T́m ḍng code

<td align="right" class="smText" nowrap><!-- #include file="includes/show_forum_permissions_inc.asp" --></td>

</tr>

</table>

b.2. Thêm xuống dưới

<a name="bottom"></a>

Copy file top-bottom vào thư mục forum_images/mod

killer_nghiem8787
05-27-2009, 10:28 PM
Bài 19: Sửa RTE phần trả lời nhanh


[Only registered and activated users can see links]



H́nh vẽ

Copy file RTE_quick vào website của bạn (wwf)



Bài 20: Biểu tượng động


[Only registered and activated users can see links]



H́nh vẽ


Mở file message_form_inc.asp
a.1. T́m ḍng code

'If emoticons are enabled show them next to the post window

If blnEmoticons Then

a.2. Thêm xuống dưới

Randomize Timer

b.1. T́m ḍng code

If RTEenabled() <> "false" AND blnRTEEditor AND blnWYSIWYGEditor Then

b.2. Thêm lên trên

intIndexPosition = int(RND() * UBound(saryEmoticons)) + 1