PDA

View Full Version : Moderators Functions - Show User History On Infraction Form And Postbits


MarkFL
05-10-2015, 09:00 PM
This product will allow those with the ability to issue warnings/infractions to see a user's user notes and infraction history on the infraction form for easy reference. A new data block is displayed below the "User Infraction" block containg the user's relevant history.

On the forum I help administrate, we have devised a system where if a user breaks a forum rule for the first time, we simply send a friendly PM advisory of the rule rather than going to the infraction system. Many users, especially new users, are taken aback to receive a formal warning or infraction for breaking a rule they likely didn't realize is in place. Let's face it, the vast majority of users just don't read the rules.

So, when we see that a user has broken a rule, we need to check to see if a PM advisory has previously been sent, and we record this information in the usernotes. Then if we find that an advisory has been sent, we have to check that user's infraction history to see if they have been formally warned or given an infraction so that we know the most appropriate action to take for this new violation.

With this product, you can simply click the "Add Infraction" button on the postbit, and have all the needed history available on the generated form so that you can decide what action is most appropriate. If you find that no relevant usernote data exists, there is a button below the data block element that will take you to that user's usernote page.

I wish to extend a special thanks to BrettC Frontier (https://vborg.vbsupport.ru/member.php?u=537193) for many great suggestions and error reporting that has really helped make this add-on much better. :cool:

Update: version 1.1


Option to display user history in postbits.
Option to set which usergroups will have their history displayed in postbits. Both data include links to the relevant pages.
Option to set which usergroups will see the user history in postbits.


Update: version 2.0


Shortened product title so it won't be truncated in AdminCP ► Plugins & Products ► Manage Products.
Fixed text color on usergroup checkbox elements in product settings to be dark.
If usernote title is empty, displays "N/A" within user history block on infraction form.
Fixed infraction reason to either use chosen or custom reason, whichever applies.
Infractions show date/time of expiry.
Infractions show link to post that caused warning/infraction to be issued, using thread title.
Infractions are shown in descending order, sorted by time issued.
Background color of user history block fixed to white.
If no "Administrative Note" is given for an infraction, then "N/A" is displayed.
Execution order of postbit plugin increased to help ensure it gets run.
Usernames of usernote authors and infraction issuers link to user profiles.


Update: version 2.1


Fixed bug regarding infraction not being associated with a post and causing and SQL
error.
Changed usergroup selection from checkboxes to select elements.


Update: version 2.2


Added the display of active infraction points on infraction form.
Added the ability to customize the color of the active points based on value.


Update: version 2.3


Added the display of active infraction points on user postbits, where the number is colored as defined.


Update: version 2.4


Corrected typo preventing templates from being cached.



Installation:

Download and extract the attached .zip file.

Follow:

AdminCP ► Plugins & Products ► Manage Products ► Add/Import Product.

Click on "Choose File" and browse to the product xml file that was packaged in the .zip file.

Click "Import"

You MUST set your settings to enable the product.

Support for this product can be found here:


MHB - Show User History On Infraction Form And Postbits (http://mathhelpboards.com/vbulletin-products-61/show-user-history-infraction-form-postbits-22027.html)
TAZ - Show User History On Infraction Form And Postbits (https://theadminzone.com/threads/show-user-history-on-infraction-form-and-postbits.145205/)

Alan_SP
05-11-2015, 05:39 PM
Thanks, this certainly looks very useful. :up:

My Hattiesburg
05-11-2015, 05:40 PM
This looks like another great mod from you, I've been wanting something like this for a long time.

MarkFL
05-13-2015, 12:45 AM
I have just updated the product to include the ability to display usernote and infraction data in user postbits. You can select which groups will have this data included in their postbits and which groups will be able to see this data. Both data include links to the relevan pages for ease of navigation. :D

Alan_SP
05-14-2015, 01:00 PM
It's useful, can help with moderating problematic users, as we can see right away in one glance their history.

bosanci28
05-16-2015, 11:17 PM
Useful ! Thanks.

Elixar
05-19-2015, 04:29 PM
Not showing up for me, I'm using the older horizontal format for threads.

MarkFL
05-19-2015, 04:35 PM
Not showing up for me, I'm using the older horizontal format for threads.

Can you give me a link to your site so I can see what you mean by horizontal format?

Elixar
05-19-2015, 04:38 PM
Can you give me a link to your site so I can see what you mean by horizontal format?
I'm using the legacy format.

MarkFL
05-19-2015, 04:49 PM
Without a link to your site, I can't be of much help. Legacy format means down the left side not across the top, which is what I use on my dev and live sites as well.

Did you set the product as active?

Elixar
05-19-2015, 04:52 PM
Without a link to your site, I can't be of much help. Legacy format means down the left side not across the top, which is what I use on my dev and live sites as well.

Did you set the product as active?
Sorry, I'm using the old format, got confused.

MarkFL
05-19-2015, 04:56 PM
Sorry, I'm using the old format, got confused.

http://christianityhaven.com/

I see no posts to look at...also are you sure you have set the product as active?

Elixar
05-19-2015, 04:59 PM
I see no posts to look at...also are you sure you have set the product as active?
Yes it's active. And I added a post in a public forum. :)

MarkFL
05-19-2015, 05:08 PM
Okay, two things I would ask for you to check:

1.) Are you in a usergroup you have defined as being able to view the history information in postbits and is the user whose post you are viewing in a usergroup who has been defined to show the history in the postbit?

2.) In the postbit template you are using, see if the hook labeled "postbit_userinfo_right_after_posts" exists.

Elixar
05-19-2015, 05:36 PM
Okay, two things I would ask for you to check:

1.) Are you in a usergroup you have defined as being able to view the history information in postbits and is the user whose post you are viewing in a usergroup who has been defined to show the history in the postbit?

