aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_modify.php
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-03-13 23:01:16 +0000
committerrub <rub@piwigo.org>2007-03-13 23:01:16 +0000
commitc5da19e5362101517d3f805c86132016b90bd271 (patch)
tree2751d89bb79584f8a32192c21f6b2429fc7794ce /admin/cat_modify.php
parent6295173652a7767fa482df231ae7a9034b89ecde (diff)
Fix bad default value for language on table user_info
Improve mail send (Undisclosed-recipients, switch language, ...) Improve send an email to group members (Use Bcc, template, multi-language, ...) (But need more improvements) git-svn-id: http://piwigo.org/svn/trunk@1904 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/cat_modify.php')
-rw-r--r--admin/cat_modify.php68
1 files changed, 46 insertions, 22 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php
index 95abb8e00..5571cc439 100644
--- a/admin/cat_modify.php
+++ b/admin/cat_modify.php
@@ -529,35 +529,59 @@ display_select_cat_wrapper(
// info by email to an access granted group of category informations
if (isset($_POST['submitEmail']))
{
- $query = '
-SELECT
- user_id,
- '.$conf['user_fields']['email'].' AS email
- FROM '.USER_GROUP_TABLE.'
- INNER JOIN '.USERS_TABLE.' ON '.$conf['user_fields']['id'].' = user_id
- WHERE '.$conf['user_fields']['email'].' IS NOT NULL
- AND group_id = '.$_POST['group'].'
+ set_make_full_url();
+
+ /* TODO: if $category['representative_picture_id']
+ is empty find child representative_picture_id */
+ if (!empty($category['representative_picture_id']))
+ {
+ $query = '
+SELECT id, file, path, tn_ext
+ FROM '.IMAGES_TABLE.'
+ WHERE id = '.$category['representative_picture_id'].'
;';
- $result = pwg_query($query);
- while ($row = mysql_fetch_array($result))
+ $result = pwg_query($query);
+ if (mysql_num_rows($result) > 0)
+ {
+ $element = mysql_fetch_assoc($result);
+
+ $img_url = '<a href="'.
+ make_picture_url(array(
+ 'image_id' => $element['id'],
+ 'image_file' => $element['file'],
+ 'category' => $category
+ ))
+ .'"><img src="'.get_thumbnail_url($element).'"/></a>';
+ }
+ }
+
+ if (!isset($img_url))
{
- pwg_mail(
- $row['email'],
- array(
- 'content' => get_absolute_root_url().make_index_url(
+ $img_url = '';
+ }
+
+ // TODO Mettre un array pour traduction subjet
+ pwg_mail_group(
+ $_POST['group'],
+ get_str_email_format(true), /* TODO add a checkbox in order to choose format*/
+ $category['name'],
+ 'cat_group_info',
+ array
+ (
+ 'IMG_URL' => $img_url,
+ 'LINK' => make_index_url(
array(
'category' => array(
'id' => $category['id'],
'name' => $category['name'],
- 'permalink' => $category['permalink'],
- )
- )
- ),
- 'subject' => $category['name']
- )
- );
- }
+ 'permalink' => $category['permalink']
+ ))),
+ 'CPL_CONTENT' => '' /* TODO Add text area to add complementary content */
+ ),
+ '' /* TODO Add listbox in order to choose Language selected */);
+
+ unset_make_full_url();
$query = '
SELECT