コード例 #1
0
function ass_group_subscription_notification_settings()
{
    // get forum type
    $forums = ass_get_forum_type();
    // no forums installed? stop now!
    if (!$forums) {
        return;
    }
    ?>
	<table class="notification-settings zebra" id="groups-subscription-notification-settings">
	<thead>
		<tr>
			<th class="icon"></th>
			<th class="title"><?php 
    _e('Group Forum', 'bp-ass');
    ?>
</th>
			<th class="yes"><?php 
    _e('Yes', 'bp-ass');
    ?>
</th>
			<th class="no"><?php 
    _e('No', 'bp-ass');
    ?>
</th>
		</tr>
	</thead>
	<tbody>

	<?php 
    // only add the following options if BP's bundled forums are installed...
    // @todo add back these options for bbPress if possible.
    ?>

	<?php 
    if ($forums == 'buddypress') {
        if (!($replies_to_topic = bp_get_user_meta(bp_displayed_user_id(), 'ass_replies_to_my_topic', true))) {
            $replies_to_topic = 'yes';
        }
        if (!($replies_after_me = bp_get_user_meta(bp_displayed_user_id(), 'ass_replies_after_me_topic', true))) {
            $replies_after_me = 'yes';
        }
        ?>

		<tr>
			<td></td>
			<td><?php 
        _e('A member replies in a forum topic you\'ve started', 'bp-ass');
        ?>
</td>
			<td class="yes"><input type="radio" name="notifications[ass_replies_to_my_topic]" value="yes" <?php 
        checked($replies_to_topic, 'yes', true);
        ?>
/></td>
			<td class="no"><input type="radio" name="notifications[ass_replies_to_my_topic]" value="no" <?php 
        checked($replies_to_topic, 'no', true);
        ?>
/></td>
		</tr>

		<tr>
			<td></td>
			<td><?php 
        _e('A member replies after you in a forum topic', 'bp-ass');
        ?>
</td>
			<td class="yes"><input type="radio" name="notifications[ass_replies_after_me_topic]" value="yes" <?php 
        checked($replies_after_me, 'yes', true);
        ?>
/></td>
			<td class="no"><input type="radio" name="notifications[ass_replies_after_me_topic]" value="no" <?php 
        checked($replies_after_me, 'no', true);
        ?>
/></td>
		</tr>

	<?php 
    }
    ?>

		<tr>
			<td></td>
			<td><?php 
    _e('Receive notifications of your own posts?', 'bp-ass');
    ?>
</td>
			<td class="yes"><input type="radio" name="notifications[ass_self_post_notification]" value="yes" <?php 
    if (ass_self_post_notification(bp_displayed_user_id())) {
        ?>
checked="checked" <?php 
    }
    ?>
/></td>
			<td class="no"><input type="radio" name="notifications[ass_self_post_notification]" value="no" <?php 
    if (!ass_self_post_notification(bp_displayed_user_id())) {
        ?>
checked="checked" <?php 
    }
    ?>
/></td>
		</tr>

		<?php 
    do_action('ass_group_subscription_notification_settings');
    ?>
		</tbody>
	</table>


<?php 
}
コード例 #2
0
function ass_group_subscription_notification_settings()
{
    ?>
	<table class="notification-settings zebra" id="groups-subscription-notification-settings">
	<thead>
		<tr>
			<th class="icon"></th>
			<th class="title"><?php 
    _e('Group Forum', 'bp-ass');
    ?>
</th>
			<th class="yes"><?php 
    _e('Yes', 'bp-ass');
    ?>
</th>
			<th class="no"><?php 
    _e('No', 'bp-ass');
    ?>
</th>
		</tr>
	</thead>
	<tbody>
		<tr>
			<td></td>
			<td><?php 
    _e('A member replies in a forum topic you\'ve started', 'bp-ass');
    ?>
</td>
			<td class="yes"><input type="radio" name="notifications[ass_replies_to_my_topic]" value="yes" <?php 
    if (!get_user_meta(bp_displayed_user_id(), 'ass_replies_to_my_topic', true) || 'yes' == get_user_meta(bp_displayed_user_id(), 'ass_replies_to_my_topic', true)) {
        ?>
checked="checked" <?php 
    }
    ?>
/></td>
			<td class="no"><input type="radio" name="notifications[ass_replies_to_my_topic]" value="no" <?php 
    if ('no' == get_user_meta(bp_displayed_user_id(), 'ass_replies_to_my_topic', true)) {
        ?>
checked="checked" <?php 
    }
    ?>
/></td>
		</tr>
		<tr>
			<td></td>
			<td><?php 
    _e('A member replies after you in a forum topic', 'bp-ass');
    ?>
</td>
			<td class="yes"><input type="radio" name="notifications[ass_replies_after_me_topic]" value="yes" <?php 
    if (!get_user_meta(bp_displayed_user_id(), 'ass_replies_after_me_topic', true) || 'yes' == get_user_meta(bp_displayed_user_id(), 'ass_replies_after_me_topic', true)) {
        ?>
checked="checked" <?php 
    }
    ?>
/></td>
			<td class="no"><input type="radio" name="notifications[ass_replies_after_me_topic]" value="no" <?php 
    if ('no' == get_user_meta(bp_displayed_user_id(), 'ass_replies_after_me_topic', true)) {
        ?>
checked="checked" <?php 
    }
    ?>
/></td>
		</tr>
		<tr>
			<td></td>
			<td><?php 
    _e('Receive notifications of your own posts?', 'bp-ass');
    ?>
</td>
			<td class="yes"><input type="radio" name="notifications[ass_self_post_notification]" value="yes" <?php 
    if (ass_self_post_notification(bp_displayed_user_id())) {
        ?>
checked="checked" <?php 
    }
    ?>
/></td>
			<td class="no"><input type="radio" name="notifications[ass_self_post_notification]" value="no" <?php 
    if (!ass_self_post_notification(bp_displayed_user_id())) {
        ?>
checked="checked" <?php 
    }
    ?>
/></td>
		</tr>

		<?php 
    do_action('ass_group_subscription_notification_settings');
    ?>
		</tbody>
	</table>


<?php 
}