Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/Code)
 Mod: Search Keyword Highlighting
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Nathan
Help Moderator

USA
7664 Posts

Posted - 29 March 2002 :  00:01:05  Show Profile  Visit Nathan's Homepage
Title: Search Highlighter
By: Nathan Bales of ls3k.com
Download: http://www.ls3k.com/snitz/mods.asp?action=details&ID=91
Support: http://forum.snitz.com/forum/forum.asp?FORUM_ID=94

Compatability: 3.3.03

Features:
  • Highlights keywords in threads accessed from search page results.


Ease of Installation (1-Hard, 10-Easy): 8

Demo: http://www.ls3k.com/shighlight/

README: Readme.html

  Nathan Bales - Romans 15:13
----------------------------------

Snitz Exchange | Do's and Dont's

blackinwhite
Average Member

Turkey
657 Posts

Posted - 30 March 2002 :  10:07:06  Show Profile
very useful, and easy-to-implement mod.

thanks for the great work.

Go to Top of Page

blackinwhite
Average Member

Turkey
657 Posts

Posted - 30 March 2002 :  10:15:41  Show Profile
for those who use "polls mod", an extra change can be needed for the Poll question:... line.

Go to Top of Page

Intrepidone
Average Member

Canada
515 Posts

Posted - 30 March 2002 :  11:15:24  Show Profile
Really nice MOD Nathan

Very useful tool for search.asp as you can just glance through the text now in a search.

Intrepidone
Go to Top of Page

Webguy
New Member

Australia
65 Posts

Posted - 29 August 2002 :  01:40:10  Show Profile  Send Webguy an ICQ Message
I am using this mod, one of my users has said they tried to do a search based on a user, and then just enters a space as the search string to return every post made by that user.

It returns results ok, but as soon as you click on a topic you get...

Microsoft VBScript runtime error '800a0005'
Invalid procedure call or argument: 'Mid'
/discussion_forums/topic.asp, line 910

Line 910 reads...
if lcase(mid(fStrMessage, iPos, len(fArr(i)))) = lcase(fArr(i)) then

Anyone else had this problem?

"Special bulletin: There is still no news from New Zealand. If they ever have any, we'll be sure to let you know."
Go to Top of Page

ajhvdb
Junior Member

Netherlands
392 Posts

Posted - 29 August 2002 :  06:15:13  Show Profile
quote:
Originally posted by Nathan
Demo: http://www.ls3k.com/shighlight/



This one doesn't work at the moment
Go to Top of Page

Etymon
Advanced Member

United States
2385 Posts

Posted - 29 August 2002 :  09:46:14  Show Profile  Visit Etymon's Homepage

Definitely a classic, Nathan! Thanks for reminding us of it.

Etymon
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 23 September 2002 :  06:21:27  Show Profile  Visit richfed's Homepage
quote:
Originally posted by blackinwhite

for those who use "polls mod", an extra change can be needed for the Poll question:... line.





Might anyone know what that poll mod-related line[s] change might be?

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 24 September 2002 :  18:52:42  Show Profile  Visit richfed's Homepage
Ok, on lines 601-610, on topic.asp, the MOD calls for this:

quote:
if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then %>
 <a href="JavaScript:openWindow('pop_delete.asp?<%= ArchiveLink %>mode=Topic&TOPIC_ID=<% =Topic_ID %>&FORUM_ID=<% =Forum_ID %>&CAT_ID=<% =Cat_ID %>&Topic_Title=<% =ChkString(Topic_Subject,"JSurlpath") %>')"><img border="0" src="icon_delete_reply.gif" alt="Delete Topic" height=15 width=15 hspace=6></a>
<% end if %>
<hr noshade size="1">

<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% if request("SearchTerms") = "" then response.write formatStr(Topic_Message) else response.write SearchHighlight(formatStr(Topic_Message)) end if'Ls3k Search Highlight :: Modified%></font></td>

</tr>
<%
End Sub


However, with the Poll Mod installed, it all looks different. I tried this [below] but it ended up with the text from a post appearering in the header cell:

