Changeset 367 for trunk/bp-wire/bp-wire-templatetags.php
- Timestamp:
- 09/29/2008 10:26:10 PM (17 years ago)
- File:
-
- 1 edited
-
trunk/bp-wire/bp-wire-templatetags.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-wire/bp-wire-templatetags.php
r359 r367 14 14 var $total_wire_post_count; 15 15 16 var $can_post; 17 16 18 var $table_name; 17 19 18 function bp_wire_posts_template( $item_id ) {20 function bp_wire_posts_template( $item_id, $can_post ) { 19 21 global $bp; 20 22 … … 33 35 $this->wire_posts = $this->wire_posts['wire_posts']; 34 36 $this->wire_post_count = count($this->wire_posts); 37 38 $this->can_post = $can_post; 35 39 36 40 $this->pag_links = paginate_links( array( … … 91 95 } 92 96 93 function bp_has_wire_posts( $item_id = null ) {97 function bp_has_wire_posts( $item_id = null, $can_post = true ) { 94 98 global $wire_posts_template, $bp; 95 99 … … 97 101 return false; 98 102 99 $wire_posts_template = new BP_Wire_Posts_Template( $item_id );103 $wire_posts_template = new BP_Wire_Posts_Template( $item_id, $can_post ); 100 104 return $wire_posts_template->has_wire_posts(); 101 105 } … … 111 115 } 112 116 113 function bp_wire_get_post_list( $ bp_wire_item_id = null, $bp_wire_title = null, $bp_wire_empty_message = null) {114 global $bp_item_id, $bp_wire_header, $bp_wire_msg ;115 116 if ( !$ bp_wire_item_id )117 return false; 118 119 if ( !$ bp_wire_empty_message )120 $ bp_wire_empty_message = __("There are currently no wire posts.");121 122 if ( !$ bp_wire_title )123 $ bp_wire_title = __('Wire');117 function bp_wire_get_post_list( $item_id = null, $title = null, $empty_message = null, $can_post = true ) { 118 global $bp_item_id, $bp_wire_header, $bp_wire_msg, $bp_wire_can_post; 119 120 if ( !$item_id ) 121 return false; 122 123 if ( !$message ) 124 $empty_message = __("There are currently no wire posts."); 125 126 if ( !$title ) 127 $title = __('Wire'); 124 128 125 129 /* Pass them as globals, using the same name doesn't work. */ 126 $bp_item_id = $bp_wire_item_id; 127 $bp_wire_header = $bp_wire_title; 128 $bp_wire_msg = $bp_wire_empty_message; 130 $bp_item_id = $item_id; 131 $bp_wire_header = $title; 132 $bp_wire_msg = $empty_message; 133 $bp_wire_can_post = $can_post; 129 134 130 135 load_template( TEMPLATEPATH . '/wire/post-list.php' ); … … 144 149 global $bp_wire_msg; 145 150 echo $bp_wire_msg; 151 } 152 153 function bp_wire_can_post() { 154 global $bp_wire_can_post; 155 return $bp_wire_can_post; 146 156 } 147 157 … … 188 198 189 199 function bp_wire_get_post_form() { 190 if ( is_user_logged_in() ) 200 global $wire_posts_template; 201 202 if ( is_user_logged_in() && $wire_posts_template->can_post ) 191 203 load_template( TEMPLATEPATH . '/wire/post-form.php' ); 192 204 }
Note: See TracChangeset
for help on using the changeset viewer.