vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   Default Prefix for Reported Posts (https://vborg.vbsupport.ru/showthread.php?t=227187)

woostar 11-01-2009 01:34 PM

Default Prefix for Reported Posts
 
I'm guessing the hook is easy enough to find (as there are only a few in report.php), but does anyone know the line of code to add a default prefix to the threads created in the designated forum?

Thanks :)

viper357 07-09-2010 07:15 AM

Did you ever figure this out?

Is there a mod for this?

James Birkett 07-09-2010 10:51 AM

If you want it for reported posts it's a little more complicated.

I have a solution, but it requires a custom hook (or just custom code).

If you want it in a non-automated forum (such as a normal thread), that's easy enough!

(P.S: Original thread creation date is 2009).

viper357 07-10-2010 07:50 AM

Hi James, I would be very grateful if you could help me on this, I found this add-on - https://vborg.vbsupport.ru/showthread.php?t=233364 but it's not working for the reported posts threads.

Thanks.

James Birkett 07-11-2010 10:01 AM

Post reports don't create threads on the same hook, so it won't work.

Open includes/class_reportitem.php

Search for (line 243):
PHP Code:

$threadman->set('visible'1); 

Add under:
PHP Code:

($hook vBulletinHook::fetch_hook('report_dataman')) ? eval($hook) : false

Open up includes/xml/hooks_vbulletin.xml

Look for (line 982):
PHP Code:

<hook>report_send_complete</hook

Add underneath:
PHP Code:

<hook>report_dataman</hook

Go to your plugin page, create a new plugin.

Hook: report_dataman

Code (replace CODE with your prefix id):
PHP Code:

$threadman->set('prefixid''CODE'); 



Alternative Method

When you open class_reportitem.php, instead of adding the custom hook, just add:
PHP Code:

$threadman->set('prefixid''CODE'); 

(replacing CODE with prefix id)

Then you're done. I prefer to use hooks so I have more control though.

viper357 07-14-2010 09:28 AM

Brilliant James, working perfectly, thanks so much for your help, I really appreciate it. :up:

Guest190829 07-14-2010 10:11 AM

James, I believe you can use your code without making any edits using the threadfpdata_start hook, with the following code:

PHP Code:

if(THIS_SCRIPT == 'report')
{
   
$this->set('prefixid''yeah');  


This is untested but 99% positive it works.

James Birkett 07-14-2010 01:07 PM

Hi Danny,

Thanks for your code, I posted a while ago wondering how to do it without editing code and it seems its worked!

Thanks.

Mutt 02-06-2011 10:49 AM

Quote:

Originally Posted by Danny.VBT (Post 2068979)
James, I believe you can use your code without making any edits using the threadfpdata_start hook, with the following code:

PHP Code:

if(THIS_SCRIPT == 'report')
{
   
$this->set('prefixid''yeah');  


This is untested but 99% positive it works.

danny, this worked perfectly in VB4. same can be done for THIS_SCRIPT == 'infraction'


All times are GMT. The time now is 07:29 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.01127 seconds
  • Memory Usage 1,740KB
  • 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
  • (8)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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