aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormistic100 <mistic@piwigo.org>2014-06-22 11:41:47 +0000
committermistic100 <mistic@piwigo.org>2014-06-22 11:41:47 +0000
commitb4b17975304e776518bb2f456f8000cef6bd60e9 (patch)
treeb0538fc2463bb7a5e3ff6f6e32ad81a729e28018
parentf77f3698fe1501ba0a3b94c3a2cfe4d728f2b45b (diff)
feature 3095: add "comments_enable_website" param + GUI
git-svn-id: http://piwigo.org/svn/trunk@28764 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/configuration.php1
-rw-r--r--admin/themes/default/template/configuration.tpl7
-rw-r--r--include/picture_comment.inc.php1
-rw-r--r--install/config.sql1
-rw-r--r--install/db/142-database.php35
-rw-r--r--language/en_UK/admin.lang.php1
-rw-r--r--language/fr_FR/admin.lang.php1
-rw-r--r--themes/default/template/picture.tpl6
8 files changed, 51 insertions, 2 deletions
diff --git a/admin/configuration.php b/admin/configuration.php
index f1b943cfd..9d34fbbf1 100644
--- a/admin/configuration.php
+++ b/admin/configuration.php
@@ -76,6 +76,7 @@ $comments_checkboxes = array(
'email_admin_on_comment_deletion',
'comments_author_mandatory',
'comments_email_mandatory',
+ 'comments_enable_website',
);
$display_checkboxes = array(
diff --git a/admin/themes/default/template/configuration.tpl b/admin/themes/default/template/configuration.tpl
index d3309e8a7..ea2f8ec86 100644
--- a/admin/themes/default/template/configuration.tpl
+++ b/admin/themes/default/template/configuration.tpl
@@ -274,6 +274,13 @@ jQuery("input[name='mail_theme']").change(function() {
<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}>
{'Allow users to edit their own comments'|@translate}
</label>
diff --git a/include/picture_comment.inc.php b/include/picture_comment.inc.php
index eabdff1f0..cd4eda724 100644
--- a/include/picture_comment.inc.php
+++ b/include/picture_comment.inc.php
@@ -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)
diff --git a/install/config.sql b/install/config.sql
index 3783d0130..d247b93c0 100644
--- a/install/config.sql
+++ b/install/config.sql
@@ -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');
diff --git a/install/db/142-database.php b/install/db/142-database.php
new file mode 100644
index 000000000..869f03faa
--- /dev/null
+++ b/install/db/142-database.php
@@ -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";
+
+?>
diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php
index dcb45fe8b..180750941 100644
--- a/language/en_UK/admin.lang.php
+++ b/language/en_UK/admin.lang.php
@@ -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.';
diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php
index b02798541..515850e00 100644
--- a/language/fr_FR/admin.lang.php
+++ b/language/fr_FR/admin.lang.php
@@ -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';
?> \ No newline at end of file
diff --git a/themes/default/template/picture.tpl b/themes/default/template/picture.tpl
index f64e04856..2ee395c53 100644
--- a/themes/default/template/picture.tpl
+++ b/themes/default/template/picture.tpl
@@ -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}">