MOD: Email Notify Admin
Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums Modifications
Forum Description: Mod's and Add-on's for Web Wiz Forums.
URL: https://forums.webwiz.net/forum_posts.asp?TID=22402
Printed Date: 30 March 2026 at 7:19am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: MOD: Email Notify Admin
Posted By: Melkor
Subject: MOD: Email Notify Admin
Date Posted: 13 January 2007 at 6:51am
A very basic and simplistic Mod to get around the bug detailed > http://forums.webwiz.net/forum_posts.asp?TID=22392&PID=119300#119300 - here <
create a new asp page and name it "email_notify_subscriptions_admin.asp"
<% @ Language=VBScript %> <% Option Explicit %> <!--#include file="common.asp" --> <!--#include file="functions/functions_date_time_format.asp" --> <%
'Set the buffer to true Response.Buffer = True
'Declare variables
Dim strMode 'Holds the mode of the page Dim lngTopicID Dim rsEmailNotify Dim lngWatchID
If blnAdmin = False Then Response.Redirect("default.asp") End If
lngTopicID = request.querystring("TID") lngWatchID = request.querystring("WI") strMode = request.querystring("M")
If strMode = "A" Then strSQL = "DELETE FROM tblEmailNotify WHERE Watch_ID = " & lngWatchID adoCon.Execute strSQL
End If
strSQL = "SELECT * FROM tblEmailNotify WHERE Topic_ID ="&lngTopicID SET rsEmailNotify = adoCon.Execute(strSQL) adoCon.execute(strSQL) %> <!-- #include file="includes/header.asp" --> <table cellspacing="1" cellpadding="3" class="tableBorder" align="center"> <FORM ACTION="delete_subscription.asp" form id="DEN" METHOD="POST"> <tr class="tableLedger"> <td bgcolor="<%= strBase %>">Watch ID</td> <td bgcolor="<%= strBase %>">Watcher</td> <td bgcolor="<%= strBase %>">Forum ID</td> <td bgcolor="<%= strBase %>">Topic ID</td> <td bgcolor="<%= strBase %>">Delete</td> </tr> <% Do While NOT rsEmailNotify.EOF %> <tr class="tableRow"> <td bgcolor="#FFFFFF"><%=rsEmailNotify("Watch_ID")%></td> <td bgcolor="#FFFFFF"><%=rsEmailNotify("Author_ID")%></td> <td bgcolor="#FFFFFF"><%=rsEmailNotify("Forum_ID")%></td> <td bgcolor="#FFFFFF"><%=rsEmailNotify("Topic_ID")%></td> <td bgcolor="#FFFFFF"><a href="email_notify_subscriptions_admin.asp?TID=<%=lngTopicID%>&M=A&WI=<%=rsEmailNotify("Watch_ID")%>">Delete</a></td> </tr> <% rsEmailNotify.MoveNext Loop
rsEmailNotify.close Set rsEmailNotify = nothing
adoCon.close Set adoCon = Nothing %> </table>
<!-- #include file="includes/footer.asp" -->
|
Then add the following link below the email toggle in the forum_posts.asp (or wherever you like really)
<% 'add link for admins to view and delete subscriptions If blnAdmin = True Then %><br><a href="email_notify_subscriptions_admin.asp?TID=<%=lngTopicID%>">View subscriptions to this thread</a><% End If %>
|
Like I said, it's simplistic but it works. My main goal here was to get the mod done. Feel free to improve it in anyway. Hopefully Bruce will include a fix in V9.0
|
Replies:
Posted By: Scotty32
Date Posted: 13 January 2007 at 9:51am
before i start, id like to state that am not critizising your mod, am only suggesting improvements you could make to improve your mod.
i would suggest that you close any connections to the database. for example:
If blnAdmin = False Then 'Clean up Call closeDatabase()
Response.Redirect("default.asp") End If | the function in red is built into the forum, it is used to close any connections created by the forum (eg adoCon and rsCommon).
you may also want to use rsCommon instead of rsEmailNotify. as the rsCommon is already created by the forum.
and then add the function to close the database to the bottom of the page
i also noticed that you show the Author ID
if you change your SQL statement to this you'll get the members username:
strSQL = "SELECT tblEmailNotify.*, " & strDBTable & "Author.Username FROM tblEmailNotify, " & strDBTable & "Author WHERE Topic_ID =" & lngTopicID & " and " & strDBTable & "Author.Author_ID = tblEmailNotify
.Author_ID " | hope this helps
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
Posted By: Melkor
Date Posted: 13 January 2007 at 10:32am
Hey, it aint no big thing. Like I said, I rushed to get this one out as it was affecting the daily progress of the forum I run. I was literally done in the 5 minutes between taking my babies out of the bath and having to take the wife to work.
When I have time tomorrow I'll re-write it properly. I really shouldn't have posted it until it was written properly but I considered it a security issue, especially as it was allowing members to basically view private discussions in Admin only forums.
Thanks for the tips though Scotty, I really do appreciate it. 
|
|