feature 3095: add "comments_enable_website" param + GUI

git-svn-id: http://piwigo.org/svn/trunk@28764 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
mistic100
2014-06-22 11:41:47 +00:00
parent f77f3698fe
commit b4b1797530
8 changed files with 51 additions and 2 deletions
+1
View File
@@ -76,6 +76,7 @@ $comments_checkboxes = array(
'email_admin_on_comment_deletion',
'comments_author_mandatory',
'comments_email_mandatory',
'comments_enable_website',
);
$display_checkboxes = array(
@@ -272,6 +272,13 @@ jQuery("input[name='mail_theme']").change(function() {
</label>
</li>
<li>
<label>
<input type="checkbox" name="comments_enable_website" {if ($comments.comments_enable_website)}checked="checked"{/if}>
{'Allow users to add a link to their website'|translate}
</label>
</li>
<li>
<label>
<input type="checkbox" name="user_can_edit_comment" {if ($comments.user_can_edit_comment)}checked="checked"{/if}>
+1
View File
@@ -262,6 +262,7 @@ SELECT
'SHOW_EMAIL' => !is_classic_user() or empty($user['email']),
'EMAIL_MANDATORY' => $conf['comments_email_mandatory'],
'EMAIL' => '',
'SHOW_WEBSITE' => $conf['comments_enable_website'],
);
if ('reject'==@$comment_action)
+1
View File
@@ -8,6 +8,7 @@ INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_forall','false
INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_order','ASC','comments order on picture page and cie');
INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_author_mandatory','false','Comment author is mandatory');
INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_email_mandatory','false','Comment email is mandatory');
INSERT INTO piwigo_config (param,value,comment) VALUES ('comments_enable_website','true','Enable "website" field on add comment form');
INSERT INTO piwigo_config (param,value,comment) VALUES ('user_can_delete_comment','false','administrators can allow user delete their own comments');
INSERT INTO piwigo_config (param,value,comment) VALUES ('user_can_edit_comment','false','administrators can allow user edit their own comments');
INSERT INTO piwigo_config (param,value,comment) VALUES ('email_admin_on_comment_edition','false','Send an email to the administrators when a comment is modified');
+35
View File
@@ -0,0 +1,35 @@
<?php
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based photo gallery |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2008-2014 Piwigo Team http://piwigo.org |
// | Copyright(C) 2003-2008 PhpWebGallery Team http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation |
// | |
// | This program is distributed in the hope that it will be useful, but |
// | WITHOUT ANY WARRANTY; without even the implied warranty of |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
// | General Public License for more details. |
// | |
// | You should have received a copy of the GNU General Public License |
// | along with this program; if not, write to the Free Software |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA. |
// +-----------------------------------------------------------------------+
if (!defined('PHPWG_ROOT_PATH'))
{
die('Hacking attempt!');
}
$upgrade_description = 'add "comments_enable_website" parameter';
conf_update_param('comments_enable_website', 'true');
echo "\n".$upgrade_description."\n";
?>
+1
View File
@@ -168,6 +168,7 @@ $lang['all'] = "all";
$lang['Allow rating'] = "Allow rating";
$lang['Allow user customization'] = 'Allow user customization';
$lang['Allow user registration'] = "Allow user registration";
$lang['Allow users to add a link to their website'] = "Allow users to add a link to their website";
$lang['Allow users to delete their own comments'] = "Allow users to delete their own comments";
$lang['Allow users to edit their own comments'] = "Allow users to edit their own comments";
$lang['Allowed file types: %s.'] = 'Allowed file types: %s.';
+1
View File
@@ -974,4 +974,5 @@ $lang['Open user details'] = 'Ouvrir les détails de l\'utilisateur';
$lang['Close user details'] = 'Fermer les détails de l\'utilisateur';
$lang['close'] = 'fermer';
$lang['Activate it now'] = 'Activate it now';
$lang['Allow users to add a link to their website'] = 'Autoriser les utilisateurs à donner un lien vers leur site web';
?>
+4 -2
View File
@@ -340,8 +340,10 @@ function setPrivacyLevel(id, level){
<p><label for="email">{'Email address'|@translate}{if $comment_add.EMAIL_MANDATORY} ({'mandatory'|@translate}){/if} :</label></p>
<p><input type="text" name="email" id="email" value="{$comment_add.EMAIL}"></p>
{/if}
<p><label for="website_url">{'Website'|@translate} :</label></p>
<p><input type="text" name="website_url" id="website_url" value="{$comment_add.WEBSITE_URL}"></p>
{if $comment_add.SHOW_WEBSITE}
<p><label for="website_url">{'Website'|@translate} :</label></p>
<p><input type="text" name="website_url" id="website_url" value="{$comment_add.WEBSITE_URL}"></p>
{/if}
<p><label for="contentid">{'Comment'|@translate} ({'mandatory'|@translate}) :</label></p>
<p><textarea name="content" id="contentid" rows="5" cols="50">{$comment_add.CONTENT}</textarea></p>
<p><input type="hidden" name="key" value="{$comment_add.KEY}">