Snitz™ Forums 2000
https://forum.snitz.com/forumTopic/Posts/61319?pagenum=1
05 November 2025, 00:07
Topic
tribaliztic
PM Mod addon
14 March 2006, 05:29
I'd like to have this functionality:
When I click the flashing "PM Messages" that tell me I have unread PM:s I would like to automatically open the new message IF there is only one unread message.
I suppose I could "count pm_message_unread" or something, but how? =) <
Replies ...
Shaggy
14 March 2006, 07:06
Should be easy enough to do, in the SQL query that determines whether or not to show the flashing "PM Messages" (I assume this is another mod you have installed?), retrieve the ID of the message(s). Then, when writing the link, check to see if the count is greater than one (in which case, link to the inbox) or not (in which case, link to the message directly using the ID you now have).
<
tribaliztic
14 March 2006, 07:19
It's this part I'm asking about:
Originally posted by Shaggy check to see if the count is greater than one
=)<
Shaggy
14 March 2006, 07:27
So's I can properly point you in the right direction, can you post a link to a *.txt copy of the file in question?
<
I'm sorry, now that I actually looked at the code, the count is already done =) <
tribaliztic
14 March 2006, 08:26
I solved it by making the link like this: Response.Write "<font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """><b><span class=""spnMessageText""><a href=""privateread.asp?id=" & pmid & """>PM Inkorg</a></span>" & vbNewLine
Set rsPM2 = my_Conn.Execute(strSql2) pmid = rsPM2("pmid")
rsPM2.close set rsPM2 = nothing
end if
Seems like it's working but I haven't tested it with more than one PM yet =) <
tribaliztic
14 March 2006, 08:29
w00t!
I forgot to do this with the link: if pmcount = 1 then Response.Write "<font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """><b><span class=""spnMessageText""><a href=""privateread.asp?id=" & pmid & """>PM Inkorg</a></span>" & vbNewLine else Response.Write "<font face=""" & strDefaultFontFace & """ size=""" & strFooterFontSize & """ color=""" & strForumFontColor & """><b><span class=""spnMessageText""><a href=""pm_view.asp"">PM Inkorg</a></span>" & vbNewLine end if
But now everything's working as I want!
Removes one step when wanting to read a pm and it's only one unread pm in the inbox. You have to think about the ergonomy you know ;) <