2.) In the postbit template you are using, see if the hook labeled "postbit_userinfo_right_after_posts" exists.
1. Yes.
2. No.

MarkFL
05-19-2015, 05:43 PM
It appears you are now using a legacy postbit style...since you say the hook is not present in your postbit template (I assume it has been removed), try going to your "postbit_legacy" template, and locate the code:

<dt>{vb:rawphrase posts}</dt> <dd><div>{vb:raw post.posts}</div></dd>

And beneath it add:

{vb:raw template_hook.postbit_userinfo_right_after_posts}

Does this fix the issue?

Elixar
05-19-2015, 06:43 PM
Weird, it's in there.

MarkFL
05-19-2015, 09:14 PM
Weird, it's in there.

Okay...I think the most efficient and expedient way to get to the bottom of this is for you to PM the login credentials of an admin account to me. :)

Elixar
05-20-2015, 04:33 PM
Sent. :)

MarkFL
05-21-2015, 10:22 AM
Sent. :)

I gather by now that you have not read my return PM, but the login credentials you sent are invalid.

Elixar
05-23-2015, 02:56 AM
Replied, sorry for the delay!

MarkFL
05-23-2015, 03:12 PM
Replied, sorry for the delay!

I was able to log in and fix the issue. Because of other mods you have installed, I had to increase the execution order of my plugin. :D

Please verify that everything (including the other mods) is working as you desire.

Elixar
05-23-2015, 08:43 PM
Works great! Any chance to have them work as links to the user notes and infractions? :D

MarkFL
05-23-2015, 09:04 PM
Works great! Any chance to have them work as links to the user notes and infractions? :D

They do...I just double-checked to verify. :D

Elixar
05-23-2015, 09:16 PM
Oops, was looking for the normal link color. :D

MarkFL
05-23-2015, 09:30 PM
Oops, was looking for the normal link color. :D

I coded them to have the same color as the other data in postbits, but I can change it on your site to whatever color you want. :D

Elixar
05-23-2015, 09:46 PM
I coded them to have the same color as the other data in postbits, but I can change it on your site to whatever color you want. :D
Sure, if you wanna do hyperlink blue. :D

Also, I'm getting this error when I give a test infraction, not sure why.