quote:
if (AdminAllowed = 1) or (lcase(strNoCookies) = "1") then %>
 <a href="JavaScript:openWindow('pop_delete.asp?<%= ArchiveLink %>mode=Topic&TOPIC_ID=<% =Topic_ID %>&FORUM_ID=<% =Forum_ID %>&CAT_ID=<% =Cat_ID %>&Topic_Title=<% =ChkString(Topic_Subject,"JSurlpath") %>')"><img border="0" src="icon_delete_reply.gif" alt="Delete Topic" height=15 width=15 hspace=6></a>
<% end if %>
<hr noshade size="1">
<% ' ###################### Poll Mod ########################
if rsTopic("T_ISPOLL") then %>
<% if (Request.Querystring("pollresults") <> "1") and ((Cat_Status <> 0) and (Forum_Status <> 0) and (Topic_Status <> 0)) then%>
<table border="0" width="100%">
<tr>
<td valign="top">
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Poll Question:</b></font><br>
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% =formatStr(Topic_Message) %></font>
<table border="0" width="100%">
<form method="POST" action="topic.asp?TOPIC_ID=<%=Topic_ID%>&pollresults=1" name="Vote">
<tr>
<td width="100%" bgcolor="<% =strForumFirstCellColor %>" align="left">
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><br><b>Choices:</b></font><br>

<%
Dim nDef
Dim nTotal
Dim nnTotal

For nCount=1 To 8
If trim(vAnswers(nCount)) <> "" Then %>
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><input type="radio" value="<%=nCount%>" name="R1"><%=vAnswers(nCount)%></font><br>
<% End If
Next%>
</td>
</tr>
<% if rsTopic("T_ISPOLL") then %>
<tr>
<td width="100%" bgcolor="<% =strForumFirstCellColor %>" align="left"><br>
<% if strGfxButtons <> "0" then %>
<input type="image" src="vote.gif" name="vote" border="0" hspace="5">
<% else %>
<input type="submit" value="Vote Now!" name="vote">
<% end if %>
<input name="Method_Type" type="hidden" value="Vote">
<input name="TOPIC_ID" type="hidden" value="<% =ChkString(Topic_ID, "hidden") %>">
<input name="MEMBER_ID" type="hidden" value="<% =getMemberNumber(strDBNTUserName) %>">
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><a href="topic.asp?TOPIC_ID=<%=Topic_ID%>&pollresults=1">View Results</a></font>
</td>
</tr>
<% end if %>
</form>
</table>
<% if strWhoVotes = "members" and mlev = 0 then %>
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strFooterFontSize %>"><b>Who Can Vote?</b> Only Members can vote. You need to <a href="policy.asp">register</a> or be logged in to vote.</font>
<% end if %>
</td>
</tr>
</table>
<% end if
else %>
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% =formatStr(Topic_Message) %></font>
<% end if %>

<% if rsTopic("T_ISPOLL") then
if (Request.Querystring("pollresults") = "1") or ((Cat_Status = 0) or (Forum_Status = 0) or (Topic_Status = 0)) then %>
<table border="0" width="100%">
<tr>
<td valign="top">
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Poll Question:</b></font><br>
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% =formatStr(Topic_Message) %></font><br><br>
<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><b>Results:</b></font>
<table border="0" cellpadding="3" align="left" width="100%">
<tr>
<td>
<table border="0" cellPadding="3" cellSpacing="0" width="95%" align="center">
<%
Dim nMaxValue, nLowValue

'First of all get max value and nLowValue
nMaxValue = 0
For nCount=1 To 8
If trim(vAnswers(nCount)) <> "" and vCount(nCount) > nMaxValue Then
nMaxValue = vCount(nCount)
End If
Next

If nMaxValue = 0 Then
nMaxValue = 1
End If

Dim nMaxWidth
Dim vPercent(100)
nMaxWidth = 200 'This is number of pixels for maxvalue
Dim nThisVal, nPercent

nTotal = 0
nnTotal = 0

