Changeset 1591 for devel

Show
Ignore:
Timestamp:
05/14/08 08:04:27 (5 months ago)
Author:
misja
Message:

Misja Hoebe <misja@curverider.co.uk> Applied attachment:ticket:340:commentwall-msg-content.diff, closes #340 - thanks justinr

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • devel/mod/commentwall/lib.php

    r1578 r1591  
    9292        function commentwall_addcomment($wall_id, $poster_id, $text) 
    9393        { 
    94                global $CFG; 
    95                 
    96                $newcomment = new stdClass; 
    97                        $newcomment->wallowner = $wall_id; 
    98                        $newcomment->comment_owner = $poster_id; 
    99                        $newcomment->content = $text; 
    100                        $newcomment->posted = time(); 
    101                         
    102         if ($newcomment->ident = insert_record("commentwall", $newcomment)) { 
     94          global $CFG; 
     95           
     96          $newcomment = new stdClass; 
     97          $newcomment->wallowner = $wall_id; 
     98          $newcomment->comment_owner = $poster_id; 
     99          $newcomment->content = $text; 
     100          $newcomment->posted = time(); 
     101           
     102         if ($newcomment->ident = insert_record("commentwall", $newcomment)) { 
    103103            if ($newcomment->comment_owner != $newcomment->wallowner) { 
    104                         message_user($wall_id, $poster_id, __gettext("Someone has posted to your comment wall"), __gettext("Check it out") . ": " . $CFG->wwwroot . user_info("username", $wall_id) . "/profile/"); 
     104               
     105                $message = __gettext(sprintf("You have received a comment from %s on your comment wall:", user_name($newcomment->comment_owner), stripslashes($object_title))); 
     106                $message .= "\n\n" . stripslashes($newcomment->content) . "\n\n"; 
     107                $message .= __gettext(sprintf("To reply on %s's comment wall, click here: %s", user_name($newcomment->comment_owner), $CFG->wwwroot . user_info("username", $newcomment->comment_owner) . "/profile/")) . "\n"; 
     108                $message .= __gettext(sprintf("To see other comments on your wall, click here: %s", $CFG->wwwroot . user_info("username", $newcomment->wallowner) . "/profile/")); 
     109                $message = wordwrap($message); 
     110                 
     111                message_user($wall_id, $newcomment->comment_owner,  __gettext(sprintf("%s has posted to your comment wall", user_name($newcomment->comment_owner))), $message); 
    105112            } 
    106113                        $newcomment = plugin_hook("commentwall","publish",$newcomment);