| Author |
Topic Search Topic Options
|
claytone19
Newbie
Joined: 16 February 2005
Status: Offline
Points: 20
|
Post Options
Thanks(0)
Quote Reply
Topic: View posts since last visit MOD Posted: 23 February 2005 at 12:56pm |
|
Is there a "View posts since last visit" Mod for Web Wiz?
Or is there something like already that I am overlooking?
I don't want just active topics, all posts that have been posted since the last time the user logged in.
thanks
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 February 2005 at 1:55pm |
|
How is that different from active topics?
Edited by dpyers - 23 February 2005 at 4:39pm
|
Lead me not into temptation... I know the short cut, follow me.
|
 |
wistex
Mod Builder Group
Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
|
Post Options
Thanks(0)
Quote Reply
Posted: 23 February 2005 at 5:52pm |
|
If you click on "Active Topics" it automatically gives you the posts since last visit. There is also a drop down box where you can specify a different time range if you so desire.
Edited by wistex - 24 February 2005 at 12:49am
|
|
|
 |
claytone19
Newbie
Joined: 16 February 2005
Status: Offline
Points: 20
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 February 2005 at 1:04am |
|
thanks, I just realized that.
Now I will write code at login to check if there are any posts since
the user logged in and if so display "there are 10 new messages since
you last logged in" with a link to active topics since lastvisit date.
thanks guys for the responses
|
 |
dpyers
Senior Member
Joined: 12 May 2003
Status: Offline
Points: 3937
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 February 2005 at 10:50am |
|
There's a few mods around that do just that. Check the mods forum.
|
Lead me not into temptation... I know the short cut, follow me.
|
 |
claytone19
Newbie
Joined: 16 February 2005
Status: Offline
Points: 20
|
Post Options
Thanks(0)
Quote Reply
Posted: 26 February 2005 at 10:15pm |
|
Too late, I already wrote my own stored procedure.
Thanks though.
|
 |
wistex
Mod Builder Group
Joined: 30 August 2003
Location: United States
Status: Offline
Points: 877
|
Post Options
Thanks(0)
Quote Reply
Posted: 01 March 2005 at 7:32pm |
That is exactly what I need. Could you provide the code for the mod? Thanks. 
|
|
|
 |
claytone19
Newbie
Joined: 16 February 2005
Status: Offline
Points: 20
|
Post Options
Thanks(0)
Quote Reply
Posted: 02 March 2005 at 10:56pm |
|
Well,
I simplified the following ASP code, so that you can integrate it into
your site the way you want. You can add to it as much as you like. The
message only displays to members logged into your forum and only then
if there is active topics since last visit.
Here is the code for the stored procedure.
##############################################################
CREATE PROCEDURE [dbo].[wwfSpActiveTopicsCount]
(
@AuthorID int,
@GroupID int,
@GroupPerm int,
@dblActiveFrom datetime
)
AS
SELECT Count(tblTopic.Topic_ID) as TopicCount
FROM tblCategory, tblForum, tblTopic
WHERE ((tblCategory.Cat_ID = tblForum.Cat_ID AND tblForum.Forum_ID =
tblTopic.Forum_ID) AND (tblTopic.Last_entry_date > @dblActiveFrom))
AND (tblForum.[Read] <= @GroupPerm OR (tblTopic.Forum_ID IN (
SELECT tblPermissions.Forum_ID
FROM tblPermissions
WHERE tblPermissions.Author_ID = @AuthorID OR
tblPermissions.Group_ID = @GroupID AND tblPermissions.[Read]=1))
)
;
##########################################################
On your home page make sure you include this file:
<!--#include file="forum/common.asp" -->
Then you will want to add code similer to this:
<%
' ##########################################################
If strLoggedInUsername <> "" Then
Response.write "Welcome <span class=bold>" & strLoggedInUsername & "</span>
IF strLoggedInUsername <> "Guest" and Session("dtmLastVisit") <> "" Then
If intGroupID = 2 Then ' GUEST
intForumGroupPermission = 1
ElseIf intGroupID = 1 Then ' ADMIN
intForumGroupPermission = 4
Else ' EVERYONE ELSE
intForumGroupPermission = 2
End If
strSQL = "EXECUTE wwfSpActiveTopicsCount @dblActiveFrom =
'" & Session("dtmLastVisit") & "', @AuthorID = " &
lngLoggedInUserID & ", @GroupID = " & intGroupID & ",
@GroupPerm = " & intForumGroupPermission
rsCommon.Open strSQL, adoCon
dim intCount
If Not rsCommon.EOF Then
intCount = rsCommon("TopicCount")
End If
rsCommon.Close
IF intCount > 0 Then
If intCount = 1 Then%>
<br>There has been <a
href="forum/active_topics.asp">(<%=intCount%>)</a> new
message posted since you last visited<%
else%>
<br>There have been <a
href="forum/active_topics.asp">(<%=intCount%>)</a> new
messages posted since you last visited<%
End if
End If ' Count > 0
End If
' ##########################################################
%>
|
 |