Changeset 124

Show
Ignore:
Timestamp:
2008-01-08 22:39:15 (1 year ago)
Author:
hannes
Message:

fixing e-mail notification for MySQL users

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/classes/misc/Post.php

    r116 r124  
    332332                        // in case everything above was ok, proceed 
    333333                        if ($ok === 1) { 
    334                             if ($postedbymember === 1) { 
     334                            if ($postedbymember >= 1) { 
    335335                                // don't save e-mail address every time for members 
    336336                                $email = ''; 
     
    419419                            $q = NULL; 
    420420                            // recount member's posts if necessary 
    421                             if ($postedbymember == 1) { 
     421                            if ($postedbymember >= 1) { 
    422422                                $_member = new Member($_SESSION['memberid']); 
    423423                                $_member->recountPosts(); 
     
    468468                                            include('includes/lang/' . $row2->lang .  '.php'); 
    469469                                        } 
     470                                        $_title = Topic::getTitle($reply); 
    470471                                        /* write mail to 'todo' database table to be sent out on one of the subsequent pageviews; 
    471472                                         * this avoids bulk sending which might clobber the system */ 
     
    473474                                        $q->bindParam(':rec', $row2->memberemail, PDO::PARAM_STR); 
    474475                                        $q->bindParam(':subj', $LANG['mail_notification_subject'], PDO::PARAM_STR); 
    475                                         $q->bindParam(':body', str_replace(Array('%topictitle%', '%topic%', '%page%'), Array(Topic::getTitle($reply), $reply, $page)), $LANG['mail_notification_body']); 
     476                                        $q->bindParam(':body', str_replace(Array('%topictitle%', '%topic%', '%page%'), $_title, $reply, $page), $LANG['mail_notification_body'])); 
    476477                                        $q->execute(); 
    477478                                        $q = NULL; 
  • trunk/classes/pages/Topic.php

    r66 r124  
    234234     **/ 
    235235    public function getTitle($id) { 
    236         global $C
     236        global $C, $SETTINGS
    237237        $q = $C->prepare('SELECT topictitle FROM ' . $SETTINGS['dbtableprefix'] . 'topics WHERE topicid=:id'); 
    238238        $q->bindParam(':id', $id, PDO::PARAM_INT, 12); 
     
    242242            return $_title; 
    243243        } else { 
     244            $q = NULL; 
    244245            return FALSE; 
    245246        }