Changeset 169
- Timestamp:
- 2008-11-29 19:24:42 (3 years ago)
- Files:
-
- trunk/classes/misc/Post.php (modified) (2 diffs)
- trunk/classes/pages/Reply.php (modified) (1 diff)
- trunk/includes/js/js.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/classes/misc/Post.php
r166 r169 84 84 } 85 85 // post header (time of post etc.) 86 $table->addRow(Array('<td colspan="2" class="postheader">' . $LANG['Posted'] . ' ' . $F->datetime($this->post->posttime) . ' | <a href="' . $F->link('reply') . 'id=' . $INPUT['id'] . '&quote=' . $this->id . '">' . $LANG['Quote'] . '</a> | ' . $_showip . '<a href="' . $F->link('edit') . 'id=' . $this->id . '">' . $LANG['Edit'] . '</a> | <a href="' . $F->link('delete') . 'id=' . $this->id . '">' . $LANG['Delete'] . '</a> ' . $_split . '</td>')); 86 $_row = '<td colspan="2" class="postheader">' . $LANG['Posted'] . ' ' . $F->datetime($this->post->posttime) . ' | <a href="'; 87 if ($INPUT['show'] == 'reply') { 88 $_row .= 'javascript:quote(' . $this->id . ');'; 89 $js_post = '<script type="text/javascript">post_quote[' . $this->id . "] = '" . strtr(strtr($this->post->post, Array("\r\n"=>'\n')), Array("\n"=>'\n', "\r"=>'\n')) . "';</script>"; 90 } else { 91 $_row .= $F->link('reply') . 'id=' . $INPUT['id'] . '&quote=' . $this->id; 92 $js_post = ''; 93 } 94 $_row .= '">' . $LANG['Quote'] . '</a> | ' . $_showip . '<a href="' . $F->link('edit') . 'id=' . $this->id . '">' . $LANG['Edit'] . '</a> | <a href="' . $F->link('delete') . 'id=' . $this->id . '">' . $LANG['Delete'] . '</a> ' . $_split . '</td>'; 95 $table->addRow(Array($_row)); 87 96 // get member info 88 97 if ($this->post->postedbymember == 0) { … … 92 101 } 93 102 // assemble parts of post 94 $_post = '<div class="post">' . $F->post($this->post->post) . '</div>' ;103 $_post = '<div class="post">' . $F->post($this->post->post) . '</div>' . $js_post; 95 104 // attachment 96 105 if ($this->post->attachment != '') { trunk/classes/pages/Reply.php
r166 r169 95 95 $h2 = $this->html->body->addChild('h2'); 96 96 $this->html->body->addElement(new XMLElement('<h2>' . str_replace('%n%', $SETTINGS['postsperpage'], $LANG['Last_x_Posts']) . ' (<a href="' . $F->link('topic') . 'id=' . $INPUT['id'] . '" target="_blank">' . $LANG['View_All'] . '</a>)</h2>')); 97 $this->html->body->addElement(new XMLElement('<script type="text/javascript">post_quote = new Array();</script>')); 97 98 // get posts from database (last $SETTINGS['postsperpage'] in reversed order) 98 99 $q2 = $C->prepare('SELECT postid FROM ' . $SETTINGS['dbtableprefix'] . 'posts WHERE topic=:topic ORDER BY posttime DESC LIMIT 0, ' . $SETTINGS['postsperpage']); trunk/includes/js/js.js
r63 r169 121 121 document.images.avatarpic.src = val[val.selectedIndex].value; 122 122 } 123 124 function quote(id) { 125 // the textarea 126 var obj = document.getElementsByName('postform')[0].post; 127 if (obj.selectionStart !== false) { 128 // Gecko / Opera 129 var start = obj.selectionStart; 130 var end = obj.selectionEnd; 131 obj.value = obj.value.substr(0, start) + '[quote=' + id + ']' + post_quote[id] + '[/quote]' + obj.value.substr(end, obj.value.length); 132 obj.focus(); 133 var pos = start + post_quote[id].length; 134 obj.setSelectionRange(pos, pos); 135 } else if (document.selection !== false) { 136 // Internet Exploder (*choke*) 137 obj.focus(); 138 document.selection.createRange().text = '[quote=' + id + ']' + post_quote[id] + '[/quote]'; 139 } else { 140 // other browsers 141 obj.value += '[quote=' + id + ']' + post_quote[id] + '[/quote]'; 142 obj.focus(); 143 } 144 }