https://vborg.vbsupport.ru/external/2015/05/7.png

MarkFL
05-23-2015, 11:16 PM
Sure, if you wanna do hyperlink blue. :D

Also, I'm getting this error when I give a test infraction, not sure why.

https://vborg.vbsupport.ru/external/2015/05/7.png

Okay, the links are bold and blue. :)

This add-on does not call the trim() function, but I gave a test infraction on both my dev sites to be sure (vB 4.2.1 and 4.2.2 PL4) and did not get any errors.

I don't want to give any infractions (test or otherwise) on your site, so try disabling my add-on and try giving a test infraction again and see if you get that error.

biftek
05-28-2015, 04:29 AM
doesn't work for me either , the hooks are in place

MarkFL
05-28-2015, 04:40 AM
doesn't work for me either , the hooks are in place

Okay, let's first try what I did to fix it on Elixar's site...follow:

AdminCP ► Plugins & Products ► Plugin Manager

Locate the plugin titled "Usernote Information In Postbits" and change the Execution Order to 200.

Does this fix the issue on your site?

To receive further support, please mark this product as "Installed." :)

biftek
05-28-2015, 07:09 AM
sort of fixed the issue , now the problem i got was the warning/infraction/usernote doubled with each post
first post had it once , second post had it twice , 3rd three times etc etc ,

(each post from different users)

MarkFL
05-28-2015, 12:22 PM
Would you mind posting a screenshot of this? :D

biftek
05-31-2015, 09:52 AM
i uninstalled your addon

thanks anyway , it looked like a good idea

Elixar
05-31-2015, 06:20 PM
i uninstalled your addon

thanks anyway , it looked like a good idea

You couldn't have waited to see if he could help you lol?

biftek
06-01-2015, 09:52 AM
You couldn't have waited to see if he could help you lol?

nope i couldn't have , because it made the forum look untidy , eg: a thread with 50 pages , it would blow right out due to the multiply factor that was happening ,

the warning/infraction/usernote doubled with each post
first post had it once , second post had it twice , 3rd three times etc etc ... so say by the 50th post , it would've blown right out to a hundred or so warning/infraction/usernote doubled in just one postbit

MarkFL
06-01-2015, 10:04 AM
nope i couldn't have , because it made the forum look untidy , eg: a thread with 50 pages , it would blow right out due to the multiply factor that was happening ,

the warning/infraction/usernote doubled with each post
first post had it once , second post had it twice , 3rd three times etc etc ... so say by the 50th post , it would've blown right out to a hundred or so warning/infraction/usernote doubled in just one postbit

If you wish to PM login credentials to me for an admin account at your site, I would be glad to try to troubleshoot the issue. Unfortunately, I cannot replicate the issue on my dev site.

Elixar
06-01-2015, 03:24 PM
nope i couldn't have , because it made the forum look untidy , eg: a thread with 50 pages , it would blow right out due to the multiply factor that was happening ,

the warning/infraction/usernote doubled with each post
first post had it once , second post had it twice , 3rd three times etc etc ... so say by the 50th post , it would've blown right out to a hundred or so warning/infraction/usernote doubled in just one postbit

So disable it and he'll help you. Mark has been a huge help to me on my forum I'm working on.

MarkFL
06-02-2015, 05:59 PM
nope i couldn't have , because it made the forum look untidy , eg: a thread with 50 pages , it would blow right out due to the multiply factor that was happening ,

the warning/infraction/usernote doubled with each post
first post had it once , second post had it twice , 3rd three times etc etc ... so say by the 50th post , it would've blown right out to a hundred or so warning/infraction/usernote doubled in just one postbit

I just finished helping another user with a strikingly similar issue with someone else's add-on, and so you might want to see if you have any plugins hooked to one of the postbit locations which use:

global $template_hook;

If so, try commenting out that line, to read:

//global $template_hook;

This may fix the issue for you. :D

biftek
06-03-2015, 06:48 AM
those hooks weren't present in my postbit , never mind thanks anyway

it seemed like a good addon

