vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=252)
-   -   Intercept Post/Edit Hook? (https://vborg.vbsupport.ru/showthread.php?t=277452)

sleepygiant 01-23-2012 11:40 PM

Intercept Post/Edit Hook?
 
Hi Everyone,
I apologize if this is located within any thread or guide. I tried searching for the hook list, and found the 4.1 list-- but nothing helpful.

I would like to intercept a post and pass it to a PHP script that does some checking against an API.

In wordpress, it's the preprocess_comment hook, but I can't find the proper hook in vbulletin.

Any help would be appreciated!

john

kh99 01-23-2012 11:50 PM

Maybe newpost_process will work for you - the post text will be in $post['message']. If you want, your plugin can add a string to the $errors array and it will stop posting of the message and display your error above the editor. (Look in includes/functions_newpost.php if you're interested in seeing where the hook code is executed).

sleepygiant 01-24-2012 05:22 PM

Hi KH99,
I wanted to take a moment to thank you. I was able to use that hook, and implement my plugin and it works flawlessly.

Thank you!

sleepygiant 07-20-2012 06:56 PM

Hi all,
I know some forums hate bumping threads, and I dont' know if this qualifies, but I've discovered that intercept works for new posts but not editing posts

It seems that $post['message']; is different when updating/editing a thread. I looked within functions, but since the search term is very broad, I can't narrow it down.

Does anyone have any insight into what it is for editing posts?

kh99 07-20-2012 07:13 PM

The easiest thing to do is probably to make another plugin using hook editpost_update_process. Check the message test in $edit['message'] and if there's an error, add a string to $dataman->errors[].


All times are GMT. The time now is 02:57 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.01089 seconds
  • Memory Usage 1,708KB
  • 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
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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