PluginProbe
wpForo Forum / 3.1.6
wpForo Forum v3.1.6
3.1.6 3.1.5 3.1.4 3.1.2 3.1.1 3.1.0 3.0.9 3.0.8 3.0.7 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.1.1 1.1.2 1.2.0 1.3.0 1.3.1 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 All 138 releases
wpforo / themes / classic / profile-subscriptions.php

profile-subscriptions.php in wpForo Forum 3.1.6, at themes/classic/profile-subscriptions.php

45 lines 2.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // Exit if accessed directly
3 if( ! defined( 'ABSPATH' ) ) exit;
4
5 $subscribes = (array) wpfval( WPF()->current_object, 'subscribes' );
6 ?>
7
8 <div class="wpforo-sbn-content">
9 <?php do_action( 'wpforo_template_profile_subscriptions_head_bar', $subscribes ); ?>
10 <?php if( $subscribes ) : ?>
11 <table>
12 <?php $bg = false;
13 foreach( $subscribes as $subscribe ) : ?>
14 <?php
15 if( in_array( $subscribe['type'], [ 'forum', 'forum-topic' ] ) ) {
16 $item = WPF()->forum->get_forum( $subscribe['itemid'] );
17 $item_url = WPF()->forum->get_forum_url( $item['forumid'] );
18 } elseif( $subscribe['type'] === 'topic' ) {
19 $item = WPF()->topic->get_topic( $subscribe['itemid'] );
20 $item_url = WPF()->topic->get_url( $item['topicid'] );
21 } elseif( in_array( $subscribe['type'], [ 'forums', 'forums-topics' ] ) ) {
22 $item = [ 'title' => wpforo_phrase( 'All ' . $subscribe['type'], false ) ];
23 $item_url = '#';
24 }
25 if( empty( $item ) ) continue;
26 ?>
27 <tr<?php echo( $bg ? ' class="wpfbg-9"' : '' ) ?>>
28 <td class="sbn-icon"><i class="fas fa-1x <?php echo ( $subscribe['type'] == 'forum' ) ? 'fa-comments' : 'fa-file-alt'; ?>"></i></td>
29 <td class="sbn-title"><a href="<?php echo esc_url( (string) $item_url ) ?>"><?php echo esc_html( $item['title'] ) ?></a></td>
30 <?php if( WPF()->current_object['user_is_same_current_user'] || wpforo_current_user_is( 'admin' ) ) : ?>
31 <td class="sbn-action"><span class="wpf-sbn-unsbscrb" data-boardid="<?php echo WPF()->board->get_current( 'boardid' ) ?>" data-key="<?php echo $subscribe['confirmkey'] ?>" title="<?php wpforo_phrase( 'Unsubscribe' ); ?>"><i class="fas fa-bell-slash"></i></span></td>
32 <?php else : ?>
33 <td>&nbsp;</td>
34 <?php endif ?>
35 </tr>
36 <?php $bg = ! $bg; endforeach ?>
37 </table>
38 <div class="sbn-foot">
39 <?php wpforo_template_pagenavi() ?>
40 </div>
41 <?php else : ?>
42 <p class="wpf-p-error"> <?php wpforo_phrase( 'No subscriptions found for this member.' ) ?> </p>
43 <?php endif; ?>
44 </div>
45