Skip to content

Commit

Permalink
updated default permalink with post id
Browse files Browse the repository at this point in the history
  • Loading branch information
sbruner committed Oct 14, 2010
1 parent c17aff7 commit fe61279
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
38 changes: 36 additions & 2 deletions library/functions/content-functions.php
Expand Up @@ -278,6 +278,30 @@ function rolo_sorter() {
return $query;
};

/**
* Show to user
*
* Compare logged-in user to item owner
*
* @since 1.5
*/

function rolo_showtouser() {
global $current_user;
$owner = sanitize_html_class( get_the_author_meta( 'user_nicename' ), get_the_author_meta( 'ID' ) );
get_currentuserinfo();
$currentuser = $current_user->user_login;

if ($owner == $currentuser) {
$show = "y";
} else {
$show = "n";
}

return $show;

}


/**
* RoloPress master loop
Expand All @@ -290,10 +314,15 @@ function rolo_loop() { ?>
<?php if (!is_single() ) { // This class is not needed on single pages ?>
<ul class="item-list">
<?php }; ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php global $post;?>

<?php // only show to owner
if (rolo_showtouser() == "y") {?>


<li id="entry-<?php the_ID(); ?>" class="<?php rolopress_entry_class(); ?>">

<?php rolopress_before_entry(); // Before entry hook ?>

<div class="entry-main group">
Expand All @@ -305,6 +334,7 @@ function rolo_loop() { ?>
<?php }

elseif (is_single() ) {

if ( rolo_type_is( 'contact' ) ) { rolo_contact_header(get_the_ID()); the_content();
if ( is_active_sidebar("contact-under-main")){ ?>
<div class="widget-area contact-under-main">
Expand Down Expand Up @@ -367,8 +397,12 @@ function rolo_loop() { ?>
<?php rolo_entry_footer(); ?>

<?php rolopress_after_entry(); // After entry hook ?>

<?php if (is_single()) { comments_template( '/notes.php' ); } ?>

</li><!-- #entry-<?php the_ID(); ?> -->

<?php }; // end rolo_showtouser ?>

<?php endwhile; ?>

Expand Down
2 changes: 1 addition & 1 deletion library/setup/settings.php
Expand Up @@ -77,7 +77,7 @@ function rolopress_register_theme_settings() {
function rolo_set_permalinks() {
global $wpdb, $wp_rewrite;

$permalink_structure = '/%postname%';
$permalink_structure = '/%post_id%-%postname%';
$wp_rewrite->set_permalink_structure($permalink_structure);
$wp_rewrite->flush_rules();
}
Expand Down
1 change: 0 additions & 1 deletion single.php
Expand Up @@ -8,7 +8,6 @@

<?php rolo_pageheader();?>
<?php rolo_loop();?>
<?php comments_template( '/notes.php' ); ?>

</div><!-- #main -->
<?php rolopress_after_main(); // After main hook ?>
Expand Down

0 comments on commit fe61279

Please sign in to comment.