Black Snow
06-03-2015, 07:02 AM
those hooks weren't present in my postbit , never mind thanks anyway

it seemed like a good addon

I would install this: https://vborg.vbsupport.ru/showthread.php?t=265976 then run a search for global $template_hook; using the new search feature in your admincp. Then comment out the line as MarkFL suggested.

BrettC Frontier
07-12-2015, 04:42 AM
Hi Mark,

A few bugs/issues/requests to report of on this addon.


- The text in the ACP, products, your product name shows as "MarkFL: Show Usernotes And Infraction History On I". Seems to have hit a limit or something. :)

- Would be nice to change the check boxes on the usergroup selection into a select box. Selected group names would be active, unselected would be inactive.

- The yellow background and text do not play nice with one another on the blue vbulletin admin theme. White text on yellow.

- Within user notes, if a title field is empty, it may be worth while putting N/A into the field as a placeholder.

- Within Warnings/Infractions:


The reason field always has a / somewhere. It would appear the slash in the code is a delimiter between a custom infraction reason and a preset reason. May be worthwhile using a "if ? :" Ternary operator php clause in that segment.
Infraction list does not show expiry time.
Infraction list does not show infraction type: warning/infraction text, only a numerical point value. May be worthwhile using the infraction icon images.
Infraction list does not link to the post/item that was infracted.


Observed on both sections:
- Dark themes absolutely decimate the text coloring of the rows to background coloring. The rows appear to not use vbulletin's CSS variables of blockrow, blockhead as seen elsewhere in VB.

- Having user notes and infractions all in the same blob of text is rather confusing. Moving user notes to the left side, and moving infractions to the right made the segments much more readable.

- The text bubble assigned to administrative notes on infractions should default to N/A or "No Administrative Note Assigned" if no text was put there.

- The postbit hooking appears to completely fail if there's been any edits to the segments near post counts/userinfo bits.

- Issued By / Author username is not linkable.

- "User Notes: ###" could have an additional link to the right for "Manage User Notes".

- "Warnings/Infractions" could have a link to the users profile page. For example: /member.php?u=#####&tab=infractions&pp=40#infractions-content


Sorry for the wall of text. Just a few knacks to advise of. :D

MarkFL
07-12-2015, 06:05 AM
Hello Brett,

I truly appreciate your interest in improving this add-on, and I will see what I can do to address the issues you have outlined. :D

MarkFL
07-16-2015, 09:10 PM
Update: version 2.0


Shortened product title so it won't be truncated in AdminCP ► Plugins & Products ► Manage Products.
Fixed text color on usergroup checkbox elements in product settings to be dark.
If usernote title is empty, displays "N/A" within user history block on infraction form.
Fixed infraction reason to either use chosen or custom reason, whichever applies.
Infractions show date/time of expiry.
Infractions show link to post that caused warning/infraction to be issued, using thread title.
Infractions are shown in descending order, sorted by time issued.
Background color of user history block fixed to white.
If no "Administrative Note" is given for an infraction, then "N/A" is displayed.
Execution order of postbit plugin increased to help ensure it gets run.
Usernames of usernote authors and infraction issuers link to user profiles.

BrettC Frontier
07-28-2015, 07:14 PM
Found a slight issue with the latest version. Issuing a profile infraction rather a post infraction will cause the infraction.php page to throw up a SQL error. It's expecting a post ID.

MarkFL
07-28-2015, 09:31 PM
Found a slight issue with the latest version. Issuing a profile infraction rather a post infraction will cause the infraction.php page to throw up a SQL error. It's expecting a post ID.

Great catch! I appreciate you letting me know. I have fixed the issue. If an infraction does not have an associated postid, then "N/A" will be displayed in the post field. I have also changed the usergroup selection as you previously requested.

Update: version 2.1


Fixed bug regarding infraction not being associated with a post and causing and SQL
error.
Changed usergroup selection from checkboxes to select elements.

Stratis
08-01-2015, 11:25 AM
Mark very nice, I install this to my test forum, it works ok.
But that's say that some forums as mine don't use infractions, or some other don't use usernotes
How about in future if there is an option to select...

