Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 Programming Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 11-01-2009, 01:34 PM
woostar's Avatar
woostar woostar is offline
 
Join Date: Aug 2006
Posts: 106
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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
Reply With Quote
  #2  
Old 07-09-2010, 07:15 AM
viper357's Avatar
viper357 viper357 is offline
 
Join Date: Dec 2006
Location: Worthing, UK
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Did you ever figure this out?

Is there a mod for this?
Reply With Quote
  #3  
Old 07-09-2010, 10:51 AM
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #4  
Old 07-10-2010, 07:50 AM
viper357's Avatar
viper357 viper357 is offline
 
Join Date: Dec 2006
Location: Worthing, UK
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #5  
Old 07-11-2010, 10:01 AM
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 07-14-2010, 09:28 AM
viper357's Avatar
viper357 viper357 is offline
 
Join Date: Dec 2006
Location: Worthing, UK
Posts: 563
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Brilliant James, working perfectly, thanks so much for your help, I really appreciate it. :up:
Reply With Quote
  #7  
Old 07-14-2010, 10:11 AM
Guest190829
Guest
 
Posts: n/a
Default

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.
Reply With Quote
  #8  
Old 07-14-2010, 01:07 PM
James Birkett James Birkett is offline
 
Join Date: Jun 2009
Posts: 633
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #9  
Old 02-06-2011, 10:49 AM
Mutt's Avatar
Mutt Mutt is offline
 
Join Date: Nov 2001
Posts: 331
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Danny.VBT View Post
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'
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:38 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.04048 seconds
  • Memory Usage 2,250KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (8)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (8)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete