Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-29-2012, 11:15 AM
tambo's Avatar
tambo tambo is offline
 
Join Date: Aug 2008
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Modifying reportpost_newthread phrase to show moderator User IDs

Hi there,

Is it possible to change the "reportpost_newthread" phrase in a way that will show the assigned moderator's User IDs?

Currently, the phrase is:

Code:
[url=$reportinfo[reporterlink]]$reportinfo[rusername][/url] has reported a post.

Reason:[quote]$reportinfo[reason][/quote]
Post: [url=$reportinfo[postlink]]$reportinfo[prefix_plain]$reportinfo[threadtitle][/url]
Forum: $reportinfo[forumtitle]
Assigned Moderators: $reportinfo[modlist]

Posted by: [url=$reportinfo[posterlink]]$reportinfo[pusername][/url]
Original Content: [quote]$reportinfo[pagetext][/quote]

Can the Assigned Moderators: $reportinfo[modlist] part be modified to either link to the specific moderators profile, or simply display their User ID?

So the reported post would read:

Quote:
Assigned Moderators: Mod1 (1234), Mod2 (5678), Mod3 (9101)
or
Quote:
Assigned Moderators: Mod1, Mod2, Mod3

Any ideas?
Reply With Quote
  #2  
Old 04-29-2012, 12:58 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

There's no way to simply edit the phrase, you'd need a plugin. If you look at file includes/class_reportitem.php around line 194 you can see how the list is built, and at the same time an array called $mods is built with all the moderator info. So you could write a plugin using hook location report_do_report (which is called just after the array is built) which rebuilds $reportinfo['modlist'] using the info in the $mods array to include the moderator id.

The code could be something like:

Code:
if (!empty($mods))
{
    $reportinfo['modlist'] = '';
    foreach ($mods AS $moderator)
    {
        $reportinfo['modlist'] .= (!empty($reportinfo['modlist']) ? ', ' : '') . unhtmlspecialchars($moderator['username']) . ' (' . $moderator['userid'] . ')';
    }
}
Reply With Quote
Благодарность от:
tambo
  #3  
Old 04-29-2012, 01:54 PM
tambo's Avatar
tambo tambo is offline
 
Join Date: Aug 2008
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for your response. It's much appreciated, as is the clarity.

I suspected that it wouldn't be as easy as I'd hoped and that it would require some sort of 'under the hood' tweaking.

That's fine. Honestly, it's probably a little beyond my current technical skill and understanding, but it does give me a discrete project on which to build and improve those skills, along with some guidance of how the end product might work.

That's valuable information for any learner, so thanks again.
Reply With Quote
  #4  
Old 04-29-2012, 01:57 PM
kh99 kh99 is offline
 
Join Date: Aug 2009
Location: Maine
Posts: 13,185
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, you could just try to add a new plugin using hook location report_do_report and the code from above. I haven't actually tried it but with a little luck it should work.

If you're not familiar with creating a plugin, you can search for "Adding or Editing a Plugin" in the vbulletin manual: https://www.vbulletin.com/docs/html/ (it's really not very difficult).
Reply With Quote
Благодарность от:
Lynne
  #5  
Old 04-29-2012, 02:17 PM
tambo's Avatar
tambo tambo is offline
 
Join Date: Aug 2008
Posts: 47
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

It works!

Excellent. Now I just need to understand what the hell I (you) just did. Haha!

My PHP skills really are abysmal, but you've got to start somewhere.

Many, many thanks. :up:
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 08:40 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03667 seconds
  • Memory Usage 2,210KB
  • Queries Executed 13 (?)
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
  • (2)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (2)post_thanks_box_bit
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)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_postinfo_query
  • fetch_postinfo
  • 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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete