Author |
Topic  |
|
MegaMan300
Starting Member
19 Posts |
Posted - 14 December 2000 : 14:51:32
|
You should be abel to have a catorgory only view and be abel to view one catagory at a time...
|
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
|
MegaMan300
Starting Member
19 Posts |
Posted - 14 December 2000 : 15:48:46
|
his demo isint working... :-(
|
 |
|
RichardKinser
Snitz Forums Admin
    
USA
16655 Posts |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 14 December 2000 : 20:35:16
|
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote> You should be abel to have a catorgory only view and be abel to view one catagory at a time... <hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
I needed the same type of thing for the site we are working on.
We wanted to have some categories represent sections of the website and have the ability to link directly to that category and display the forums for that specific category.
I've seen this similiar function on some other forums. So I took my best shot at doing the same thing.
The forum is still under construction... so some things <u>will</u> look funny. I've been working on using CSS, converting some things to stored procs when I can (don't have much time), and I have to work on a compromise between a fully moderated - screening every post <img src=icon_smile_sad.gif border=0 align=middle> and the current setup <img src=icon_smile.gif border=0 align=middle>. One of the compromises will be email validation. I haven't seen a full mod out yet, so maybe this can be my first contribution back to Snitz!!
Stop by and take a look. It's nothing fancy and it's NOT fully assembled yet. I just wanted to demonstrate another alternative to categories.
This is the Forum Home: http://www.writermag.com/wrt/devforum/
This is a category view: http://www.writermag.com/wrt/devforum/category.asp?cat_id=3
|
 |
|
MegaMan300
Starting Member
19 Posts |
Posted - 14 December 2000 : 21:39:38
|
this is nice
|
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 14 December 2000 : 22:37:47
|
Thanks. <img src=icon_smile.gif border=0 align=middle>
Is this close to what you were thinking?
|
 |
