Changeset 493

Show
Ignore:
Timestamp:
02/01/08 16:12:52 (10 months ago)
Author:
kasper
Message:

Notification about new comments is now translatable, and mail body utf-8 encoded so that international characters in the comment works.
Enlarged admin options mail field

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/admin/plog-options.php

    r428 r493  
    168168                        <td><strong>' . plog_tr('Administrator E-mail address:') . '</strong></td> 
    169169                        <td> 
    170                             <input type="text" name="admin_email" value="'.$config['admin_email'].'"/> 
     170                            <input size="45" type="text" name="admin_email" value="'.$config['admin_email'].'"/> 
    171171                        </td> 
    172172                    </tr> 
  • trunk/plog-functions.php

    r491 r493  
    11541154         
    11551155        if (!$result) { 
    1156                 return array("errors" => "Could not post comment " . mysql_error()); 
     1156                return array("errors" => plog_tr("Could not post comment ") . mysql_error()); 
    11571157        } 
    11581158         
     
    11601160        if ($config["comments_notify"] && $config["admin_email"]) { 
    11611161                // create and send notify mail message 
    1162                 $msg = "New comment posted for picture " . basename($picdata['path']) . " $notify_msg\n\n"; 
    1163                 $msg .= "Author: $author (IP: $ip, $host)\n"; 
    1164                 $msg .= "E-mail: $email\n"; 
    1165                 $msg .= "URI: $url\n\n"; 
    1166                 $msg .= "Comment:\n$comment\n\n"; 
    1167                 $msg .= "You can see all the comments for this picture here:\n"; 
     1162                $msg = plog_tr("New comment posted for picture ") . basename($picdata['path']) . " $notify_msg\n\n"; 
     1163                $msg .= plog_tr("Author") . ": $author (IP: $ip, $host)\n"; 
     1164                $msg .= plog_tr("E-mail") . ": $email\n"; 
     1165                $msg .= plog_tr("URI") . ": $url\n\n"; 
     1166                $msg .= plog_tr("Comment") . ":\n$comment\n\n"; 
     1167                $msg .= plog_tr("You can see all the comments for this picture here") . ":\n"; 
    11681168                $picurl = generate_url("picture",$parent_id); 
    11691169                $msg .= $picurl; 
    1170                 mail($config['admin_email'],SmartStripSlashes($config['gallery_name']) . ': new comment from '.$author,$msg,"From: $email"); 
    1171         } 
    1172          
    1173         return array("result" => "Comment added."); 
     1170                $headers  = "From: $author <$email>\r\n"; 
     1171                $headers .= 'Content-type: text/plain; charset=utf-8\r\n'; 
     1172 
     1173                // Subject should be encoded for international characters too! 
     1174                mail( 
     1175      $config['admin_email'], 
     1176      SmartStripSlashes($config['gallery_name']) . ': ' . plog_tr('new comment from') . ' ' . $author, 
     1177      $msg, 
     1178      $headers); 
     1179        } 
     1180         
     1181        return array("result" => plog_tr("Comment added") . "."); 
    11741182} 
    11751183