'1. Go through all and get total
For nCount = 1 To 8
If trim(vAnswers(nCount)) <> "" Then
nTotal = nTotal + vCount(nCount)
nnTotal = nnTotal + vCount(nCount)
End If
Next

If nnTotal = 0 Then
nnTotal = 1
End If

'2. Go through all and get percent
For nCount = 1 To 8
If trim(vAnswers(nCount)) <> "" Then
vPercent(nCount) = FormatNumber(vCount(nCount)/nnTotal*100,1)
End If
Next

For nCount=1 To 8
If trim(vAnswers(nCount)) <> "" Then
nThisVal = FormatNumber(vCount(nCount)/nMaxValue * nMaxWidth,0)
%>
<tr>
<td width="30%"><font face="<% =strDefaultFontFace %>" color="<% =strForumFontColor %>" size="<% =strDefaultFontSize %>"><%=vAnswers(nCount)%></font></td>
<td nowrap><font face="<% =strDefaultFontFace %>" color="<% =strForumFontColor %>" size="<% =strDefaultFontSize %>"><img src="bar.gif" width="<%=nThisVal%>" height="10">  (<%=vPercent(nCount)%> %)</font></td>
<td nowrap width="10%"><font face="<% =strDefaultFontFace %>" color="<% =strForumFontColor %>" size="<% =strDefaultFontSize %>"><%=vCount(nCount)%> votes</font></td>
</tr>
<%
End If
Next
%>
</table>
</td>
</tr>
<tr>
<td align="center"><font face="<% =strDefaultFontFace %>" color="<% =strForumFontColor %>" size="<% =strFooterFontSize %>"><br><b>Total Votes:</b> <%=nTotal%> counted<br>
<b>Last Vote:</b> <% =ChkDate(rsTopic("T_LAST_VOTE")) & ChkTime(rsTopic("T_LAST_VOTE")) %></font></td>
</tr>
</table>
</td>
</tr>
</table>
<% end if
end if
' #####################################################################################
%> </td>

<font color="<% =strForumFontColor %>" face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><% if request("SearchTerms") = "" then response.write formatStr(Topic_Message) else response.write SearchHighlight(formatStr(Topic_Message)) end if'Ls3k Search Highlight :: Modified%></font></td>

</tr>
<%
End Sub


What need I change in this?

Thanks for any assistance!

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 24 September 2002 :  22:38:30  Show Profile
hi~ richfed,
Hmm.. the Poll Modded topic.asp file really get us confused sometimes.

but i think Nathan's Search Highlight Mod is "easy install and great feature addon !". i like MODs as this !!

in my case, the topic.asp modification about your question just like this..
* search for this
<% =formatStr(Topic_Message) %>
and replace with
<% if request("SearchTerms") = "" then response.write formatStr(Topic_Message) else response.write SearchHighlight(formatStr(Topic_Message)) end if'Ls3k Search Highlight :: Modified%>

(there should be total 3 places need modified by a Poll modded topic.asp file)

hope this will help you something.
Go to Top of Page

richfed
Average Member

United States
999 Posts

Posted - 25 September 2002 :  13:55:12  Show Profile  Visit richfed's Homepage
Well, that worked! Tested search ... tested polls ... everything seems just fine!

For anyone else who might get stuck in this same place, on topic.asp, make the first and third changes as shown in the mod's sample topic.asp file. For the second, - assuming, of course, you have the poll mod installed - do as DoraMoon says above. That's a total of 5 changes on topic.asp.

Thank you, DoraMoon!

Rich
[size=1]A Complete Idiot's Guide to MOD Implementation || On the Trail of the Last of the Mohicans[/size=1]
Go to Top of Page

DoraMoon
Average Member

Taiwan
661 Posts

Posted - 25 September 2002 :  15:39:46  Show Profile
quote:
Originally posted by richfed

That's a total of 5 changes on topic.asp.

It's mean we have a "different" Poll Mod installed...
i'd better going to check it again! maybe i miss something.....
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.16 seconds. Powered By: Snitz Forums 2000 Version 3.4.07