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

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 initial lookup/load to forum returns no new topics
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mrose
Starting Member

Canada
43 Posts

Posted - 06 November 2001 :  12:26:33  Show Profile  Visit mrose's Homepage
I have an independant web part that runs out side of the forum that looks up a specific forum topic "announcments". When it loads for the first time it shows that there are "No Active Topics Found (2)". When you refresh the screen it displays all the topics within the announcments toic in the forum.

If you have a chance, go to http://support.power-soft.net/ using snitz/snitz for the log in and password and you will see...

Suggestions and comments are apreciated.

Code Below:

<%
'#################################################################################
'## Copyright (C) 2001 Chris Lang
'##
'## PowerSoft Development Corp.
'## 6660 Sooke Road, Suite 200
'## Sooke, B.C. V0S 1N0
'#################################################################################
%>
<!--#INCLUDE FILE="config.asp" -->
<!--#INCLUDE FILE="inc_functions.asp" -->
<%
strDBNTUserName = Request.Cookies(strUniqueID & "User")("Name")
strDBNTFUserName = Request.Form("Name")
if strAuthType = "nt" then
strDBNTUserName = Session(strCookieURL & "userID")
strDBNTFUserName = Session(strCookieURL & "userID")
end if

set my_Conn= Server.CreateObject("ADODB.Connection")
my_Conn.Open strConnString

'## Do Cookie stuffs with reload
nRefreshTime = Request.Cookies(strCookieURL & "Reload")

if Request.form("cookie") = "1" then
if strSetCookieToForum = 1 then
Response.Cookies(strCookieURL & "Reload").Path = strCookieURL
end if
Response.Cookies(strCookieURL & "Reload") = Request.Form("RefreshTime")
Response.Cookies(strCookieURL & "Reload").expires = strForumTimeAdjust + 365
nRefreshTime = Request.Form("RefreshTime")
end if

if nRefreshTime = "" then
nRefreshTime = 0
end if
mostRecent = "5"
%>
<script language="JavaScript">
<!-- hide from JavaScript-challenged browsers
function openWindow(url) {
popupWin = window.open(url,'new_page','width=400,height=400')
}
function openWindow2(url) {
popupWin = window.open(url,'new_page','width=400,height=450')
}
function openWindow3(url) {
popupWin = window.open(url,'new_page','width=400,height=450,scrollbars=yes')
}
function openWindow4(url) {
popupWin = window.open(url,'new_page','width=400,height=525')
}
function openWindow5(url) {
popupWin = window.open(url,'new_page','width=500,height=525,scrollbars=yes,toolbars=no,menubar=no,resizable=no')
}
// done hiding -->
</script><script language="JavaScript">
<!--
function SetLastDate()
{
document.LastDateFrm.submit()
}
//-->
</script><script language="JavaScript">
<!--
function jumpTo(s) {if (s.selectedIndex != 0) top.location.href = s.options[s.selectedIndex].value;return 1;}
// -->
</script>

<html>
<head>
<title><% =strForumTitle %></title>
<meta>
<LINK href="spsue.css" rel=stylesheet>
<LINK href="spsdash.css" rel=stylesheet>
</head>

<BODY TOPMARGIN="0" LEFTMARGIN="5" MARGINWIDTH="0" MARGINHEIGHT="0">
<%
if IsEmpty(Session(strCookieURL & "last_here_date")) then
Session(strCookieURL & "last_here_date") = ReadLastHereDate(strDBNTUserName)
end if
if lastDate = "" then
lastDate = Session(strCookieURL & "last_here_date")
end if

