Esempio n. 1
0
					<h5 class="widget-title">People in 
<?php 
        if ($city_name != 'Any City') {
            echo 'the City of ' . $city_name;
        }
        ?>
</h5>
					<ul class="list-people">
<?php 
        foreach ($users as $user) {
            $user_data = get_userdata($user->user_id);
            $user_name = $user_data->first_name . ' ' . $user_data->last_name;
            $user_avatar = get_avatar($user_data->ID, '72', 'identicon', '');
            echo '<li class="people-list">';
            echo '<a href="' . $app_url . '/author/' . $user_data->user_login . '" class="cityuser" rel="tooltip" data-placement="top" data-title="<strong>' . $user_name . '</strong><br/>';
            $user_content_count = nh_get_user_posts_count($user_data->ID, array('post_type' => 'post', 'post_status' => 'publish', 'posts_per_page' => -1));
            if ($user_content_count) {
                if ($user_content_count == '1') {
                    echo $user_content_count . '&nbsp;article';
                } elseif ($user_content_count > 1) {
                    echo $user_content_count . '&nbsp;articles';
                }
            }
            $user_likes = get_user_meta($user_data->ID, 'nh_li_user_loves');
            foreach ($user_likes as $like) {
                $user_likes_count = count($like);
                if ($user_likes_count) {
                    if ($user_likes_count == '1') {
                        echo ' &nbsp;&#8226;&nbsp; ' . $user_likes_count . '&nbsp;like';
                    } elseif ($user_likes_count > 1) {
                        echo ' &nbsp;&#8226;&nbsp; ' . $user_likes_count . '&nbsp;likes';
Esempio n. 2
0
				&nbsp;&nbsp;(<span class="byline">Status:</span> <?php 
                echo $newstatus;
                ?>
)</span></li>
			<?php 
            }
            echo '</ul>';
        }
        wp_reset_postdata();
    } else {
        echo '<h5>You haven&#39;t created any CityHow content yet!</h5>';
        echo '<p>Start by creating a <a class="nhline" href="' . $app_url . '/create-guide" title="Create a CityHow Guide">CityHow Guide</a>, or <a class="nhline" href="' . $app_url . '/guides" title="Explore CityHow Guides">explore other Guides</a> for inspiration.';
    }
    // VIEWER IS NOT AUTHOR
} elseif ($curauth->ID != $current_user->ID) {
    $count = nh_get_user_posts_count($curauth->ID, array('post_type' => 'post', 'post_status' => 'publish'));
    // Author has posts
    if ($count > 0) {
        // Guides
        $guideargs = array('author' => $curauth->ID, 'post_status' => 'publish', 'cat' => $guide_cat, 'posts_per_page' => -1);
        $guidequery = new WP_Query($guideargs);
        if ($guidequery->have_posts()) {
            echo '<h5>CityHow Guides</h5>';
            echo '<ul class="author-links">';
            while ($guidequery->have_posts()) {
                $guidequery->the_post();
                $post_key = nh_get_frm_entry_key($post->ID);
                ?>
		
				<li><a class="nhline" href="<?php 
                echo get_permalink($post->ID);
Esempio n. 3
0
                        echo '<span class="meta">Submitted on ' . $pub_date . ' and pending review. When it&#39;s published, you&#39;ll be able to edit it again. <a class="nhline" href="' . $app_url . '/?post_type=post&p=' . $post->ID . '&preview=true" title="See what it will look like" target="_blank">Preview</a> it here.</span>';
                    }
                    ?>
					</li>
	<?php 
                }
                echo '</ul>';
            }
            wp_reset_postdata();
            // TODO - when resources, blog, other content is
            // editable via front end, they will have their
            // own edit-X pages with a panel like this one.
            // TODO - are these 2 conditions the same??
        }
    } elseif ($current_user->ID != $mypost->post_author) {
        $count = nh_get_user_posts_count($current_user->ID, array('post_type' => 'post', 'post_status' => array('publish', 'draft', 'pending'), 'cat' => $guide_cat));
        if ($count > 0) {
            // Guides
            $guideargs = array('author' => $current_user->ID, 'post_status' => array('pending', 'publish', 'draft'), 'cat' => $guide_cat);
            $guidequery = new WP_Query($guideargs);
            if ($guidequery->have_posts()) {
                echo '<h5 class="widget-title">CityHow Guides</h5>';
                echo '<ul class="bullets-edit">';
                while ($guidequery->have_posts()) {
                    $guidequery->the_post();
                    $post_key = nh_get_frm_entry_key($post->ID);
                    ?>
		
					<li class="bullets-edit"><a class="nhline" href="<?php 
                    echo $app_url;
                    ?>