Exemplo n.º 1
0
<div class="panel">
	<?php 
$current_user_id = theme_cache::get_current_user_id();
$notis = theme_notification::get_notifications(array('user_id' => $current_user_id));
$unreads = theme_notification::get_notifications(array('user_id' => $current_user_id, 'type' => 'unread'));
if (!empty($notis)) {
    ?>
		<ul class="list-group history-group">
			<?php 
    foreach ($notis as $k => $noti) {
        /**
         * Check the noti is read or unread
         */
        if (isset($noti['id']) && isset($unreads[$noti['id']])) {
            $unread_class = ' unread list-group-item-info';
        } else {
            $unread_class = null;
        }
        ?>
				<li class="list-group-item type-<?php 
        echo $noti['type'];
        ?>
 <?php 
        echo $unread_class;
        ?>
">
					<?php 
        do_action('list_noti', $noti);
        ?>
				</li><!-- /.list-group-item -->
			<?php 
Exemplo n.º 2
0
        echo ___('Log-out');
        ?>
</a></li>
							</ul>
						</div>
					</div>
					

					<!-- notification -->
					<?php 
        if (class_exists('theme_notification')) {
            $unread = theme_notification::get_count(['type' => 'unread']);
            if ($unread > 0) {
                ?>
							<a href="<?php 
                echo theme_notification::get_tabs('notifications')['url'];
                ?>
" class="tool tool-notification " title="<?php 
                echo ___('Your have new notification');
                ?>
">
								<i class="fa fa-bell fa-fw fa-spin"></i> 
							</a>
						<?php 
            }
            ?>
					<?php 
        }
        ?>

					<!-- pm -->
    public static function list_noti($meta)
    {
        if ($meta['type'] !== self::$type_key) {
            return;
        }
        global $post;
        $post = theme_cache::get_post($meta['post-id']);
        setup_postdata($post);
        ?>
		<div class="media">
			<div class="media-left">
				<img src="<?php 
        echo theme_functions::$thumbnail_placeholder;
        ?>
" alt="<?php 
        echo ___('Preview image');
        ?>
" data-src="<?php 
        echo theme_functions::get_thumbnail_src($post->ID);
        ?>
" width="60" height="60" class="post-thumbnail media-object avatar">
			</div>
			<div class="media-body">
				<h4 class="media-heading">
					<span class="label label-default">
						<i class="fa fa-eye"></i> 
						<?php 
        echo ___('Per hundred views');
        ?>
					</span>
					<strong class="label label-danger">+<?php 
        echo $meta['points'];
        ?>
</strong> 
					<?php 
        theme_notification::the_time($meta);
        ?>
				</h4>
				<div class="excerpt">
					<p>
					<?php 
        echo sprintf(___('Your post %1$s reached per hundred views, %2$s %3$s. Views are %4$s.'), '<a href="' . theme_cache::get_permalink($post->ID) . '" target="_blank">' . theme_cache::get_the_title($post->ID) . ' <i class="fa fa-external-link"></i></a>', '<strong>+' . $meta['points'] . '</strong>', theme_custom_point::get_point_name(), '<strong>' . $meta['views'] . '</strong>');
        ?>
					</p>
				</div>
			</div><!-- /.media-body -->
		</div><!-- /.media -->
		<?php 
        wp_reset_postdata();
    }
Exemplo n.º 4
0
    /**
     * list comment-reply
     */
    public static function list_noti_comment_reply($noti)
    {
        if ($noti['type'] !== 'comment-reply') {
            return false;
        }
        $comment = theme_notification::get_comment($noti['comment-id']);
        ?>
		<div class="media">
			<div class="media-left">
				<a href="<?php 
        echo comment_author_url($noti['comment-id']);
        ?>
">
					<img src="<?php 
        echo theme_functions::$avatar_placeholder;
        ?>
" data-src="<?php 
        echo theme_cache::get_avatar_url($comment->user_id);
        ?>
" class="avatar media-object" alt="avatar" width="60" height="60">
				</a>
			</div>
			<div class="media-body">
				<h4 class="media-heading">
					<span class="label label-default"><i class="fa fa-comments-o"></i> <?php 
        echo ___('Comment reply');
        ?>
</span> 
					<?php 
        echo sprintf(___('Your comment has a reply by %1$s in %2$s.'), get_comment_author_link($noti['comment-id']), '<a href="' . theme_cache::get_permalink($comment->comment_post_ID) . '#comment-' . $noti['comment-id'] . '">
							' . theme_cache::get_the_title($comment->comment_post_ID) . '
						</a>');
        ?>
				</h4>
				<div class="excerpt"><?php 
        comment_text($noti['comment-id']);
        ?>
</div>
			</div><!-- /.media-body -->
		</div><!-- /.media -->
		<?php 
    }