Changeset 6830
- Timestamp:
- 07/05/2018 04:11:03 PM (8 years ago)
- Location:
- trunk/src/includes
- Files:
-
- 2 edited
-
forums/template.php (modified) (2 diffs)
-
topics/template.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/forums/template.php
r6829 r6830 2227 2227 function bbp_get_form_forum_subscribed() { 2228 2228 2229 // Default value 2230 $forum_subscribed = false; 2231 2229 2232 // Get _POST data 2230 2233 if ( bbp_is_forum_form_post_request() && isset( $_POST['bbp_forum_subscription'] ) ) { … … 2233 2236 // Get edit data 2234 2237 } elseif ( bbp_is_forum_edit() || bbp_is_reply_edit() ) { 2235 2236 // Get current posts author 2237 $post_author = (int) bbp_get_global_post_field( 'post_author', 'raw' ); 2238 2239 // Post author is not the current user 2240 if ( bbp_get_current_user_id() !== $post_author ) { 2241 $forum_subscribed = bbp_is_user_subscribed( $post_author, bbp_get_forum_id() ); 2242 2243 // Post author is the current user 2244 } else { 2245 $forum_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id(), bbp_get_forum_id() ); 2246 } 2238 $post_author = (int) bbp_get_global_post_field( 'post_author', 'raw' ); 2239 $forum_subscribed = bbp_is_user_subscribed( $post_author, bbp_get_forum_id() ); 2247 2240 2248 2241 // Get current status 2249 2242 } elseif ( bbp_is_single_forum() ) { 2250 2243 $forum_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id(), bbp_get_forum_id() ); 2251 2252 // No data2253 } else {2254 $forum_subscribed = false;2255 2244 } 2256 2245 -
trunk/src/includes/topics/template.php
r6829 r6830 3846 3846 function bbp_get_form_topic_subscribed() { 3847 3847 3848 // Default value 3849 $topic_subscribed = false; 3850 3848 3851 // Get _POST data 3849 3852 if ( bbp_is_topic_form_post_request() && isset( $_POST['bbp_topic_subscription'] ) ) { … … 3852 3855 // Get edit data 3853 3856 } elseif ( bbp_is_topic_edit() || bbp_is_reply_edit() ) { 3854 3855 // Get current posts author 3856 $post_author = (int) bbp_get_global_post_field( 'post_author', 'raw' ); 3857 3858 // Post author is not the current user 3859 if ( bbp_get_current_user_id() !== $post_author ) { 3860 $topic_subscribed = bbp_is_user_subscribed( $post_author, bbp_get_topic_id() ); 3861 3862 // Post author is the current user 3863 } else { 3864 $topic_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id(), bbp_get_topic_id() ); 3865 } 3857 $post_author = (int) bbp_get_global_post_field( 'post_author', 'raw' ); 3858 $topic_subscribed = bbp_is_user_subscribed( $post_author, bbp_get_topic_id() ); 3866 3859 3867 3860 // Get current status 3868 3861 } elseif ( bbp_is_single_topic() ) { 3869 3862 $topic_subscribed = bbp_is_user_subscribed( bbp_get_current_user_id(), bbp_get_topic_id() ); 3870 3871 // No data3872 } else {3873 $topic_subscribed = false;3874 3863 } 3875 3864
Note: See TracChangeset
for help on using the changeset viewer.