2014-02-06, 08:10 AM
Driven by this thread:
http://community.mybb.com/thread-150751.html
When we give reputation to a user from user reputation page it asks for the comment (with atleast 10 characters), but it is not necessary to place a comment while we give the reputation to a user for a post through postbit reputation button.
This modification will add an option to make the commenting mandatory, means if you set yes from ACP settings it will force user to make a comment every time while giving reputation to a user : no matter from where it is ...
Creating Settings:
Method 1 (General Users):
Go to
ACP > Configuration > Settings > Add New Setting (2nd Tab)
and place the values:
Title:
Reputation Comment Mandatory
Description:
Set it yes if you want users to force placing a comment on every given reputation.
Group:
Reputation
Display Order:
9
Identifier:
mandrepcomment
Type:
Yes / No Choice
Value:
0
(Change the 'value' to '1' if you want it to be 'yes' by default)
Now hit the button "Insert New Setting" from below.
![[Image: IBGUYlA.png]](https://camo.mybb.com/8ec854dbd620ae890e14ae7846ea16988927c0db/687474703a2f2f692e696d6775722e636f6d2f49424755596c412e706e67)
Method 2 (Advanced Users):
Advanced users can simply run this following SQL query through database to create the setting:
Note:
1. Change the table prefix if it is not default mybb_
2. Change the 'value' to '1' if you want it to be 'yes' by default.
Now we have an additional setting for the reputation:
![[Image: s9VZ223.png]](https://camo.mybb.com/fe9c231aeb2195a94c18b63bfeb4c4d48e2c6c67/687474703a2f2f692e696d6775722e636f6d2f7339565a3232332e706e67)
Editing Core:
Now the core edit part.
Open reputations.php in an editor, go to line no 232 and find:
Change it to:
Save the file and re-upload : replace.
All done. Now if the setting is set to 'yes' its mandatory to provide a comment while giving reputation from anywhere, else it will show the error message:
![[Image: DnlG2b1.png]](https://camo.mybb.com/213cd8a30078ada22c83f8a9de75612ab08cf7a9/687474703a2f2f692e696d6775722e636f6d2f446e6c473262312e706e67)
Happy coding ...
http://community.mybb.com/thread-150751.html
When we give reputation to a user from user reputation page it asks for the comment (with atleast 10 characters), but it is not necessary to place a comment while we give the reputation to a user for a post through postbit reputation button.
This modification will add an option to make the commenting mandatory, means if you set yes from ACP settings it will force user to make a comment every time while giving reputation to a user : no matter from where it is ...
Creating Settings:
Method 1 (General Users):
Go to
ACP > Configuration > Settings > Add New Setting (2nd Tab)
and place the values:
Title:
Reputation Comment Mandatory
Description:
Set it yes if you want users to force placing a comment on every given reputation.
Group:
Reputation
Display Order:
9
Identifier:
mandrepcomment
Type:
Yes / No Choice
Value:
0
(Change the 'value' to '1' if you want it to be 'yes' by default)
Now hit the button "Insert New Setting" from below.
Method 2 (Advanced Users):
Advanced users can simply run this following SQL query through database to create the setting:
INSERT INTO `mybb_settings`
(`sid`, `name`, `title`, `description`, `optionscode`, `value`, `disporder`, `gid`, `isdefault`)
VALUES ('', 'mandrepcomment', 'Reputation Comment Mandatory',
'Set it yes if you want users to force placing a comment on every given reputation.',
'yesno', '0', 9, 15, 0);
Note:
1. Change the table prefix if it is not default mybb_
2. Change the 'value' to '1' if you want it to be 'yes' by default.
Now we have an additional setting for the reputation:
Editing Core:
Now the core edit part.
Open reputations.php in an editor, go to line no 232 and find:
if($mybb->input['pid'] == 0)
Change it to:
if($mybb->settings['mandrepcomment'] || $mybb->input['pid'] == 0)
Save the file and re-upload : replace.
All done. Now if the setting is set to 'yes' its mandatory to provide a comment while giving reputation from anywhere, else it will show the error message:
Happy coding ...