'## Forum_SQL - Get all active topics from last visit
strSql = "SELECT TOP " & MostRecent & " " & strTablePrefix & "TOPICS.T_STATUS, " & strTablePrefix & "FORUM.F_SUBJECT, "
strSql = strSql & strTablePrefix & "TOPICS.T_VIEW_COUNT, " & strTablePrefix & "TOPICS.FORUM_ID, "
strSql = strSql & strTablePrefix & "TOPICS.TOPIC_ID, " & strTablePrefix & "TOPICS.CAT_ID, "
strSql = strSql & strTablePrefix & "TOPICS.T_SUBJECT, " & strTablePrefix & "TOPICS.T_MAIL, "
strSql = strSql & strTablePrefix & "TOPICS.T_MESSAGE, " & strTablePrefix & "TOPICS.T_DATE "
strSql = strSql & "FROM " & strMemberTablePrefix & "TOPICS JOIN " & strTablePrefix & "FORUM ON "
strSql = strSql & strTablePrefix & "TOPICS.FORUM_ID = " & strTablePrefix & "FORUM.FORUM_ID "
strSql = strSql & "WHERE " & strTablePrefix & "TOPICS.FORUM_ID = 20 "
strSql = strSql & "AND " & strTablePrefix & "TOPICS.CAT_ID = 6 "
strSql = strSql & " ORDER BY " & strTablePrefix & "TOPICS.T_DATE DESC "

set rs = my_Conn.Execute (strSql)

%>
<table valign="top" width="100%">
<%If rs.EOF or rs.BOF then %>
<tr>
<td valign="top" colspan="2" class="body"><b><font color="#3570AA">No Active Topics Found (1)</font></b></td>
</tr>
<%else
currForum = 0
fDisplayCount = 0

do until rs.EOF

'## 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 = " & rs("CAT_ID")

set rsCStatus = my_Conn.Execute (StrSql)

'## Forum_SQL - Find out if the Topic 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 = " & rs("FORUM_ID")

set rsFStatus = my_Conn.Execute (StrSql)
if ChkForumAccess(rs("FORUM_ID")) then

AdminAllowed = 0
fDisplayCount = fDisplayCount + 1
%>
<tr>
<td colspan="2" valign="top" class="body">
<a href="JavaScript:openWindow5('pop_recent.asp?TOPIC_ID=<% =rs("TOPIC_ID") %>&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(left(rs("T_SUBJECT"), 50),"urlpath") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>' )" class=" link">
<b><% =ChkString(left(rs("T_SUBJECT"), 50),"display") %></b></a></td>
</tr>
<tr>
<td ></td>
<td valign="top" class="body"><% = Left(rs("T_MESSAGE"),200) %> ....</font><font COLOR="#808080">
[ <% =ChkDate(rs("T_DATE")) %> ]</font> </td>
</tr>
<tr>
<td width="5"></td>
<td valign="top" class="body">[
<a href="JavaScript:openWindow5('pop_recent.asp?TOPIC_ID=<% =rs("TOPIC_ID") %>&FORUM_ID=<% =rs("FORUM_ID") %>&CAT_ID=<% =rs("CAT_ID") %>&Topic_Title=<% =ChkString(left(rs("T_SUBJECT"), 50),"urlpath") %>&Forum_Title=<% =ChkString(rs("F_SUBJECT"),"urlpath") %>')">
Read More</a> ]<br>
</td>
</tr>
<tr>
<td valign="top" colspan="2" class="body">
<img height="6" border="0" src="spacer.gif"></td>
</tr>
<% end if
currForum = rs("FORUM_ID") %>
<% rs.MoveNext
loop

if fDisplayCount = 0 then %>
<tr>
<td colspan="2" class="body"><b><font color="#3570AA">No Active Topics Found (2)</font></b></td>
</tr>
<%else
%>
</tr>
<tr>
<td colspan="2" valign="top" bgcolor="#FFFFFF">
<p align="right">
<a target="_top" href="http://support.power-soft.net/SupportServices/Portal/Forums/">
<img border="0" src="link_annoucements.gif" alt="Click to read Annoucements"></a></td>
</tr>
<% end if
end if %>

</table>
<%
set rs = nothing
set rsForum = nothing
%><!--#INCLUDE FILE="inc_footer_recent.asp" -->


  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.27 seconds. Powered By: Snitz Forums 2000 Version 3.4.07