Changeset 149

Show
Ignore:
Timestamp:
2008-05-14 17:36:06 (8 months ago)
Author:
hannes
Message:

merging changesets [147] and [148] from trunk; creating version 5.0.1

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/5.0/classes/misc/Format.php

    r143 r149  
    7979    public function post($str, $simple = FALSE) { 
    8080        // language 
    81         global $LANG, $F
     81        global $LANG, $F, $C, $SETTINGS
    8282        /* debugging messages; 
    8383         * printed out directly on the screen, so incompatible with general board structure; 
     
    187187                        break; 
    188188                        case '[quote=': 
    189                             // get poster and date of post this quote comes from 
    190                             $p = new Post($_attr); 
    191                             $_attr = str_replace(Array('%poster%', '%date%'), Array($p->getPoster(), $F->datetime($p->getPosttime())), $LANG['quote_from']); 
     189                            if (isset($C) && $C) { 
     190                                // get poster and date of post this quote comes from 
     191                                $p = new Post($_attr); 
     192                                $_attr = str_replace(Array('%poster%', '%date%'), Array($p->getPoster(), $F->datetime($p->getPosttime())), $LANG['quote_from']); 
     193                            } else { $_attr = ''; } 
    192194                        break; 
    193195                        default: 
     
    255257        if ($simple) { 
    256258            // strip quotes completely 
    257             $str = preg_replace('/<div class="quote1">' . $LANG['Quote'] . ':<\/div><div class="quote">(.*?)<\/div>/si', '', $str); 
     259            $str = preg_replace('/<div class="quote1">(.*?)<\/div><div class="quote">(.*?)<\/div>/si', '', $str); 
    258260            // remove all other HTML tags apart from line breaks 
    259261            $str = strip_tags($str, '<br>'); 
  • branches/5.0/classes/misc/Post.php

    r145 r149  
    371371                            if ($show_orig === 'newtopic' || $show_orig === 'newpoll') { 
    372372                                @$C->query('LOCK TABLE ' . $SETTINGS['dbtableprefix'] . 'topics'); 
    373                                 $subject = trim($subject); 
     373                                $subject = $F->htmlentities(trim($subject), TRUE); 
    374374                                $q = $C->prepare('INSERT INTO ' . $SETTINGS['dbtableprefix'] . 'topics (forum, topictitle, poll) values (:id, :subject, :poll)'); 
    375375                                $q->bindParam(':id', $forum, PDO::PARAM_INT,12); 
     
    477477                                        $q->bindParam(':rec', $row2->memberemail, PDO::PARAM_STR); 
    478478                                        $q->bindParam(':subj', $LANG['mail_notification_subject'], PDO::PARAM_STR); 
    479                                         $q->bindParam(':body', str_replace(Array('%topictitle%', '%topic%', '%page%'), $_title, $reply, $page), $LANG['mail_notification_body']); 
     479                                        $q->bindParam(':body', str_replace(Array('%topictitle%', '%topic%', '%page%'), Array($_title, $reply, $page), $LANG['mail_notification_body'])); 
    480480                                        $q->execute(); 
    481481                                        $q = NULL; 
  • branches/5.0/classes/pages/Search.php

    r143 r149  
    194194                            $table->addHeaderRow(Array('<th colspan="2">' . $LANG['Results'] . '</th>')); 
    195195                            $n = 0; 
    196                             while ($row = $q2->fetchObject()) { 
     196                            $rows3 = $q2->fetchAll(); 
     197                            $q2 = NULL; 
     198                            foreach ($rows3 as $row) { 
    197199                                // topic title 
    198200                                // format post preview 
    199                                 $postpreview = substr($F->post($row->post, TRUE), 0, 200); 
     201                                $postpreview = substr($F->post($row['post'], TRUE), 0, 200); 
    200202                                // remove incomplete words at the end of post preview 
    201203                                if (strrpos($postpreview, ' ') !== FALSE) { 
     
    207209                                } 
    208210                                // add it to table 
    209                                 $table->addRow(Array('<td><a href="' . $F->link('topic') . 'id=' . $row->topic . '"><strong>' . $row->topictitle . '</strong></a><br />' . $postpreview . '...<br /></td>', '<td nowrap="nowrap">' . $LANG['Posted'] . ' ' . $LANG['by'] . ' ' . $row->poster . '<br />' . $LANG['at'] . ' ' . $F->datetime($row->posttime, FALSE, TRUE) . '<br />' . $LANG['on'] . ' ' . $F->datetime($row->posttime, TRUE, FALSE) . '</td>')); 
     211                                $table->addRow(Array('<td><a href="' . $F->link('topic') . 'id=' . $row['topic'] . '"><strong>' . $row['topictitle'] . '</strong></a><br />' . $postpreview . '...<br /></td>', '<td nowrap="nowrap">' . $LANG['Posted'] . ' ' . $LANG['by'] . ' ' . $row['poster'] . '<br />' . $LANG['at'] . ' ' . $F->datetime($row['posttime'], FALSE, TRUE) . '<br />' . $LANG['on'] . ' ' . $F->datetime($row['posttime'], TRUE, FALSE) . '</td>')); 
    210212                                $n++; 
    211213                            } 
    212                             $q2 = NULL; 
    213214                            if ($n === 0) { 
    214215                                // no results 
  • branches/5.0/includes/config/version.php

    r143 r149  
    2828 * Also good: Spam Board Viking Edition 1.0 (then, you can do your own version numbering from there) */ 
    2929 
    30 $VERSION = '5.0'; 
     30$VERSION = '5.0.1'; 
    3131 
    3232?>