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

Code lập trình - Bài 7 & 8 doc

9 226 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 9
Dung lượng 226,98 KB

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

Nội dung

Copy images đè lên các file trong thư mục forum_images 3.. Copy default_style vào thư mục css_styles Bài 8: Music Tác giả: Phan Hồng Phúc phucorcl@yahoo.com 1.. Mở file functions_forma

Trang 1

Bài 7: Thay skin

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

1 Hình vẽ

2 Copy images đè lên các file trong thư mục forum_images

3 Copy default_style vào thư mục css_styles

Bài 8: Music

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

1 Mở file functions_format_post.asp

a.1 Tìm dòng code

Trang 2

'Return the function

searchHighlighter = strTempMessage

End Function

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

Function formatWMAPL(ByVal strMessage)

Dim saryWMAAttributes 'Holds the features of the input WMA file

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

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

Do While InStr(1, strMessage, "[MUSIC", 1) > 0 AND InStr(1, strMessage,

"[/MUSIC]", 1) > 0

Trang 3

'Get the WMA BBcode from the message

lngEndPos = InStr(lngStartPos, strMessage, "[/MUSIC]", 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

lngEndPos-lngStartPos))

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

lngEndPos = InStr(lngStartPos, 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

'Place any attributes for the WMA file in an array

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)

Trang 4

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

"WIDTH=", 1) Then

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

= CInt(strWMAWidth)

End If

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

"HEIGHT=", 1) Then

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

= CInt(strWMAHeight)

End If Next

'Get the link to the WMA file

Trang 5

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

1)

'Make sure the end position is not in error

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

(lngEndPos - lngStartPos)))

'Build the HTML for the displying of the WMA file

'==========================================================

============

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

Trang 6

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

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

strBuildWMALink, 1, -1, 1)

Else

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

Trang 7

Loop

'Return the function

End Function

2 Mở file forum_posts.asp

a.1 Tìm dòng code

If blnFlashFiles Then

strMessage, "[/FLASH]", 1) > 0 Then strMessage = formatFlash(strMessage)

strAuthorSignature, "[/FLASH]", 1) > 0 Then strAuthorSignature =

formatFlash(strAuthorSignature)

End If

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

If InStr(1, strMessage, "[MUSIC", 1) > 0 AND InStr(1, strMessage, "[/MUSIC]", 1) > 0 Then

End If

3 Mở file forum_codes.asp

a.1 Tìm dòng code

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">[FLASH WIDTH=50

Trang 8

</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">[FLASH WIDTH=150

</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

</tr><%

End If

4 Mở file ha_language_file_inc.asp

a.1 Tìm dòng code

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

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

Trang 9

Const strTxtMediaFiles = "Music"

 

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

TỪ KHÓA LIÊN QUAN