User History usernotes In Postbits Enabled?
User History infractions In Postbits Enabled?
Thanks, with some changes to my need.
153053

imported_vauge
08-09-2015, 10:51 AM
This looks awesome! How many additional queries per thread does this add?

MarkFL
08-09-2015, 11:29 AM
This looks awesome! How many additional queries per thread does this add?

There are 2 queries per selected user if the user history is set to display in postibts.

MarkFL
08-19-2015, 02:18 AM
By request, I have made the following update:

Update: version 2.2


Added the display of active infraction points on infraction form.
Added the ability to customize the color of the active points based on value.

MarkFL
08-20-2015, 01:25 AM
Update: version 2.3


Added the display of active infraction points on user postbits, where the number is colored as defined.

killah360z
08-20-2015, 01:58 AM
Fatal error: Call to a member function fetch_array() on a non-object in /usr/www/sghosting/public/forums/includes/class_postbit.php(345) : eval()'d code on line 296

MarkFL
08-20-2015, 02:07 AM
Fatal error: Call to a member function fetch_array() on a non-object in /usr/www/sghosting/public/forums/includes/class_postbit.php(345) : eval()'d code on line 296

Strange...I'm not getting that error on either of my dev sites.

Try the following:

1.) Open the plugin titled "Usernote Information In Postbits"

2.) Locate the line:

$markfl_infraction_activepoints = 0;

3.) Directly below it, add:

global $db;

4.) Let me know if that works. :)

BrettC Frontier
08-20-2015, 04:39 AM
I'm a bit confused why it's not showing up on postbits for me (namely postbit_legacy).

I can see it is hooked to postbit_display_complete, and it additionally has a hook set for postbit_userinfo_right_after_posts. However nothing appears to be showing, even after configuration settings were applied and enabled.

The only other plugin running is https://vborg.vbsupport.ru/showthread.php?t=227946 which has the same hook, with an exec order of 5 rather the setting that yours has of 20.

killah360z
08-20-2015, 04:57 AM
when giving an infraction

Database error in vBulletin 4.2.3:

Invalid SQL:

SELECT thread.*
FROM thread AS thread
WHERE threadid =;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
Error Number : 1064
Request Date : Wednesday, August 19th 2015 @ 11:56:36 PM
Error Date : Wednesday, August 19th 2015 @ 11:56:36 PM
Script : http://silentgamerz.com/forums/infraction.php?do=report&p=456
Referrer : http://silentgamerz.com/forums/threads/185-asd-tripped-AE-detector
IP Address : 124.195.207.82
Username : KillaHinstinct
Classname : vB_Database
MySQL Version : 5.6.22

happens on v2.2 & 2.3

--------------------------------------------

nvm looks like it magically got fixed on its own ;d

--------------------------------------------

its back again

MarkFL
08-20-2015, 05:09 AM
I'm a bit confused why it's not showing up on postbits for me (namely postbit_legacy).

I can see it is hooked to postbit_display_complete, and it additionally has a hook set for postbit_userinfo_right_after_posts. However nothing appears to be showing, even after configuration settings were applied and enabled.

The only other plugin running is https://vborg.vbsupport.ru/showthread.php?t=227946 which has the same hook, with an exec order of 5 rather the setting that yours has of 20.

I gave it a higher execution order so it would display the data below other postbit data that might be hooked there. I have a dozen or so add-ons hooked there, and no issues whatsoever on either of my 2 test sites. :confused:

killah360z
08-20-2015, 05:19 AM
I gave it a higher execution order so it would display the data below other postbit data that might be hooked there. I have a dozen or so add-ons hooked there, and no issues whatsoever on either of my 2 test sites. :confused:

uh wait i was wrong it is back again weird ( happens randomly )

MarkFL
08-20-2015, 05:33 AM
uh wait i was wrong it is back again weird ( happens randomly )

I just gave 4 infractions in a row on my dev site...everything works perfectly. 2 were profile infractions and 2 were on posts.

