Ticket #768: repliesequalnumber.php
| File repliesequalnumber.php, 479 bytes (added by fel64, 4 months ago) |
|---|
| Line | |
|---|---|
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: ?replies=# |
| 4 | Plugin Author: mdwaffe |
| 5 | Description: Hangs a replies=# onto every topic link, so by appropriate styling users can see new posts |
| 6 | Plugin URI: XXX |
| 7 | */ |
| 8 | |
| 9 | add_filter('get_topic_link', 'bb_add_replies_to_topic_link', 10, 2 ); |
| 10 | function bb_add_replies_to_topic_link( $link, $id ) { |
| 11 | $topic = get_topic( get_topic_id( $id ) ); |
| 12 | if ( bb_is_user_logged_in() ) |
| 13 | $link = add_query_arg( 'replies', $topic->topic_posts, $link ); |
| 14 | return $link; |
| 15 | } |
| 16 | ?> |