Topic Border
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=21402
Printed Date: 29 March 2026 at 12:52pm Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: Topic Border
Posted By: suedechaser
Subject: Topic Border
Date Posted: 26 September 2006 at 7:08am
Hi all,
Is it possible to put a border around just the first topic of a thread?
regards
suede
|
Replies:
Posted By: Hades
Date Posted: 26 September 2006 at 5:46pm
An easy way to do that would be to add a condition like
'Calculate the post number intThreadNo = (intRecordPositionPageNum - 1) * intThreadsPerPage <= insert AFTER this line, or intThreadNo won't be defined..
If intRecordPositionPageNum = 1 Then
<Include Border Code>
[include the full code to display one message]
<Include border code>
intThreadNo = intThreadNo + 1
[include the full Loop code here]
Else
[include the complete original code here]
End If
|
What this does (or should do) is check wether it is the first page of your thread. If it's the case, it will write down the first message, add 1 to intThreadNo, then go on with the standard message layout. You have to add 1 to intThreadNo, because the loop normally starts at "0" and adds 1 at the beginning. You want it to start at 2..
------------- Hades[hLcYb¿]
-What're quantum mechanics?
-I don't know. People who repair quantums, I suppose.
--Rincewind, Discworld
|
Posted By: suedechaser
Date Posted: 27 September 2006 at 1:30am
Hi Hades,
I understand what you are suggesting here.
I cannot work out where the different sections start and finish ie full code to display one message, full loop code and complete original code tht you indicated.
If you find a moment, could you please suggest where these lines may be in the code.
Thank you so far!
regards
suede
|
Posted By: Hades
Date Posted: 27 September 2006 at 11:07am
|
Right.. I took a clean version of WWF to do this, because mine has so many changes in it that the lines won't mean anything on yours..
Paste the following code between lines 731, below this code :
If intTotalRecords > 0 Then |
And line 1006, above this code :
'Else display there are no posts to display so display error message Else |
This is the Mod :
Before using, do a "replace" with your editing program, to replace *QUOTE* by QUOTE and *CODE* by CODE , this is because WWF uses the Quote and code tag, messing up the code below[code]'******************************************************************************* '************ Mod Add a border around the first post only.. '************ Mod by Hades, 2006 '******************************************************************************* 'Calculate the post number intThreadNo = (intRecordPositionPageNum - 1) * intThreadsPerPage
If intRecordPositionPageNum = 1 Then
'Calculate the thread number intThreadNo = intThreadNo + 1
' This is the *CODE* for the first post of a thread. If you want a border, ' add *CODE* somewhere around here %> <table class="tableBorder" align="center" cellspacing="1" cellpadding="3" style="table-layout: fixed;"> <tr class="tableLedger"> <td style="width:140px;" align="center"><% = strTxtAuthor %></td> <td align="center"><% = strTxtMessage %></td> </tr> <%
'SQL Query Array Look Up table '0 = tblThread.Thread_ID, '1 = tblThread.Message, '2 = tblThread.Message_date, '3 = tblThread.Show_signature, '4 = tblThread.IP_addr, '5 = tblThread.Hide, '6 = tblAuthor.Author_ID, '7 = tblAuthor.Username, '8 = tblAuthor.Homepage, '9 = tblAuthor.Location, '10 = tblAuthor.No_of_posts, '11 = tblAuthor.Join_date, '12 = tblAuthor.Signature, '13 = tblAuthor.Active, '14 = tblAuthor.Avatar, '15 = tblAuthor.Avatar_title, '16 = tblGroup.Name, '17 = tblGroup.Stars, '18 = tblGroup.Custom_stars '19 = tblGuestName.Name
'Read in threads details for the topic from the database lngMessageID = CLng(sarryPosts(0,intCurrentRecord)) strMessage = sarryPosts(1,intCurrentRecord) dtmPostDate = CDate(sarryPosts(2,intCurrentRecord)) strAuthorIP = sarryPosts(4,intCurrentRecord) blnHidePost = CBool(sarryPosts(5,intCurrentRecord)) lngUserID = CLng(sarryPosts(6,intCurrentRecord)) strUsername = sarryPosts(7,intCurrentRecord)
strAuthorHomepage = sarryPosts(8,intCurrentRecord) strAuthorLocation = sarryPosts(9,intCurrentRecord) lngAuthorNumOfPosts = CLng(sarryPosts(10,intCurrentRecord)) dtmAuthorRegistration = CDate(sarryPosts(11,intCurrentRecord)) strAuthorSignature = sarryPosts(12,intCurrentRecord)
strAuthorAvatar = sarryPosts(14,intCurrentRecord) strMemberTitle = sarryPosts(15,intCurrentRecord) strGroupName = sarryPosts(16,intCurrentRecord) intRankStars = CInt(sarryPosts(17,intCurrentRecord)) strRankCustomStars = sarryPosts(18,intCurrentRecord)
strGuestUsername = sarryPosts(19,intCurrentRecord)
'Calculate the row colour If intCurrentRecord MOD 2 = 0 Then strPostTableRowClass = "msgEvenTableRow" strPostTableSideClass = "msgEvenTableSide" Else strPostTableRowClass = "msgOddTableRow" strPostTableSideClass = "msgOddTableSide" End If
'If this is a hidden post then change the row colour to highlight it If blnHidePost Then strPostTableRowClass = "msgHiddenTableRow"
'If the poster is a guest see if they have entered their name in the GuestName table and get it If lngUserID = 2 AND strGuestUsername <> "" Then strUsername = strGuestUsername
'If the post contains a *QUOTE* or *CODE* block then format it If InStr(1, strMessage, "[*QUOTE*=", 1) > 0 AND InStr(1, strMessage, "[/*QUOTE*]", 1) > 0 Then strMessage = formatUser*QUOTE*(strMessage) If InStr(1, strMessage, "[*QUOTE*]", 1) > 0 AND InStr(1, strMessage, "[/*QUOTE*]", 1) > 0 Then strMessage = format*QUOTE*(strMessage) If InStr(1, strMessage, "[*CODE*]", 1) > 0 AND InStr(1, strMessage, "[/*CODE*]", 1) > 0 Then strMessage = format*CODE*(strMessage)
'If the post contains a flash link then format it If blnFlashFiles Then If InStr(1, strMessage, "[FLASH", 1) > 0 AND InStr(1, strMessage, "[/FLASH]", 1) > 0 Then strMessage = formatFlash(strMessage) If InStr(1, strAuthorSignature, "[FLASH", 1) > 0 AND InStr(1, strAuthorSignature, "[/FLASH]", 1) > 0 Then strAuthorSignature = formatFlash(strAuthorSignature) End If
'If the message has been edited parse the 'edited by' XML into HTML for the post If InStr(1, strMessage, "<edited>", 1) Then strMessage = editedXMLParser(strMessage)
'Call the function to highlight search words if coming froma search page If strSearchKeywords <> "" Then strMessage = searchHighlighter(strMessage, sarySearchWord) 'Calulate rowspan amount for table below side bar If CBool(sarryPosts(3,intCurrentRecord)) AND strAuthorSignature <> "" Then intPostRowsSpan = 4 Else intPostRowsSpan = 3 End If 'If we are showing ads increase by 1 If intCurrentRecord = 0 AND blnL*CODE* Then intPostRowsSpan = intPostRowsSpan + 1
%> <tr> <td rowspan="<% = intPostRowsSpan %>" valign="top" class="<% = strPostTableSideClass %>"> <a name="<% = lngMessageID %>"></a> <a href="member_profile.asp?PF=<% =lngUserID %>&FID=<% = intForumID & strQsSID2 %>"><% = strUsername %></a> <br /><% = strGroupName %> <br /><img src="<% If strRankCustomStars <> "" Then Response.Write(strRankCustomStars) Else Response.Write(strImagePath & intRankStars & "_star_rating.gif") %>" alt="<% = strGroupName %>"/> <br /><%
'If the user has an avatar then display it If blnAvatar = True AND strAuthorAvatar <> "" Then Response.Write("<img src=""" & strAuthorAvatar & """ alt=""" & strTxtAvatar & """ class=""avatar"" onError=""this.src='avatars/blank_avatar.jpg';""/>")
'If there is a title for this member then display it If strMemberTitle <> "" Then Response.Writ
------------- Hades[hLcYb¿]
-What're quantum mechanics?
-I don't know. People who repair quantums, I suppose.
--Rincewind, Discworld
|
Posted By: suedechaser
Date Posted: 27 September 2006 at 8:10pm
Hi Hades,
This looks very nice. Thank you!
You have been very kind with your time so far. If I may ask another question, is there also a way to remove the Author column from just the first post so only the message shows?
regards
suede
|
Posted By: Hades
Date Posted: 28 September 2006 at 12:03pm
Hi!
This shouldnae be a problem.. You'll have to remove the first line of the table and paste it on the second one (the one with "Author" and "message")..
So.. cut these lines (~line 748) :
<tr class="tableLedger"> <td style="width:140px;" align="center"><% = strTxtAuthor %></td> <td align="center"><% = strTxtMessage %></td> </tr> |
And paste it below the seond table code (the one for the rest of the messages).
Then remove these lines :
<td rowspan="<% = intPostRowsSpan %>" valign="top" class="<% = strPostTableSideClass %>"> <a name="<% = lngMessageID %>"></a> <a href="member_profile.asp?PF=<% =lngUserID %>&FID=<% = intForumID & strQsSID2 %>"><% = strUsername %></a> <br /><% = strGroupName %> <br /><img src="<% If strRankCustomStars <> "" Then Response.Write(strRankCustomStars) Else Response.Write(strImagePath & intRankStars & "_star_rating.gif") %>" alt="<% = strGroupName %>"/> <br /><%
'If the user has an avatar then display it If blnAvatar = True AND strAuthorAvatar <> "" Then Response.Write("<img src=""" & strAuthorAvatar & """ alt=""" & strTxtAvatar & """ class=""avatar"" onError=""this.src='avatars/blank_avatar.jpg';""/>")
'If there is a title for this member then display it If strMemberTitle <> "" Then Response.Write(vbCrLf & " <br />" & strMemberTitle)
'If not a guest post then display some details If lngUserID <> 2 Then
'Show the joined date Response.Write(vbCrLf & " <br /><br />" & strTxtJoined & ": " & DateFormat(dtmAuthorRegistration))
'If the is a location display it If strAuthorLocation <> "" Then Response.Write(vbCrLf & " <br />" & strTxtLocation & ": " & strAuthorLocation)
'If active users is enabled see if the user is online If blnActiveUsers Then
'Display if the user is online blnIsUserOnline = False
'Loop through the active users array For intLoop = 1 To UBound(saryActiveUsers, 2) If saryActiveUsers(1, intLoop) = lngUserID Then blnIsUserOnline = True Next
'Display if the user is online If blnIsUserOnline Then Response.Write(vbCrLf & " <br />" & strTxtOnlineStatus & ": " & strTxtOnLine2) Else Response.Write(vbCrLf & " <br />" & strTxtOnlineStatus & ": " & strTxtOffLine) End If
'Display the num of posts Response.Write(vbCrLf & " <br />" & strTxtPosts & ": " & lngAuthorNumOfPosts) End If %> <br /> </td>
|
(Still on the first part of the mod)
and change "<td colspan="2">" to "<td>" on what should now be around line 951..
Cheers..
------------- Hades[hLcYb¿]
-What're quantum mechanics?
-I don't know. People who repair quantums, I suppose.
--Rincewind, Discworld
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 1:46pm
Sorry Hades, I'm a little confused by :
...And paste it below the second table code (the one for the rest of the messages).
At what line number do I find the second table code you are referring to?
regards
suede
|
Posted By: Hades
Date Posted: 28 September 2006 at 2:38pm
Search for this line
<table class="tableBorder" align="center" cellspacing="1" cellpadding="3" style="table-layout: fixed;"> | the first one is the one on line 748, where you have to cut the code. The second one you'll find isn't followed by code for cells (<tr>etc...). That's where you paste it.
------------- Hades[hLcYb¿]
-What're quantum mechanics?
-I don't know. People who repair quantums, I suppose.
--Rincewind, Discworld
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 2:42pm
|
I'll have a look now.........
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 2:53pm
Oh dear.........it looks terrible.
OK. I cut from there....and past under there..
This cannot be right. ( see below)
Line999.....
' End of the first post. If required, add border CODE here
'Move to the next record
intCurrentRecord = intCurrentRecord + 1
'Add 1 to the Thread Number
intThreadNo = intThreadNo + 1
' This is the CODE for all other posts on the first page.
%>
<table class="tableBorder" align="center" cellspacing="1" cellpadding="3" style="table-layout: fixed;">
<table class="tableBorder" align="center" cellspacing="1" cellpadding="3" style="table-layout: fixed;">
<tr class="tableLedger">
<td style="width:140px;" align="center"><% = strTxtAuthor %></td>
<td align="center"><% = strTxtMessage %></td>
</tr>
|
Posted By: Hades
Date Posted: 28 September 2006 at 3:01pm
remove one of the "<table" lines.. you only need one..
------------- Hades[hLcYb¿]
-What're quantum mechanics?
-I don't know. People who repair quantums, I suppose.
--Rincewind, Discworld
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 3:08pm
The Author column is still there in the first post and the entire first post table is now against the left hand side of the screen.
Hmmmmmm. I think I will have to start again.
|
Posted By: Hades
Date Posted: 28 September 2006 at 3:30pm
|
Ok.. this is the modified version. Again, change *CODE* to CODE and *QUOTE* to QUOTE
[code]'******************************************************************************* '************ Mod Add a border around the first post only..
'************ 1st post without author '************ Mod by Hades, 2006 '******************************************************************************* 'Calculate the post number intThreadNo = (intRecordPositionPageNum - 1) * intThreadsPerPage
If intRecordPositionPageNum = 1 Then
'Calculate the thread number intThreadNo = intThreadNo + 1
' This is the *CODE* for the first post of a thread. If you want a border, ' add *CODE* somewhere around here %> <table class="tableBorder" align="center" cellspacing="1" cellpadding="3" style="table-layout: fixed;">
<%
'SQL Query Array Look Up table '0 = tblThread.Thread_ID, '1 = tblThread.Message, '2 = tblThread.Message_date, '3 = tblThread.Show_signature, '4 = tblThread.IP_addr, '5 = tblThread.Hide, '6 = tblAuthor.Author_ID, '7 = tblAuthor.Username, '8 = tblAuthor.Homepage, '9 = tblAuthor.Location, '10 = tblAuthor.No_of_posts, '11 = tblAuthor.Join_date, '12 = tblAuthor.Signature, '13 = tblAuthor.Active, '14 = tblAuthor.Avatar, '15 = tblAuthor.Avatar_title, '16 = tblGroup.Name, '17 = tblGroup.Stars, '18 = tblGroup.Custom_stars '19 = tblGuestName.Name
'Read in threads details for the topic from the database lngMessageID = CLng(sarryPosts(0,intCurrentRecord)) strMessage = sarryPosts(1,intCurrentRecord) dtmPostDate = CDate(sarryPosts(2,intCurrentRecord)) strAuthorIP = sarryPosts(4,intCurrentRecord) blnHidePost = CBool(sarryPosts(5,intCurrentRecord)) lngUserID = CLng(sarryPosts(6,intCurrentRecord)) strUsername = sarryPosts(7,intCurrentRecord)
strAuthorHomepage = sarryPosts(8,intCurrentRecord) strAuthorLocation = sarryPosts(9,intCurrentRecord) lngAuthorNumOfPosts = CLng(sarryPosts(10,intCurrentRecord)) dtmAuthorRegistration = CDate(sarryPosts(11,intCurrentRecord)) strAuthorSignature = sarryPosts(12,intCurrentRecord)
strAuthorAvatar = sarryPosts(14,intCurrentRecord) strMemberTitle = sarryPosts(15,intCurrentRecord) strGroupName = sarryPosts(16,intCurrentRecord) intRankStars = CInt(sarryPosts(17,intCurrentRecord)) strRankCustomStars = sarryPosts(18,intCurrentRecord)
strGuestUsername = sarryPosts(19,intCurrentRecord)
'Calculate the row colour If intCurrentRecord MOD 2 = 0 Then strPostTableRowClass = "msgEvenTableRow" strPostTableSideClass = "msgEvenTableSide" Else strPostTableRowClass = "msgOddTableRow" strPostTableSideClass = "msgOddTableSide" End If
'If this is a hidden post then change the row colour to highlight it If blnHidePost Then strPostTableRowClass = "msgHiddenTableRow"
'If the poster is a guest see if they have entered their name in the GuestName table and get it If lngUserID = 2 AND strGuestUsername <> "" Then strUsername = strGuestUsername
'If the post contains a *QUOTE* or *CODE* block then format it If InStr(1, strMessage, "[*QUOTE*=", 1) > 0 AND InStr(1, strMessage, "[/*QUOTE*]", 1) > 0 Then strMessage = formatUser*QUOTE*(strMessage) If InStr(1, strMessage, "[*QUOTE*]", 1) > 0 AND InStr(1, strMessage, "[/*QUOTE*]", 1) > 0 Then strMessage = format*QUOTE*(strMessage) If InStr(1, strMessage, "[*CODE*]", 1) > 0 AND InStr(1, strMessage, "[/*CODE*]", 1) > 0 Then strMessage = format*CODE*(strMessage)
'If the post contains a flash link then format it If blnFlashFiles Then If InStr(1, strMessage, "[FLASH", 1) > 0 AND InStr(1, strMessage, "[/FLASH]", 1) > 0 Then strMessage = formatFlash(strMessage) If InStr(1, strAuthorSignature, "[FLASH", 1) > 0 AND InStr(1, strAuthorSignature, "[/FLASH]", 1) > 0 Then strAuthorSignature = formatFlash(strAuthorSignature) End If
'If the message has been edited parse the 'edited by' XML into HTML for the post If InStr(1, strMessage, "<edited>", 1) Then strMessage = editedXMLParser(strMessage)
'Call the function to highlight search words if coming froma search page If strSearchKeywords <> "" Then strMessage = searchHighlighter(strMessage, sarySearchWord) 'Calulate rowspan amount for table below side bar If CBool(sarryPosts(3,intCurrentRecord)) AND strAuthorSignature <> "" Then intPostRowsSpan = 4 Else intPostRowsSpan = 3 End If 'If we are showing ads increase by 1 If intCurrentRecord = 0 AND blnL*CODE* Then intPostRowsSpan = intPostRowsSpan + 1
%> <tr> <td valign="top" class="<% = strPostTableRowClass %>"><%
'If the topic is not locked put in a link for someone to *QUOTE* this message If blnTopicLocked = False AND blnPollNoReply = False AND blnHidePost = False Then Response.Write("<span style=""float:right""><a href=""new_reply_form.asp?M=Q&PID=" & lngMessageID & "&PN=" & intTotalRecordsPages & "&TR=" & intTotalRecords & strQsSID2 & """><img src=""" & strImagePath & "*QUOTE*_icon.gif"" align=""absmiddle"" border=""0"" alt=""" & strTxt*QUOTE* & " " & strUsername & """/></a> <a href=""new_reply_form.asp?PID=" & lngMessageID & "&PN=" & intTotalRecordsPages & "&TR=" & intTotalRecords & strQsSID2 & """><img src=""" & strImagePath & "reply.gif"" align=""absmiddle"" border=""0"" alt=""" & strTxtReply & """/></a></span>")
'Display direct link to post Response.Write("<a href=""forum_posts.asp?TID=" & lngTopicID & "&PID=" & lngMessageID & strQsSID2 & "#" & lngMessageID & """ alt=""" & strTxtDirectLinkToThisPost & """><img src=""" & strImagePath & "bullet.gif"" border=""0"" align=""absmiddle"" alt=""bullet""/></a> ") 'If first record display topic title If intCurrentRecord = 0 Then Response.Write("<strong>") 'If a calendar event then display so If isDate(dtmEventDate) Then Response.Write(strTxtCalendarEvent & ": ") Else Response.Write(strTxtTopic & ": ") Response.Write(strSubject & "</strong><br /> &
------------- Hades[hLcYb¿]
-What're quantum mechanics?
-I don't know. People who repair quantums, I suppose.
--Rincewind, Discworld
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 3:45pm
Hi Hades,
I've tried it 3 times and get the following:
Microsoft VBScript compilation error '800a0400'
Expected statement
/forum/forum_posts.asp, line 1517
<%
^
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 3:48pm
Hades,
End If
'*******************************************************************************
'************ / Mod Add a border around the first post only..
'*******************************************************************************
<% ---------this is line 1517
End If
'*******************************************************************************
'************ / Mod Add a border around the first post only..'Else display there are no posts to display so display error message
Else
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 4:18pm
Hi Hades,
Yee Ha!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Thank you so much for all your help, patience and guidance.
regards
suede
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 4:21pm
Hang on a minute.
It worked once. Looked great.
When I tried to go to another topic I got the same error as before.
Thanks in advance Hades.
|
Posted By: Hades
Date Posted: 28 September 2006 at 4:22pm
glad it works!
------------- Hades[hLcYb¿]
-What're quantum mechanics?
-I don't know. People who repair quantums, I suppose.
--Rincewind, Discworld
|
Posted By: suedechaser
Date Posted: 28 September 2006 at 4:24pm
Hi Hades,
I did have some further troubles - but all sorted out now.
Again, thank so much for your time and patience. I hope to, one day, be in a position to help others out as you have helped me here today.
kindest regards
suede
|
|