vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Quick Reply Error Message (https://vborg.vbsupport.ru/showthread.php?t=173813)

Boofo 03-22-2008 11:32 AM

Quick Reply Error Message
 
If I want to show an error message after a quick reply is submitted, what hook do I need to use for that?

Dismounted 03-22-2008 12:26 PM

Add to the $errors array.

Boofo 03-22-2008 12:28 PM

You lost me. Where do I do that?

Dismounted 03-22-2008 12:44 PM

Look around the hook "newpost_process". ;)

Boofo 03-22-2008 12:49 PM

Ok, I already have an error showing for this mod at newreply_post_complete. The quick-reply uses newpost then and nothing else uses that? This is the code I added to the newpost_process hook and it didn't do anything.

Code:

if ($vbulletin->userinfo['automod'])
{
    $vbulletin->url = 'showthread.php?' . $vbulletin->session->vars['sessionurl'] . "goto=lastpost&t=$threadinfo[threadid]";
    eval(print_standard_redirect('redirect_automod', true, true));
}


When I add it to the newpost_complete hook, it throws a vb error but doesn't say what the error is.

Dismounted 03-23-2008 02:58 AM

You don't print standard errors. You just add an extra variable to the end of the $errors array.

Boofo 03-23-2008 03:22 AM

The print standard errors works fine in the other hooks. Or is it just this hook it won't work in?

You lost me on the extra variable. The only thing I saw in the files before that hook was $errors = array();

Dismounted 03-23-2008 04:12 AM

Quote:

Originally Posted by Boofo (Post 1472206)
The print standard errors works fine in the other hooks. Or is it just this hook it won't work in?

If you haven't noticed, QR is usually AJAX.
Quote:

Originally Posted by Boofo (Post 1472206)
You lost me on the extra variable. The only thing I saw in the files before that hook was $errors = array();

Add to the array:
PHP Code:

$errors[] = 'Some random error occured.'


Boofo 03-23-2008 04:17 AM

So, like this would work for that hook then?

Code:

if ($vbulletin->userinfo['automod'])
{
$errors[] = $vbprase['utomod'];
}


Dismounted 03-23-2008 04:18 AM

Which hook? You have to make sure the hook isn't below the check for errors.

Boofo 03-23-2008 04:35 AM

Here is what I am using in the newpost_process hook.

Code:

if ($vbulletin->GPC['fromquickreply'] AND $vbulletin->userinfo['automod'])
{
$errors[] = $vbphrase['utomod'];
}


And still no error shows when I hit submit.

Boofo 03-24-2008 01:45 PM

Anyone have any ideas on this?

Lynne 03-24-2008 02:12 PM

Have you tried using text instead of a phrase in your error message? At least then you can see if it works and if it just doesn't like phrases.

(I'm actually following this because I have custom script running in my attachment uploads and have never been able to get it to spit out errors so I'll probably try something similar to what you do to get this to work.)

Boofo 03-24-2008 02:26 PM

Yeah, I tried it with words after trying the phrase and nothing. :(

Dismounted 03-25-2008 05:09 AM

Are you using Firefox?

Boofo 03-25-2008 05:13 AM

No, sir. IE7.

Is the code right for that hook?


All times are GMT. The time now is 06:32 PM.

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.01979 seconds
  • Memory Usage 1,741KB
  • 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
  • (3)bbcode_code_printable
  • (1)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (16)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