Changeset 554
- Timestamp:
- 11/18/2008 04:41:06 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-templatetags.php
r428 r554 221 221 } 222 222 223 function bp_post_title() { 224 global $posts_template; 225 echo $posts_template->post->post_title; 223 function bp_post_title( $echo = true ) { 224 global $posts_template; 225 226 if ( $echo ) 227 echo $posts_template->post->post_title; 228 else 229 return $posts_template->post->post_title; 226 230 } 227 231 … … 249 253 } 250 254 251 function bp_post_date( $date_format = null ) {255 function bp_post_date( $date_format = null, $echo = true ) { 252 256 global $posts_template; 253 257 … … 255 259 $date_format = get_option('date_format'); 256 260 257 echo mysql2date( $date_format, $posts_template->post->post_date ); 261 if ( $echo ) 262 echo mysql2date( $date_format, $posts_template->post->post_date ); 263 else 264 return mysql2date( $date_format, $posts_template->post->post_date ); 258 265 } 259 266 … … 300 307 } 301 308 302 function bp_post_author() { 303 global $posts_template; 304 echo bp_core_get_userlink( $posts_template->post->post_author ); 309 function bp_post_author( $echo = true ) { 310 global $posts_template; 311 312 if ( $echo ) 313 echo bp_core_get_userlink( $posts_template->post->post_author ); 314 else 315 return bp_core_get_userlink( $posts_template->post->post_author ); 305 316 } 306 317 … … 310 321 } 311 322 312 function bp_post_category( $separator = '', $parents='', $post_id = false ) { 313 global $posts_template; 314 echo get_the_category_list($separator, $parents, $posts_template->post->ID ); 323 function bp_post_category( $separator = '', $parents='', $post_id = false, $echo = true ) { 324 global $posts_template; 325 326 if ( $echo ) 327 echo get_the_category_list( $separator, $parents, $posts_template->post->ID ); 328 else 329 return get_the_category_list( $separator, $parents, $posts_template->post->ID ); 315 330 } 316 331 … … 556 571 } 557 572 558 function bp_comment_post_permalink() { 559 global $comments_template; 560 echo bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID; 561 } 562 563 function bp_comment_post_title() { 564 global $comments_template; 565 echo $comments_template->comment->post->post_title; 566 } 567 568 function bp_comment_author() { 569 global $comments_template; 570 echo bp_core_get_userlink( $comments_template->comment->user_id ); 573 function bp_comment_post_permalink( $echo = true ) { 574 global $comments_template; 575 576 if ( $echo ) 577 echo bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID; 578 else 579 return bp_post_get_permalink( $comments_template->comment->post, $comments_template->comment->blog_id ) . '#comment-' . $comments_template->comment->comment_ID; 580 } 581 582 function bp_comment_post_title( $echo = true ) { 583 global $comments_template; 584 585 if ( $echo ) 586 echo $comments_template->comment->post->post_title; 587 else 588 return $comments_template->comment->post->post_title; 589 } 590 591 function bp_comment_author( $echo = true ) { 592 global $comments_template; 593 594 if ( $echo ) 595 echo bp_core_get_userlink( $comments_template->comment->user_id ); 596 else 597 return bp_core_get_userlink( $comments_template->comment->user_id ); 571 598 } 572 599 … … 579 606 } 580 607 581 function bp_comment_date( $date_format = null ) {608 function bp_comment_date( $date_format = null, $echo = true ) { 582 609 global $comments_template; 583 610 … … 585 612 $date_format = get_option('date_format'); 586 613 587 echo mysql2date( $date_format, $comments_template->comment->post->post_date ); 588 } 589 590 function bp_comment_blog_permalink() { 591 global $comments_template; 592 echo get_blog_option( $comments_template->comment->blog_id, 'siteurl' ); 593 } 594 595 function bp_comment_blog_name() { 596 global $comments_template; 597 echo get_blog_option( $comments_template->comment->blog_id, 'blogname' ); 614 if ( $echo == true ) 615 echo mysql2date( $date_format, $comments_template->comment->post->post_date ); 616 else 617 return mysql2date( $date_format, $comments_template->comment->post->post_date ); 618 } 619 620 function bp_comment_blog_permalink( $echo = true ) { 621 global $comments_template; 622 623 if ( $echo ) 624 echo get_blog_option( $comments_template->comment->blog_id, 'siteurl' ); 625 else 626 return get_blog_option( $comments_template->comment->blog_id, 'siteurl' ); 627 } 628 629 function bp_comment_blog_name( $echo = true ) { 630 global $comments_template; 631 632 if ( $echo ) 633 echo get_blog_option( $comments_template->comment->blog_id, 'blogname' ); 634 else 635 return get_blog_option( $comments_template->comment->blog_id, 'blogname' ); 598 636 } 599 637 -
trunk/bp-groups/bp-groups-templatetags.php
r548 r554 365 365 } 366 366 367 function bp_group_all_members_permalink( ) {367 function bp_group_all_members_permalink( $echo = true ) { 368 368 global $groups_template, $bp; 369 echo bp_group_permalink( false, true ) . '/' . MEMBERS_SLUG ; 369 370 if ( $echo ) 371 echo bp_group_permalink( false, true ) . '/' . MEMBERS_SLUG ; 372 else 373 return bp_group_permalink( false, false ) . '/' . MEMBERS_SLUG ; 370 374 } 371 375 … … 440 444 } 441 445 442 function bp_group_total_members() { 443 global $groups_template; 444 445 echo $groups_template->group->total_member_count; 446 function bp_group_total_members( $echo = true ) { 447 global $groups_template; 448 449 if ( $echo ) 450 echo $groups_template->group->total_member_count; 451 else 452 return $groups_template->group->total_member_count; 446 453 } 447 454
Note: See TracChangeset
for help on using the changeset viewer.