Are you talking about inline ajax loading? You want only admin to see the automatic inline loading of the latest post?
[signature moderated Please read the Forum Rules]
Basically I want to try and figure out how to have all users be able to post things via the submit box when your logged in, but admins are only able to see the “Recent Updates” below the submit box… Make sense?
Thanks so much!!
~Max
So, essentially, you DO NOT want regular users to see “Recent Updates” below the submit box? What do you want them to see instead? Just a blank page?
[signature moderated Please read the Forum Rules]
Yeah just a blank page and than the box to just refresh.
Basically, I want to use it so that people can submit questions on a site and just the admin users can see them and no one else can.
Thanks!
~Max
In p2/index.php,
Search for:
f( current_user_can( 'publish_posts' ) ) require_once dirname( __FILE__ ) . '/post-form.php';
Add the following line AFTER the above line:
<?php if (current_user_can('level_10', get_the_id())): ?>
Then,
Search for </div> <!-- main -->
Add the following line BEFORE the above line:
<?php endif; // hide post ?>
Hope this helps.
Willson
Revenue sharing technical knowledge base @ dbuggr.com
I added both of those lines and even with a user that is an editor or even when no one is logged in you are still able to see the posts.
It is at http://wwjt.org
Wilson Thank you so much for your help with this. It is very appreciated. 🙂
~Max
Strange … it works for me though. Here is my p2/index.php file with the two additional lines to hide posts. Compare and see if you have the same.
<?php
global $paged;
prologue_new_post_noajax();
get_header();
?>
<div class="sleeve_main">
<?php
if( current_user_can( 'publish_posts' ) ) require_once dirname( __FILE__ ) . '/post-form.php';
?>
<?php if (current_user_can('level_10', get_the_id())): ?>
<div id="main">
<h2><?php _e( 'Recent Updates' , 'p2'); ?> <?php if ( $paged > 1 ) printf( __('Page %s', 'p2'), $paged ); ?>
<a class="rss" href="<?php bloginfo( 'rss2_url' ); ?>">RSS</a>
<span class="controls">
<a href="#" id="togglecomments"><?php _e('Hide threads', 'p2'); ?></a> | <a href="#directions" id="directions-keyboard"><?php _e('Keyboard Shortcuts', 'p2'); ?></a>
</span>
</h2>
<?php
if ( have_posts() ):
?>
<ul id="postlist">
<?php
while( have_posts() ):
the_post();
require dirname(__FILE__) . '/entry.php';
endwhile; // have_posts
?>
</ul>
<?php else: // have_posts ?>
<ul id="postlist">
<li class="no-posts">
<h3><?php _e('No posts yet!', 'p2'); ?></h3>
</li>
</ul>
<?php
endif; // have posts
prologue_navigation();
?>
<?php endif; // hide post ?>
</div> <!-- main -->
</div> <!-- sleeve -->
<?php get_footer( );
[signature moderated Please read the Forum Rules]
Wilson you are awesome. That worked perfect!!
Thanks so much!
you’re welcome! Good luck with your project.
[signature moderated Please read the Forum Rules]