- fix php warning from comment_list.tpl

- author name is saved always in #comments (even for registered users) so that
  - sql queries are simpler on the comments page (one less table in a big join)
  - when a user is deleted, we can keep the username in the #comments (there might be still a bug that author_id is not updated when a user is deleted)

git-svn-id: http://piwigo.org/svn/trunk@3600 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
rvelices
2009-07-16 05:20:34 +00:00
parent c57fa7e7e3
commit e618e8b944
3 changed files with 9 additions and 36 deletions
+4 -13
View File
@@ -110,7 +110,7 @@ SELECT COUNT(*) AS user_exists
}
else
{
$comm['author'] = '';
$comm['author'] = addslashes($user['username']);
$comm['author_id'] = $user['id'];
}
@@ -171,24 +171,15 @@ INSERT INTO '.COMMENTS_TABLE.'
$comm['id'] = mysql_insert_id();
if (($comment_action=='validate' and $conf['email_admin_on_comment']) or
($comment_action!='validate'
and $conf['email_admin_on_comment_validation']))
($comment_action!='validate' and $conf['email_admin_on_comment_validation']))
{
include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');
$del_url = get_absolute_root_url().'comments.php?delete='.$comm['id'];
if (empty($comm['author']))
{
$author_name = $user['username'];
}
else
{
$author_name = stripslashes($comm['author']);
}
$keyargs_content = array
(
get_l10n_args('Author: %s', $author_name),
get_l10n_args('Author: %s', stripslashes($comm['author']) ),
get_l10n_args('Comment: %s', stripslashes($comm['content']) ),
get_l10n_args('', ''),
get_l10n_args('Delete: %s', $del_url)
@@ -205,7 +196,7 @@ INSERT INTO '.COMMENTS_TABLE.'
pwg_mail_notification_admins
(
get_l10n_args('Comment by %s', $author_name),
get_l10n_args('Comment by %s', stripslashes($comm['author']) ),
$keyargs_content
);
}