Author |
Topic  |
animedj
Junior Member
 
USA
190 Posts |
|
marc
Junior Member
 
Belgium
175 Posts |
Posted - 16 August 2000 : 08:26:46
|
Waouw, thanks animedj ! It works fine. In the instructions you should add to replace the "strconnect" variable by the database connection string. You really have good ideas.
<font color=green><b><i>Marc Valentin</i></b> </font id=green> |
 |
|
Rigger82
Junior Member
 
USA
311 Posts |
Posted - 16 August 2000 : 11:07:27
|
Great work on this... I tried it out and only had one concern which I think I fixed and the others were just as commented previously.
1. Added the strConnect to the slash.asp page. 2. Added include to the top of the page before code starts... <!--#include virtual = "/forums/inc_functions.asp" --> 3. Noticed that smilies in the posts were breaking (because the images from the forums are set to the same directory as the forums themselves.. so I wrote in a replace.
<b>Added location variable:</b> ImageLoc = "/forums/" (set this to your forum location)
<b>Replace</b> <pre id=code><font face=courier size=2 id=code><%=T_Message%></font id=code></pre id=code> with... <pre id=code><font face=courier size=2 id=code><%= Replace(T_MESSAGE, "icon", ImageLoc & "icon") %></font id=code></pre id=code>
Seems to work fine this way with the smilies, obviously it only works with the ICON named files that snitz uses.
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net |
 |
|
Rigger82
Junior Member
 
