1. Trang chủ
  2. » Công Nghệ Thông Tin

Code lập trình - Bài 13 pdf

5 229 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 267,63 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Bài 13: Bạn có gửi bài/không gửi bài theo từng Chủ đề Tác giả: Phan Hồng Phúc phucorcl@yahoo.com 1.. Tạo file participated_inc.asp trong thư mục inlcudes có nội dung 1.. Mở file active

Trang 1

Bài 13: Bạn có gửi bài/không gửi bài theo từng Chủ đề

Tác giả: Phan Hồng Phúc (phucorcl@yahoo.com)

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

<%

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

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

rsParticipated.close

set rsParticipated = Nothing

%>

1 Mở file active_topics.asp

Trang 2

a.1 Tìm dò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)

2 Mở file forum_topics.asp

a.1 Tìm dò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)

3 Mở file _language_file_inc.asp

a.1 Tìm dòng code

Const strTxtAddMedia = "Nh&#7841;c Media"

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

Const strTxtYouHavePost = "B&#7841;n c&#243; g&#7917;i b&#224;i"

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

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

Bài 14: Sắp xếp bài viết trong từng Box cho việc hiển thị

Tác giả: Phan Hồng Phúc (phucorcl@yahoo.com)

Trang 3

1 Hình vẽ

2 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

Trang 4

arrLabelSortBy(1) = strtxtTopics

For nSortBy = 1 to Ubound(arrSortBy)

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

arrSortBy(nSortBy) & ">" & arrLabelSortBy(nSortBy) & "</option>"

else

">" & 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>

Trang 5

</table>

</div>

</fieldset>

<br />

3 Mở file forum_topics.asp

a.1 Tìm dò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>

4 Mở file ha_language_file_inc.asp

a.1 Tìm dòng code

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

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

Const strTxtSortBy = "S&#7855;p x&#7871;p theo"

Const strTxtOrderBy = "chi&#7873;u"

Const strTxtASC = "T&#259;ng d&#7847;n"

Const strTxtDESC = "Gi&#7843;m d&#7847;n"

Const strTxtResult = "K&#7871;t qu&#7843;"

 

Ngày đăng: 01/07/2014, 11:20

TỪ KHÓA LIÊN QUAN