|
Maxwell
Starting Member
USA
42 Posts |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 15 December 2000 : 05:23:19
|
I have it working on the actual topic page but I have yet to back track to fix the previous page. One thing I'm attempting to do is eliminate the titles for the forums and topics out of the query string. I found that on the topic.asp page it's not really necessary to pass that information since there are three sql calls against the database. One for the topic, one for the forum, and one for the category. Since the database is already being hit, why not retrieve the titles from there?
Try it: http://www.writermag.com/wrt/devforum/topic.asp?TOPIC_ID=5&FORUM_ID=4&CAT_ID=1
Actually, I attempted another modification behind the scenes. <img src=icon_smile.gif border=0 align=middle>
|
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 15 December 2000 : 05:28:51
|
Okay...currently on topic.asp, here's lines 88 through 111
<pre id=code><font face=courier size=2 id=code> '## Forum_SQL - Find out if the Category is Locked or Un-Locked and if it Exists strSql = "SELECT " & strTablePrefix & "CATEGORY.CAT_STATUS " strSql = strSql & " FROM " & strTablePrefix & "CATEGORY " strSql = strSql & " WHERE " & strTablePrefix & "CATEGORY.CAT_ID = " & Request.QueryString("CAT_ID") set rsCStatus = my_Conn.Execute (StrSql) '## Forum_SQL - Find out if the Forum is Locked or Un-Locked and if it Exists strSql = "SELECT " & strTablePrefix & "FORUM.F_STATUS " strSql = strSql & " FROM " & strTablePrefix & "FORUM " strSql = strSql & " WHERE " & strTablePrefix & "FORUM.FORUM_ID = " & Request.QueryString("FORUM_ID") set rsFStatus = my_Conn.Execute (StrSql) '## Forum_SQL - Find out if the Topic is Locked or Un-Locked and if it Exists strSql = "SELECT " & strTablePrefix & "TOPICS.T_STATUS " strSql = strSql & " FROM " & strTablePrefix & "TOPICS " strSql = strSql & " WHERE " & strTablePrefix & "TOPICS.TOPIC_ID = " & Request.QueryString("TOPIC_ID") set rsTStatus = my_Conn.Execute (StrSql) if rsCStatus.EOF or rsCStatus.BOF or rsFStatus.EOF or rsFStatus.BOF or rsTStatus.EOF or rsTStatus.BOF then Response.Redirect(strForumURL) else ........ </font id=code></pre id=code>
The three recordsets are created and stay open until about line 220 where the sub Topic_nav is called. A couple additional lines are executed and then the recordsets are closed and set to nothing.
Line 109 is important...
Hopefully my modification is doing the same thing
[continued in next post]
Edited by - work mule on 15 December 2000 05:31:07 |
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 15 December 2000 : 05:38:40
|
So here's my modification:
<pre id=code><font face=courier size=2 id=code> ' ## Build Command Object for Topic Status Information Set objCmd = Server.CreateObject("ADODB.Command") objCmd.ActiveConnection = my_Conn objCmd.CommandText = "up_getStatus_Topic" objCmd.CommandType = adCmdStoredProc objCmd.Parameters.Append objCmd.CreateParameter("@TOPICID",adInteger,adParamInput,,intTOPIC_ID) Set objRS_Status = objCmd.Execute If objRS_Status.EOF or objRS_Status.BOF Then Response.Redirect(strForumURL) else strdisplay_CAT_TITLE = objRS_Status.Fields("CAT_NAME").Value strdisplay_FORUM_TITLE = objRS_Status.Fields("F_SUBJECT").Value strdisplay_TOPIC_TITLE = objRS_Status.Fields("T_SUBJECT").Value intCAT_STATUS = objRS_Status.Fields("CAT_STATUS").Value intFORUM_STATUS = objRS_Status.Fields("F_STATUS").Value intTOPIC_STATUS = objRS_Status.Fields("T_STATUS").Value end if objRS_Status.Close Set objRS_Status = Nothing Set objCmd = Nothing </font id=code></pre id=code>
I consolidated the three recordsets into one, well in this case a command object because I'm using a stored procedure. I retrieve the recordset, set the six values I'll need later to variables and then dispose of the object. Anyplace that made reference to the old recordset was replaced with the variable.
The following is the stored procedure which has the SQL statement.
<pre id=code><font face=courier size=2 id=code> SQL - Stored Proc - up_getStatus_Topic:
CREATE PROCEDURE up_getStatus_Topic (@TOPICID as int) AS
SELECT FORUM_TOPICS.T_SUBJECT, FORUM_TOPICS.T_STATUS, FORUM_TOPICS.TOPIC_ID, FORUM_FORUM.F_STATUS, FORUM_FORUM.F_SUBJECT, FORUM_CATEGORY.CAT_STATUS, FORUM_CATEGORY.CAT_NAME FROM FORUM_TOPICS INNER JOIN FORUM_FORUM ON FORUM_TOPICS.CAT_ID = FORUM_FORUM.CAT_ID AND FORUM_TOPICS.FORUM_ID = FORUM_FORUM.FORUM_ID INNER JOIN FORUM_CATEGORY ON FORUM_TOPICS.CAT_ID = FORUM_CATEGORY.CAT_ID WHERE (FORUM_TOPICS.TOPIC_ID = @TOPICID) </font id=code></pre id=code> <b><u>*** Please note ***</u></b> Seeing as this portion regarding the topic.asp was off topic, I reposted this under the following: http://forum.snitz.com/forum/topic.asp?TOPIC_ID=2864 Please post any comments regarding the sql code modification under that topic.
Edited by - work mule on 15 December 2000 15:34:11 |
 |
|
work mule
Senior Member
   
USA
1358 Posts |
Posted - 15 December 2000 : 05:43:53
|
Another modification that I made was to the topics page.
I allowed for people to make their own subject line if so desired. I figured this would be a nice feature and if the forum ever became threaded (I'm aware of the mod that exists) my forum would be ready for it! <img src=icon_smile.gif border=0 align=middle>
An example: http://www.writermag.com/wrt/devforum/topic.asp?TOPIC_ID=7&FORUM_ID=6&CAT_ID=3
Well that's all the cool stuff so far...I have a lot of work remaining!
|
 |
|
Da_Stimulator
DEV Team Forum Moderator
    
USA
3373 Posts |
Posted - 15 December 2000 : 11:02:06
|
wow... I guess you chose an appropriate name for the forums :) Work mule.
<font color=red>Da_Stimulator</font id=red> <font color=red>http://www.cfm-resources.com/s/stimmy/</font id=red> <font color=blue>response.write("I know what you coded last summer!")</font id=blue> http://www.tek-tips.com - The community where computer proffesionals meet and talk. |
 |
|
Maxwell
Starting Member
USA
42 Posts |
Posted - 17 December 2000 : 10:28:55
|
work mule <img src=icon_smile_question.gif border=0 align=middle>,
I sent an email about the code for the Writer Forum <img src=icon_smile_approve.gif border=0 align=middle> since I am looking to be able to display only one category at a time like you have there.
I was wondering if you got the email or if you just haven't had time to respond yet.
Not rushing you, mind you <img src=icon_smile.gif border=0 align=middle>. Just curious as to whether you received the email.
Edited by - maxwell on 17 December 2000 10:29:49 |
 |
|
work mule
Senior Member
   
USA
1358 Posts |
|
|
Topic  |
|