File: /home/mmickelson/tfgarchive/wpblogtest1.old/wp-content/themes/mnml/index.php
<?php
if( 'POST' == $_SERVER['REQUEST_METHOD'] && !empty( $_POST['action'] ) && $_POST['action'] == 'post' ) {
auth_redirect();
if( !current_user_can( 'publish_posts' ) ) {
wp_redirect( get_bloginfo( 'url' ) . '/' );
exit;
}
check_admin_referer( 'new-post' );
$user_id = $current_user->user_id;
$post_content = $_POST['posttext'];
$tags = $_POST['tags'];
$char_limit = 40;
$post_title = strip_tags( $post_content );
if( strlen( $post_title ) > $char_limit ) {
$post_title = substr( $post_title, 0, $char_limit ) . ' ... ';
}
$post_id = wp_insert_post( array(
'post_author' => $user_id,
'post_title' => $post_title,
'post_content' => $post_content,
'tags_input' => $tags,
'post_status' => 'publish'
) );
wp_redirect( get_bloginfo( 'url' ) . '/' );
exit;
}
get_header( );
if( current_user_can( 'publish_posts' ) ) {
require_once dirname( __FILE__ ) . '/post-form.php';
}
?>
<div id="container">
<div id="content">
<div id="nav-above" class="navigation">
<div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">«</span> Older posts', 'sandbox')) ?></div>
<div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">»</span>', 'sandbox')) ?></div>
</div>
<?php while ( have_posts() ) : the_post() ?>
<div id="post-<?php the_ID() ?>" class="<?php sandbox_post_class() ?>">
<h2 class="entry-title"><a href="<?php the_permalink() ?>" title="<?php printf(__('Permalink to %s', 'sandbox'), wp_specialchars(get_the_title(), 1)) ?>" rel="bookmark"><?php the_title() ?></a></h2>
<div class="entry-content">
<?php the_content(''.__('Read More <span class="meta-nav">»</span>', 'sandbox').''); ?>
<?php wp_link_pages("\t\t\t\t\t<div class='page-link'>".__('Pages: ', 'sandbox'), "</div>\n", 'number'); ?>
</div>
<div class="comments-link"><?php comments_popup_link(__('Add a comment', 'sandbox'), __('1 Comment', 'sandbox'), __('% Comments', 'sandbox')) ?></div>
<?php edit_post_link(__('Edit', 'sandbox'), "\t\t\t\t\t<div class=\"edit-link\"><span>", "</span>\n\t\t\t\t\t</div>\n"); ?>
</div><!-- .post -->
<?php comments_template() ?>
<?php endwhile ?>
<div id="nav-below" class="navigation">
<div class="nav-previous"><?php next_posts_link(__('<span class="meta-nav">«</span> Older posts', 'sandbox')) ?></div>
<div class="nav-next"><?php previous_posts_link(__('Newer posts <span class="meta-nav">»</span>', 'sandbox')) ?></div>
</div>
</div><!-- #content -->
</div><!-- #container -->
<?php get_sidebar() ?>
<?php get_footer() ?>