Changeset 2012 for trunk/bp-forums/bp-forums-templatetags.php
- Timestamp:
- 09/30/2009 05:49:55 PM (16 years ago)
- File:
-
- 1 edited
-
trunk/bp-forums/bp-forums-templatetags.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-templatetags.php
r2004 r2012 510 510 } 511 511 512 function bp_the_topic_is_mine() { 513 echo bp_get_the_topic_is_mine(); 514 } 515 function bp_get_the_topic_is_mine() { 516 global $bp, $forum_template; 517 518 return $bp->loggedin_user->id == $forum_template->topic->topic_poster; 519 } 520 512 521 function bp_the_topic_admin_links( $args = '' ) { 513 522 echo bp_get_the_topic_admin_links( $args ); 514 523 } 515 524 function bp_get_the_topic_admin_links( $args = '' ) { 516 global $ forum_template;525 global $bp, $forum_template; 517 526 518 527 $defaults = array( … … 523 532 extract( $r, EXTR_SKIP ); 524 533 525 $links = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'edit', 'bp_forums_edit_topic' ) . '">' . __( 'Edit', 'buddypress' ) . '</a> ' . $seperator . ' '; 526 527 if ( 0 == (int)$forum_template->topic->topic_sticky ) 528 $links .= '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'stick', 'bp_forums_stick_topic' ) . '">' . __( 'Sticky', 'buddypress' ) . '</a> ' . $seperator . ' '; 529 else 530 $links .= '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'unstick', 'bp_forums_unstick_topic' ) . '">' . __( 'Un-stick', 'buddypress' ) . '</a> ' . $seperator . ' '; 531 532 if ( 0 == (int)$forum_template->topic->topic_open ) 533 $links .= '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'open', 'bp_forums_open_topic' ) . '">' . __( 'Open', 'buddypress' ) . '</a> ' . $seperator . ' '; 534 else 535 $links .= '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'close', 'bp_forums_close_topic' ) . '">' . __( 'Close', 'buddypress' ) . '</a> ' . $seperator . ' '; 536 537 $links .= '<a class="confirm" id="topic-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete', 'bp_forums_delete_topic' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>'; 538 539 return $links; 534 $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'edit', 'bp_forums_edit_topic' ) . '">' . __( 'Edit', 'buddypress' ) . '</a>'; 535 536 if ( $bp->is_item_admin || $bp->is_item_mod || is_site_admin() ) { 537 if ( 0 == (int)$forum_template->topic->topic_sticky ) 538 $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'stick', 'bp_forums_stick_topic' ) . '">' . __( 'Sticky', 'buddypress' ) . '</a>'; 539 else 540 $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'unstick', 'bp_forums_unstick_topic' ) . '">' . __( 'Un-stick', 'buddypress' ) . '</a>'; 541 542 if ( 0 == (int)$forum_template->topic->topic_open ) 543 $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'open', 'bp_forums_open_topic' ) . '">' . __( 'Open', 'buddypress' ) . '</a>'; 544 else 545 $links[] = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'close', 'bp_forums_close_topic' ) . '">' . __( 'Close', 'buddypress' ) . '</a>'; 546 547 $links[] = '<a class="confirm" id="topic-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete', 'bp_forums_delete_topic' ) . '">' . __( 'Delete', 'buddypress' ) . '</a>'; 548 } 549 550 return implode( ' ' . $seperator . ' ', (array) $links ); 540 551 } 541 552
Note: See TracChangeset
for help on using the changeset viewer.