Exactly how are you giving the infractions?

killah360z
08-20-2015, 05:50 AM
I just gave 4 infractions in a row on my dev site...everything works perfectly. 2 were profile infractions and 2 were on posts.

Exactly how are you giving the infractions?

by clicking the icon~

https://vborg.vbsupport.ru/external/2015/08/18.png

MarkFL
08-20-2015, 05:54 AM
And when do you get the error? I get no errors on my end, so I need to have detailed information about what is happening on your end if I am to be able to figure out what changes I have to make to accommodate your site/settings.

killah360z
08-20-2015, 06:34 AM
as i said the database error comes when i press the button like i'd be lead to
/infraction.php?do=report&p=456
also it is really weird how i am getting this error from just 1 user ( its my test account ) any posts made by the account gives off the db error every other post is fine o_O

MarkFL
08-20-2015, 06:45 AM
Try this:

1.) Go to the plugin titled "Renders Usernotes/Infraction History Data On Infraction Form"

2.) Locate the line that reads:

if ($postid)

3.) Change it to read:

if (intval($postid) > 0)

4.) Let me know if this works.

killah360z
08-20-2015, 07:48 AM
didn't work

MarkFL
08-20-2015, 02:01 PM
didn't work

Try repairing your tables.

killah360z
08-20-2015, 03:37 PM
Try repairing your tables.

that didn't work either

Alan_SP
12-11-2015, 06:57 AM
For some reason your mod interferes with mod QAS: https://vborg.vbsupport.ru/showthread.php?t=237286

If your mod is active, changing active user works quirky. At the moment I find QAS more important. But, if you're willing to test why your mod breaks QAS, it would be great.

And, testing your mod, I didn't succeeded to see postbit info, but it's not that important.

MarkFL
03-18-2016, 01:38 PM
Update - Version 2.4:


Corrected typo preventing templates from being cached.

Innsomnimaniac
03-19-2016, 09:20 AM
Where are the options located? I can't seem to find them.

MarkFL
03-19-2016, 01:14 PM
Where are the options located? I can't seem to find them.

Follow:

AdminCP -> Settings -> Options -> MarkFL: Show User History v2.4

Leebo89122
05-06-2017, 09:32 PM
when giving an infraction

Database error in vBulletin 4.2.3:

Invalid SQL:

SELECT thread.*
FROM thread AS thread
WHERE threadid =;

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3
Error Number : 1064
Request Date : Wednesday, August 19th 2015 @ 11:56:36 PM
Error Date : Wednesday, August 19th 2015 @ 11:56:36 PM
Script : http://silentgamerz.com/forums/infraction.php?do=report&p=456
Referrer : http://silentgamerz.com/forums/threads/185-asd-tripped-AE-detector
IP Address : 124.195.207.82
Username : KillaHinstinct
Classname : vB_Database
MySQL Version : 5.6.22

happens on v2.2 & 2.3

--------------------------------------------

nvm looks like it magically got fixed on its own ;d

--------------------------------------------

its back again



I too keep getting this error when it's installed. Any idea why this is occurring?

MarkFL
05-06-2017, 09:55 PM
I too keep getting this error when it's installed. Any idea why this is occurring?

No idea...I have this running on two sites, and have never seen that error. :)

migratoria
08-19-2017, 02:48 PM
ONLY FOR INFO

Yet Another Award System generate a conflicts during the uninstallation phase with:

MarkFL: Show User History 2.4

MarkFL
08-19-2017, 04:56 PM
ONLY FOR INFO

Yet Another Award System generate a conflicts during the uninstallation phase with:

MarkFL: Show User History 2.4

Can you be more specific? :)

migratoria
08-19-2017, 05:30 PM
If both are installed on vbulletin 4.2.5 "Yet Another Award System" generate a conflicts during her uninstallation

MY LOG:
mod_fcgid: stderr: PHP Fatal error: Call to a member function fetch_array() on null in /forum/includes/class_postbit.php(345) : eval()'d code on line 261

This error Generates a crash when displaying a topic