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.
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:
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:
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 ...