Changeset 1319
- Timestamp:
- 09/01/08 18:51:48 (3 months ago)
- Files:
-
- edit-history/trunk/edit-history.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
edit-history/trunk/edit-history.php
r1220 r1319 6 6 Author: _ck_ 7 7 Author URI: http://bbShowcase.org 8 Version: 0.0. 28 Version: 0.0.3 9 9 10 10 License: CC-GNU-GPL http://creativecommons.org/licenses/GPL/2.0/ … … 17 17 /* stop editing here */ 18 18 19 bb_register_activation_hook( __FILE__, 'edit_history_create_table');20 19 add_filter( 'post_edit_uri', 'edit_history_link'); 21 20 add_action( 'bb_update_post', 'edit_history_update_post'); 22 21 add_action( 'bb_init', 'edit_history_init'); 22 bb_register_activation_hook(str_replace(array(str_replace("/","\\",BB_PLUGIN_DIR),str_replace("/","\\",BB_CORE_PLUGIN_DIR)),array("user#","core#"),__FILE__),'edit_history_create_table'); 23 23 24 24 function edit_history_init() { … … 52 52 <?php $link=get_user_name($edit->user_id); // user_profile_link($id) ?> 53 53 <div><span style="background:#eeee00;"> <?php printf( __('Edited %s ago by %s'), bb_since($edit->time), $link); ?> </span></div> 54 <div class="post"><?php echo balanceTags(apply_filters( 'post_text', edit_history_visual($bb_post->post_text, $newer), $bb_post->post_id),true); ?></div>54 <div class="post"><?php echo force_balance_tags(apply_filters( 'post_text', edit_history_visual($bb_post->post_text, $newer), $bb_post->post_id)); ?></div> 55 55 <div class="poststuff"><?php printf( __('Edited %s ago by %s'), bb_since($edit->time), $link); ?></div> 56 56 </div> … … 131 131 function edit_history_visual($old, $new) { 132 132 $diff = edit_history_diff(edit_history_split($old),edit_history_split($new)); 133 // echo "<code>"; print_r($diff); echo "</code>";133 // if (bb_current_user_can('administrate')) {echo "<code>"; print_r($diff); echo "</code>";} 134 134 foreach($diff as $k){ 135 135 if (is_array($k)) { … … 138 138 if ($d && $i && str_replace("</p>","",$d)==str_replace("</p>","",$k['i'][0])) {$ret.=$k['i'][0]; unset($d); unset($k['i'][0]); $i=implode(' ',$k['i']);} 139 139 if ($d && $i && substr($d,-6)=="<br />" && substr($i,-6)=="<br />") {$d=substr($d,0,-6);} 140 // to do: strip end tags in $d that have no start tags as they will be in $i - also for ending bbcode tags 141 // if ($d && $i) {$d=force_balance_tags(post_text($d));} 140 142 $ret .= (!empty($d)?"<del style='background:#ffdddd;'>".str_replace("<p>","</del><p><del style='background:#ffdddd;'>",$d)."</del> ":''). 141 143 (!empty($i)?"<ins style='text-decoration:none; background:#ddFFdd;'>".str_replace("<p>","</ins><p><ins style='text-decoration:none; background:#ddFFdd;'>",$i)."</ins> ":'');
