Log in

View Full Version : Popup When Editing Other's Post


Fotinakis
01-02-2006, 08:08 PM
This is all I'm trying to do: I want to have vBulletin pop up a message asking the user if they really do want to edit someone else's post, after they have clicked the 'Edit' button.

If you want to take a stab at this on your own, please do, but this the code I have tried:

I have this JavaScript next to the log_out() function (in the navbar template):
<script type="text/javascript">
function edit_post_confirm()
{
if (confirm("Are you sure you want to edit someone else's post?"))
{
return true;
}
else
{
return false;
}
}
</script>

And this code in the postbit template in place of just having the edit button code (it's just a conditional to see if the post is owned by the user who is logged in, and I know that the conditional works):
<if condition="$post[username] != $bbuserinfo[username]">
<a href="$post[editlink]" name="vB::QuickEdit::$post[postid]" onclick="return edit_post_confirm()"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>&nbsp;
<else />
<a href="$post[editlink]" name="vB::QuickEdit::$post[postid]"><img src="$stylevar[imgdir_button]/edit.gif" alt="$vbphrase[edit_delete_message]" border="0" /></a>&nbsp;
</if>

The only thing I added to postbit was the onclick="return edit_post_confirm()" code to the link (and the conditional, of course), but it doesn't work.

Any ideas?

Fotinakis
01-09-2006, 01:50 AM
Guys? Anything?

Any way to create a confirmation popup when editing another's post?