Changeset 147
- Timestamp:
- 2008-05-14 17:02:15 (8 months ago)
- Files:
-
- trunk/classes/misc/Format.php (modified) (3 diffs)
- trunk/classes/pages/Search.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/classes/misc/Format.php
r127 r147 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>'); trunk/classes/pages/Search.php
r125 r147 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
