Changeset 149
- Timestamp:
- 2008-05-14 17:36:06 (8 months ago)
- Files:
-
- branches/5.0/classes/misc/Format.php (modified) (3 diffs)
- branches/5.0/classes/misc/Post.php (modified) (2 diffs)
- branches/5.0/classes/pages/Search.php (modified) (2 diffs)
- branches/5.0/includes/config/version.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/5.0/classes/misc/Format.php
r143 r149 79 79 public function post($str, $simple = FALSE) { 80 80 // language 81 global $LANG, $F ;81 global $LANG, $F, $C, $SETTINGS; 82 82 /* debugging messages; 83 83 * printed out directly on the screen, so incompatible with general board structure; … … 187 187 break; 188 188 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 = ''; } 192 194 break; 193 195 default: … … 255 257 if ($simple) { 256 258 // 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); 258 260 // remove all other HTML tags apart from line breaks 259 261 $str = strip_tags($str, '<br>'); branches/5.0/classes/misc/Post.php
r145 r149 371 371 if ($show_orig === 'newtopic' || $show_orig === 'newpoll') { 372 372 @$C->query('LOCK TABLE ' . $SETTINGS['dbtableprefix'] . 'topics'); 373 $subject = trim($subject);373 $subject = $F->htmlentities(trim($subject), TRUE); 374 374 $q = $C->prepare('INSERT INTO ' . $SETTINGS['dbtableprefix'] . 'topics (forum, topictitle, poll) values (:id, :subject, :poll)'); 375 375 $q->bindParam(':id', $forum, PDO::PARAM_INT,12); … … 477 477 $q->bindParam(':rec', $row2->memberemail, PDO::PARAM_STR); 478 478 $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'])); 480 480 $q->execute(); 481 481 $q = NULL; branches/5.0/classes/pages/Search.php
r143 r149 194 194 $table->addHeaderRow(Array('<th colspan="2">' . $LANG['Results'] . '</th>')); 195 195 $n = 0; 196 while ($row = $q2->fetchObject()) { 196 $rows3 = $q2->fetchAll(); 197 $q2 = NULL; 198 foreach ($rows3 as $row) { 197 199 // topic title 198 200 // format post preview 199 $postpreview = substr($F->post($row ->post, TRUE), 0, 200);201 $postpreview = substr($F->post($row['post'], TRUE), 0, 200); 200 202 // remove incomplete words at the end of post preview 201 203 if (strrpos($postpreview, ' ') !== FALSE) { … … 207 209 } 208 210 // 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>')); 210 212 $n++; 211 213 } 212 $q2 = NULL;213 214 if ($n === 0) { 214 215 // no results branches/5.0/includes/config/version.php
r143 r149 28 28 * Also good: Spam Board Viking Edition 1.0 (then, you can do your own version numbering from there) */ 29 29 30 $VERSION = '5.0 ';30 $VERSION = '5.0.1'; 31 31 32 32 ?>