USA
311 Posts |
Posted - 16 August 2000 : 11:11:02
|
Just noticed that signatures come up on the same line (so I am thinking that the line breaks are not showing up... anyone know how we can format the post so it comes out with the carriage returns?
I am going for this idea and want to combine with the statistics that you made so users can get a quick capsule of the forum.
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net |
 |
|
Rigger82
Junior Member
 
USA
311 Posts |
Posted - 16 August 2000 : 11:34:52
|
Uh oh.. just found something. The displayed topics do not seem to be taking into account the security status... so posts that are in private forums get into the display.
Going to look into it... also, renamed that ImageLoc to ForumLoc and used it in the href's that point to the "read more" because you have hardcoded the /community/... information. I also moved my replace code underneath all of the "T_Message = Replace" ones you already had.
Sounds like I am being an ungrateful jerk but actually... I love it and am trying to refine it for myself and noting some stuff in the meatime...
Other cosmetic things. Took off the link for the "comments" since I would rather push them to read the posts so the "read more" is sufficient and I change the string from "X comment(s)" to "X reply(s)"
Please dont flame me.. just helping out. I can post the modified code if anyone needs/wants it.
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net |
 |
|
animedj
Junior Member
 
USA
190 Posts |
Posted - 16 August 2000 : 13:54:41
|
I just fixed the zip file so some errors in the add-on are fixed and also the option to format the message as it would appear in the forum, thought I don't recommend this as it might mess up one currently layout.
|
 |
|
marc
Junior Member
 
Belgium
175 Posts |
Posted - 16 August 2000 : 14:19:39
|
animedj, did you fix the security problem ?
<font color=green><b><i>Marc Valentin</i></b> </font id=green> |
 |
|
marc
Junior Member
 
Belgium
175 Posts |
Posted - 16 August 2000 : 14:22:02
|
Oh sorry... I see you did. <img src=icon_smile_wink.gif border=0 align=middle> Great job.
<font color=green><b><i>Marc Valentin</i></b> </font id=green> |
 |
|
Rigger82
Junior Member
 
USA
311 Posts |
Posted - 16 August 2000 : 15:03:02
|
Made some of my modifications... still having trouble with formatting on your original, the code below is my changes. You'll notice the replace for fixing the images (try putting smilies in yours... they break). Items in bold are changes
<pre id=code><font face=courier size=2 id=code> <b><!--#include virtual = "/forums/inc_functions.asp" --></b>
<%
' SLASH for SNITZ ' fixes,bugs, suggestion at webmaster@animedj.com ' ' ' Installation : Just add this file as an include in the page where you would want to be displayed ' but before this include, you have to also include the inc_functions.asp from your snitz forum ' ' and Also dont forget to set up slPosts to the number of messages that you want to show, ' and slLenght to the number of characters that you want to show for each message. ' (default: posts = 5, characters = 150)
Dim T_Subject, F_Subject, T_Message, FORUM_ID, CAT_ID, T_REPLIES, T_DATE, TOPIC_ID, slPosts, slLenght slPosts = 5 ' number of posts slLength = 150 ' number of characters <b>ForumLoc = "/forums/" ' directory that your forum application files are in.</b>
Set objConn = Server.CreateObject("ADODB.Connection") Set objRec = Server.CreateObject("ADODB.RecordSet") <b>strConnect = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=d:\<font color=red>...</font id=red>\snitz_forums_2000.mdb" '## MS Access 97</b> objConn.Open strConnect ' replace strConnect with you connection String
' DO NOT MODIFY BELOW THIS LINE strSQL = "SELECT TOP " & slPosts & _ " FORUM_TOPICS.CAT_ID, " & _ "FORUM_TOPICS.FORUM_ID, " & _ "FORUM_TOPICS.TOPIC_ID, " & _ "FORUM_TOPICS.T_SUBJECT, " & _ "FORUM_TOPICS.T_REPLIES, " & _ "FORUM_TOPICS.T_DATE, " & _ "FORUM_FORUM.F_SUBJECT, " & _ "FORUM_TOPICS.T_MESSAGE " & _ "FROM FORUM_TOPICS " & _ "INNER JOIN FORUM_FORUM ON " & _ "FORUM_TOPICS.FORUM_ID = FORUM_FORUM.FORUM_ID " & _ "WHERE FORUM_FORUM.F_PRIVATEFORUMS = 0 " & _ "ORDER BY FORUM_TOPICS.TOPIC_ID DESC;" set objRec = objConn.Execute(strSql)
While NOT objRec.EOF T_Subject = objRec("T_SUBJECT") F_Subject = objRec("F_SUBJECT") T_Message = objRec("T_MESSAGE") FORUM_ID = objRec("FORUM_ID") CAT_ID = objRec("CAT_ID") T_REPLIES = objRec("T_REPLIES") T_DATE = objRec("T_DATE") TOPIC_ID = objRec("TOPIC_ID")
<b>If Len(T_Message) > slLength Then T_Message = Left(T_Message, slLength) & "..." End If</b> <font color=red>Added this so that short replies dont have to have the "..." all the time, only if over the 150 length</font id=red>
' if you want to be formatted as per the forums uncomment the following line
' T_Message = formatStr(T_message)
' and comment out the following 4 lines
'T_Message = replace(T_Message, "<img src=""","",1,-1,1) 'T_Message = replace(T_Message, """ border=0>","", 1, -1, 1) 'T_Message = replace(T_Message, "center","", 1, -1, 1) 'T_Message = replace(T_Message, "<img","",1,-1,1) <b>T_Message = replace(T_Message, "icon", ForumLoc & "icon")</b>
%> <title></title> <p><font size="2"><b><%= T_SUBJECT%></b><br> <%= T_MESSAGE %></font><br> <font size="1" face="Verdana, Arial, Helvetica, sans-serif">Posted on <b><%= ChkDate(T_DATE) %></b> at <%= ChkTime(T_DATE) %> [ <a href="<b><%=ForumLoc%></b>topic.asp?TOPIC_ID=<%= TOPIC_ID %>&FORUM_ID=<%= FORUM_ID %>&CAT_ID=<%= CAT_ID %>&Topic_Title=<%= ChkString(T_SUBJECT,"urlpath") %>&Forum_Title=<%= ChkString(F_SUBJECT,"urlpath") %>&M=0">Read more</a> | <%= T_REPLIES %> <b>reply(s)</b> ]</font></p>
<% objRec.MoveNext() Wend
objRec.Close set objRec = Nothing objConn.Close set objConn = Nothing %> </font id=code></pre id=code>
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net
Edited by - Rigger82 on 16 August 2000 15:05:37 |
 |
|
Rigger82
Junior Member
 
USA
311 Posts |
Posted - 16 August 2000 : 15:09:39
|
Note: Looking to change WHAT data is displayed... I have a bunch of topics that may be old but get replies on all the time, I want to output the latest topics that have been replied to.
Need to write the SQL to poll for the most replies and then order by date.. then take the top 5 and show the same topic information and instead of the topic time and date, show that date of the last post and maybe that persons username.
What do you think? Sound reasonable?
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net |
 |
|
marc
Junior Member
 
Belgium
175 Posts |
Posted - 16 August 2000 : 15:16:33
|
Mark, you shouldn't give the location of your database on the forum, it's not a good security practice... I suggest you edit your message.
What should be added to the script is the name of the poster ( posted on...<b>by xxx</b>).
I don't think it's a good idea to put the include for inc_functions.asp inside the script.
<font color=green><b><i>Marc Valentin</i></b> </font id=green> |
 |
|
Rigger82
Junior Member
 
USA
311 Posts |
Posted - 16 August 2000 : 15:25:38
|
No big deal on the location thing (even though it looks like some admin/moderator did it for me)... WAY deep inside a network behind a major firewall and running on the intranet so I am safe... but I did think about it before posting.
Since the whole file is intended to be included and the instructions read to make sure to add the inc_functions.asp file, I just skipped a step and added the line in before the script starts.
I agree, the username should be there too.
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net
Edited by - Rigger82 on 16 August 2000 15:29:39 |
 |
|
marc
Junior Member
 
Belgium
175 Posts |
Posted - 16 August 2000 : 15:31:18
|
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> Since the whole file is intended to be included and the instructions read to make sure to add the inc_functions.asp file, I just skipped a step and added the line in before the script starts. <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote> I think this include instruction should be located in the main page not in the included one. If there is already an include for inc_functions.asp in the main page, with your system the file would be included twice...
<font color=green><b><i>Marc Valentin</i></b> </font id=green> |
 |
|
Rigger82
Junior Member
 
USA
311 Posts |
Posted - 16 August 2000 : 15:34:49
|
Yeah... that COULD happen, no big deal.
--------------------- Mark Christianson Gulf War Veteran (82nd Airborne Division) Owner/Operator of www.paratrooper.net Rigger@paratrooper.net |
 |
|
animedj
Junior Member
 
USA
190 Posts |
Posted - 16 August 2000 : 15:39:42
|
I'll rewrite the code so it would have the username, and this add-on it's based on the slashdot.org site so that's why it show the latest topics posted.. and no the more popular ones.
yeah , the include has be in the main page, that's why in the instructions i wrote to include the inc_functions before this include.. I didn't specify path because that's something that I won't be accurate every time. ^^;;
|
 |
|
YNG
Starting Member
Sweden
3 Posts |
Posted - 17 August 2000 : 07:00:48
|
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> yeah , the include has be in the main page, that's why in the instructions i wrote to include the inc_functions before this include.. <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
... also ...
If you have a main page which take advantage of the inc_top.asp, config.asp and inc_footer.asp you can comment out the connection string or else you will have two of them. Don´t know if that matters, but since it is not needed to I guess it is best to take one of them out(?).
Example: <pre id=code><font face=courier size=2 id=code>'Set objConn = Server.CreateObject("ADODB.Connection") Set objRec = Server.CreateObject("ADODB.RecordSet")
'objConn.Open strConnString</font id=code></pre id=code>
... and change the Record Set:
<pre id=code><font face=courier size=2 id=code>'set objRec = objConn.Execute(strSql) set objRec = my_Conn.Execute (StrSql)</font id=code></pre id=code>
... and comment out the connection closing:
<pre id=code><font face=courier size=2 id=code>objRec.Close set objRec = Nothing 'objConn.Close 'set objConn = Nothing</font id=code></pre id=code>
|
 |
|
Topic  |
|