</a>
			<a href="<?php 
    echo cjtheme_string(cjfm_generate_url('page_login')) . 'redirect=' . cjtheme_current_url();
    ?>
" data-redirect="<?php 
    echo cjtheme_current_url();
    ?>
" class="cjfm-show-login-form acomment-reply"><?php 
    _e('Like', 'buddypress');
    ?>
</a>
			<a href="<?php 
    echo cjtheme_string(cjfm_generate_url('page_login')) . 'redirect=' . cjtheme_current_url();
    ?>
" data-redirect="<?php 
    echo cjtheme_current_url();
    ?>
" class="cjfm-show-login-form acomment-reply"><?php 
    _e('Thanks', 'buddypress');
    ?>
</a>
		<?php 
}
?>

		<?php 
if (bp_activity_user_can_delete()) {
    ?>

			<a href="<?php 
    bp_activity_comment_delete_link();
    function cartoq_comment_template($comment, $args, $depth)
    {
        global $current_user;
        $GLOBALS['comment'] = $comment;
        $classes = array('comment', 'answer', 'clearfix');
        switch ($comment->comment_type) {
            case '':
                ?>
				<li <?php 
                comment_class($classes);
                ?>
 id="li-comment-<?php 
                comment_ID();
                ?>
">
					<?php 
                if ($comment->user_id) {
                    $user = get_userdata($comment->user_id);
                    $username = $user->user_nicename;
                    $profile_url = site_url('members/') . $username . '/';
                }
                ?>

					<div id="comment-<?php 
                comment_ID();
                ?>
" class="comment-body clearfix">
			
			
						<figure class="comment-avatar">
							<a href="<?php 
                echo $profile_url;
                ?>
">
								<?php 
                echo get_avatar($comment, 70);
                ?>
							</a>

							<figcaption>
								<span class="user-stats">
									<span class="stat"><i class="fa fa-thumbs-up"></i> <?php 
                echo cjtheme_user_likes_count($user->ID, 'likes');
                ?>
</span>
									<span class="stat"><i class="fa fa-star"></i> <?php 
                echo cjtheme_user_likes_count($user->ID, 'thanks');
                ?>
</span>
									<span class="stat"><i class="fa fa-crown"></i> <span class="label label-info"><?php 
                echo cjtheme_user_role_display($user->ID);
                ?>
</span></span>
								</span>
							</figcaption>
						</figure>
			
			
						<div class="comment-main">
			
							<header class="vcard clearfix">
								<?php 
                printf(__('<cite class="fn">%s answers:</cite>', 'cartoq'), get_comment_author_link());
                ?>
								
								<aside class="comm-edit">
									<a class="comment-date" href="<?php 
                echo htmlspecialchars(get_comment_link($comment->comment_ID));
                ?>
">
										<?php 
                echo cjtheme_time_ago(strtotime($comment->comment_date));
                ?>
									</a>
									<?php 
                edit_comment_link(__('Edit', 'cartoq'), '  ', '');
                ?>
								</aside>
							</header>
			
							<div class="comment-text">
								<?php 
                comment_text();
                ?>

								<?php 
                if ($comment->comment_approved == '0') {
                    ?>
									 <em><?php 
                    _e('Your comment is awaiting moderation.', 'cartoq');
                    ?>
</em>
									 <br />
								<?php 
                }
                ?>
							</div>

							<?php 
                $likes = cjtheme_activity_comment_likes($comment->comment_ID);
                $thanks = cjtheme_activity_comment_thanks($comment->comment_ID);
                ?>

							<a href="#" class="like-thanks btn btn-link <?php 
                echo cjtheme_login_class('like-comment', 'cjfm-show-login-form');
                ?>
" data-redirect="<?php 
                echo cjtheme_current_url();
                ?>
" id="like-<?php 
                echo $comment->comment_ID;
                ?>
" data-comment-id="<?php 
                echo $comment->comment_ID;
                ?>
" data-user-id="<?php 
                echo $current_user->ID;
                ?>
">
								<i class="fa fa-thumbs-up"></i>
								<span class="likes-value">
									<?php 
                echo $likes > 0 ? $likes : '0';
                ?>
								</span>
							</a>

							<a href="#" class="like-thanks btn btn-link <?php 
                echo cjtheme_login_class('thank-comment', 'cjfm-show-login-form');
                ?>
" data-redirect="<?php 
                echo cjtheme_current_url();
                ?>
" id="thanks-<?php 
                echo $comment->comment_ID;
                ?>
" data-comment-id="<?php 
                echo $comment->comment_ID;
                ?>
" data-user-id="<?php 
                echo $current_user->ID;
                ?>
">
								<i class="fa fa-heart"></i> 
								<span class="thanks-value">
									<?php 
                echo $thanks > 0 ? $thanks : '0';
                ?>
								</span>
							</a>
							
							<?php 
                comment_reply_link(array_merge($args, array('depth' => $depth, 'before' => '<footer class="reply">', 'after' => '</footer>', 'max_depth' => $args['max_depth'])));
                ?>
							
						</div>
			 
					</div><!-- #comment-<?php 
                comment_ID();
                ?>
  -->
				</li><?php 
                break;
            case 'pingback':
                ?>
				<li <?php 
                comment_class();
                ?>
 id="li-pingback-<?php 
                comment_ID();
                ?>
">
					<?php 
                _e('Pingback:', 'cartoq');
                ?>
 <?php 
                echo get_comment_author_link();
                ?>
 <small class="ping-edit"><?php 
                ac_icon('edit');
                edit_comment_link(__('Edit', 'cartoq'), '  ', '');
                ?>
</small>
				</li><?php 
            case 'trackback':
                ?>
				<li <?php 
                comment_class();
                ?>
 id="li-trackback-<?php 
                comment_ID();
                ?>
">
					<?php 
                _e('Trackback:', 'cartoq');
                ?>
 <?php 
                echo get_comment_author_link();
                ?>
 <small class="ping-edit"><?php 
                ac_icon('edit');
                edit_comment_link(__('Edit', 'cartoq'), '  ', '');
                ?>
</small>
				</li><?php 
        }
    }
function cjtheme_assistant_url($key, $callback)
{
    return cjtheme_string(cjtheme_current_url()) . 'cjtheme_complete_step=' . $key . '&cjtheme_step_redirect=' . urlencode($callback);
}
?>
							</header><!-- .page-header -->

							<div class="page-content">
								<?php 
if (!is_user_logged_in()) {
    wp_redirect(site_url());
} else {
    $user_info = cjtheme_user_info($current_user->ID);
}
$table_notifications = $wpdb->prefix . 'cjtheme_notifications';
$notifications = $wpdb->get_results("SELECT * FROM {$table_notifications} WHERE user_id = '{$user_info['ID']}' ORDER BY dated DESC");
$mark_read_url = cjtheme_string(cjtheme_current_url()) . 'mark-all=read';
if (isset($_GET['mark-all'])) {
    $wpdb->query("UPDATE {$table_notifications} SET unread = 0 WHERE user_id = '{$user_info['ID']}'");
    wp_redirect(cjtheme_current_url('only'));
    die;
}
?>

								<h2 class="sep-heading">
									<span>Notifications</span>
									<a href="<?php 
echo $mark_read_url;
?>
" class="pull-right">Mark All Read</a>
								</h2>

								<div id="notifications">
									<ul class="list-group">
										<?php 
$unique_key = sha1(serialize($options));
$form_submit = 'form_submit_' . $unique_key;
if (empty($_POST) || !wp_verify_nonce('form_submit')) {
    if (isset($_POST[$form_submit])) {
        foreach ($_POST as $key => $value) {
            if ($key != '_wpnonce' && $key != '_wp_http_referer') {
                if (is_array($value)) {
                    $update_value = serialize($value);
                } else {
                    $update_value = $value;
                }
                //$wpdb->query("UPDATE {$options_table} SET option_value = '{$update_value}' WHERE option_name = '{$key}'");
                $wpdb->update($options_table, array("option_value" => $update_value), array("option_name" => $key), array("%s"), array("%s"));
            }
        }
        $location = cjtheme_string(cjtheme_current_url()) . 'cjtheme_options=saved';
        wp_redirect($location);
    }
} else {
    print __('Sorry, your nonce did not verify.', 'cjtheme');
    exit;
}
if (isset($_GET['cjtheme_options']) && $_GET['cjtheme_options'] == 'saved') {
    $cj_message = cjtheme_message('success', __('Settings saved successfully.', 'cjtheme'));
    $display[] = $cj_message;
}
// Reset section settings
if (isset($_GET['cjtheme_reset']) && $_GET['cjtheme_reset'] == $_GET['callback']) {
    foreach ($options as $key => $value) {
        $wpdb->query("DELETE FROM {$options_table} WHERE option_name = '{$value['id']}'");
    }