View Full Version : Default Prefix for Reported Posts
woostar
11-01-2009, 01:34 PM
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):
$threadman->set('visible', 1);
Add under:
($hook = vBulletinHook::fetch_hook('report_dataman')) ? eval($hook) : false;
Open up includes/xml/hooks_vbulletin.xml
Look for (line 982):
<hook>report_send_complete</hook>
Add underneath:
<hook>report_dataman</hook>
Go to your plugin page, create a new plugin.
Hook: report_dataman
Code (replace CODE with your prefix id):
$threadman->set('prefixid', 'CODE');
Alternative Method
When you open class_reportitem.php, instead of adding the custom hook, just add:
$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:
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.
James, I believe you can use your code without making any edits using the threadfpdata_start hook, with the following 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'
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.