vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Popup When Editing Other's Post (https://vborg.vbsupport.ru/showthread.php?t=104286)

Fotinakis 01-02-2006 08:08 PM

Popup When Editing Other's Post
 
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):
HTML Code:

<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):
HTML Code:

<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?


All times are GMT. The time now is 03:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01768 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (2)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete