Changeset 1112
- Timestamp:
- 05/21/08 19:27:26 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
bb-anonymous-posting/trunk/bb-anonymous-posting.php
r1109 r1112 5 5 Description: Allows anonymous users to add posts and topics 6 6 Author: Aditya Naik 7 Version: 2. 27 Version: 2.3 8 8 Author URI: http://www.adityanaik.com/ 9 9 */ … … 130 130 131 131 // this fixes the display names for topic last poster or topic author 132 add_filter('topic_last_poster','bb_anon_filter_poster',10,2); 133 add_filter('get_topic_author','bb_anon_filter_poster',10,2); 134 function bb_anon_filter_poster($last_poster, $poster_id) { 135 if ($poster_id == bb_get_option('bb_anon_user_id')) 136 return __('Anonymous'); 132 add_filter('topic_last_poster','bb_anon_filter_poster'); 133 add_filter('get_topic_author','bb_anon_filter_poster'); 134 add_filter('post_author', 'bb_anon_filter_poster'); 135 function bb_anon_filter_poster($last_poster) { 136 if ($last_poster == 'Anonymous' || $last_poster == 'anonymous') 137 return bb_anon_get_user_text(); 137 138 else 138 139 return $last_poster; 140 } 141 142 function bb_anon_get_user_text() { 143 return ($user_text = bb_get_option('bb_anon_user_text')) ? $user_text : "Anonymous"; 139 144 } 140 145 … … 164 169 <p>By default if the plugin is enabled the users can create new posts. Selecting yes above will let users create new topics also.</p> 165 170 </div> 171 <label for="bb_anon_user_text"> 172 Name for the 'Anonymous' users 173 </label> 174 <div> 175 <input type="text" value="<? echo bb_anon_get_user_text(); ?>" name="bb_anon_user_text" id="bb_anon_user_text" /> 176 <p>This will be the text show as the name of the poster or author</p> 177 </div> 166 178 <p class="submit"> 167 179 <input type="submit" name="bb_anon_submit_options" value="Update Options" /> … … 186 198 } 187 199 200 bb_update_option('bb_anon_user_text',$_POST['bb_anon_user_text']); 201 188 202 $goback = add_query_arg('bb-anon-options-updated', 'true', wp_get_referer()); 189 203 bb_safe_redirect($goback);
