The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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:
Any ideas? |
#2
|
|||
|
|||
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'] . ')'; } } |
Благодарность от: | ||
tambo |
#3
|
||||
|
||||
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. |
#4
|
|||
|
|||
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). |
Благодарность от: | ||
Lynne |
#5
|
||||
|
||||
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: |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|