I am trying to use the following script to create a Confirmation Popup box for my "Mark All Forums Read" link, but it isn't working.
In my Navbar template I placed the following at the top:
Code:
<vb:literal>
<script>
<!--
function markAsRead()
{
var markRead= confirm("Do you really want to mark all forums as read?");
if (markRead== true)
{ window.location="forumdisplay.php?{vb:raw session.sessionurl}do=markread&markreadhash={vb:raw bbuserinfo.securitytoken}";
}
else
{
}
}
//-->
</script>
</vb:literal>
I changed the link for "Mark All Forums Read" to:
Code:
<a href="javascript:markAsRead();"><b><font color=red>{vb:rawphrase mark_forums_read}</font></b></a>
I end up getting the following error in my browser when trying to follow the link:
Quote:
Invalid Forum specified. If you followed a valid link, please notify the administrator
|
I noticed when the page changes, the URL shows up as: http://www.mysite.com/forumdisplay.php?{vb:raw session.sessionurl}do=markread&markreadhash={vb:ra w bbuserinfo.securitytoken}
It looks like the hash and security tokens are not being passed in the Java Script as they were in vB3.
I was able to use the following in
vB3.8.5 and it works fine, but it isn't working in vB4.x:
Code:
<script>
<!--
function markAsRead()
{
var markRead= confirm("Do you really want to mark all forums as read?");
if (markRead== true)
{ window.location="forumdisplay.php?$session[sessionurl]do=markread&markreadhash=$bbuserinfo[securitytoken]";
}
else
{
}
}
//-->
</script>
Code:
<a href="javascript:markAsRead();">$vbphrase[mark_forums_read]</a>
Any help would be greatly appreciated!
.