vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Stop Quoted text > New text - which hook? (https://vborg.vbsupport.ru/showthread.php?t=171076)

bulbasnore 02-21-2008 03:56 AM

Stop Quoted text > New text - which hook?
 
Hi folks,

I'm pretty fair with php, but putting that into the context of vB isn't always easy for me. It's finding where the body is buried, or the needle in a haystack or the leaf in the forest - the frustrating search for where to inject your code and how to get it called. I'm here for your help with that!

What I want to do is intercept the message text on its way to the post and return the user to the editor with a message saying something like "You must have more new text than quoted text to post on <Forum Name>. Please edit your quotes to just the most relevant text and submit your reply again."

I'm pretty sure I can parse the text and then compare new to quoted character counts.

May I ask:
  1. Has someone done this mod already? I've looked, but hope I haven't overlooked.
  2. Where do I hook in to catch this text before its posted?
  3. What do I use to return them to the editor (with message)?

Anything else you want to suggest as far as templates or tutorials, is appreciated.

'snore

Dismounted 02-21-2008 05:20 AM

Look at one of the newreply hooks. The relevant variables will be available there.


All times are GMT. The time now is 09:32 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.01402 seconds
  • Memory Usage 1,705KB
  • 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
  • (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