Advertisement
Guest User

Help Bainternet Posts Creation Limits

a guest
Sep 30th, 2014
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.86 KB | None | 0 0
  1. <?php
  2. /*
  3. Template Name: Register Page Template
  4. */
  5. ?>
  6. <?php get_header(); ?>
  7.  
  8. <div id="main-area">
  9.  
  10.     <?php get_template_part('includes/breadcrumbs'); ?>
  11.  
  12.     <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
  13.  
  14.         <?php if (get_option('askit_integration_single_top') <> '' && get_option('askit_integrate_singletop_enable') == 'on') echo(get_option('askit_integration_single_top')); ?>
  15.  
  16.         <div class="entry page">
  17.             <div class="entry-top">
  18.                 <div class="entry-content">
  19.                     <h2 class="title"><?php the_title(); ?></h2>
  20.                     <div class="clear"></div>
  21.  
  22.                     <div class="page-separator"></div>
  23.  
  24.                     <div class="post-content">
  25.                         <?php if ( current_user_can('manage_options') && !get_option('users_can_register') ) { ?>
  26.                             <p><?php esc_html_e('Note: You can activate users registration on WP-Admin / Setting / General page', 'AskIt'); ?></p>
  27.                         <?php } ?>
  28.  
  29.                         <?php if ( !is_user_logged_in() ) { ?>
  30.  
  31.                             <?php if ( !get_option('users_can_register') ) { ?>
  32.                                 <h3><?php esc_html_e('Users cannot currently register themselves, only administrator can manually create users.', 'AskIt' ); ?></h3>
  33.                             <?php } else { ?>
  34.                                 <div id="register-form">
  35.                                     <div class="title">
  36.                                         <h2><?php esc_html_e('Login', 'AskIt'); ?></h2>
  37.                                     </div>
  38.                                     <?php wp_login_form( array( 'redirect' => get_permalink() ) ); ?>
  39.  
  40.                                     <div class="clear"></div>
  41.  
  42.                                     <div class="page-separator"></div>
  43.  
  44.                                     <div class="title">
  45.                                         <h2><?php esc_html_e('Register your Account', 'AskIt'); ?></h2>
  46.                                     </div>
  47.                                     <form action="<?php echo esc_url( site_url( 'wp-login.php?action=register', 'login_post' ) ); ?>" method="post">
  48.                                         <p class="clearfix">
  49.                                             <label for="user_login" class="inputlable"><?php esc_html_e('Username','AskIt'); ?>:</label>
  50.                                             <input type="text" name="user_login" value="" id="user_login" class="input" />
  51.                                         </p>
  52.  
  53.                                         <p class="clearfix">
  54.                                             <label for="user_email" class="inputlable"><?php esc_html_e('E-Mail','AskIt'); ?>:</label>
  55.                                             <input type="text" name="user_email" value="" id="user_email" class="input"  />
  56.                                         </p>
  57.  
  58.                                         <?php do_action('register_form'); ?>
  59.                                         <p><input type="submit" value="<?php esc_attr_e('Register','AskIt'); ?>" id="register" class="register" /></p>
  60.  
  61.                                         <p class="statement"><?php esc_html_e('A password will be e-mailed to you.', 'AskIt');?></p>
  62.                                     </form>
  63.                                 </div>
  64.                             <?php } ?>
  65.  
  66.                         <?php } else { ?>
  67.  
  68.                             <?php
  69.                                 $post_created_error = '';
  70.                                 $result = false;
  71.  
  72.                                 if ( isset( $_POST['et_add_answer'] ) && isset( $_POST['_wpnonce-et-register-form-submitted'] ) && wp_verify_nonce( $_POST['_wpnonce-et-register-form-submitted'], 'et-register-form-submit' ) ) {
  73.                                     if ( $_POST['et_newpost_title'] <> '' && $_POST['et_newpost_content'] <> '' ) {
  74.                                         $my_post = array(
  75.                                             'post_title' => esc_attr( $_POST['et_newpost_title'] ),
  76.                                             'post_content' =>  wp_kses_post( $_POST['et_newpost_content'] ),
  77.                                             'tags_input' => esc_attr( $_POST['et_newpost_tags'] ),
  78.                                             'post_category' => array( (int) $_POST['et_newpost_category'] ),
  79.                                             'post_status' => 'publish'
  80.                                         );
  81.  
  82.                                         $result = wp_insert_post( $my_post );
  83.                                     } else {
  84.                                         $post_created_error = '<p id="create_done">'.esc_html__('Make sure you fill all fields', 'AskIt').'</p>';
  85.                                     }
  86.                                 } ?>
  87.  
  88.                                 <div id="create_new_post">
  89.                                     <?php if ($result == false) { ?>
  90.                                         <?php echo $post_created_error; ?>
  91.                                         <form action="<?php echo esc_url( get_permalink( get_the_ID() ) ); ?>#create_new_post" method="post">
  92.                                             <p class="clearfix">
  93.                                                 <label for="et_newpost_title" class="inputlable"><?php esc_html_e('Title','AskIt'); ?>:</label>
  94.                                                 <input type="text" name="et_newpost_title" value="<?php if ( isset( $_POST['et_newpost_title'] ) ) esc_attr_e( $_POST['et_newpost_title'] ); ?>" id="et_newpost_title" class="input" />
  95.                                             </p>
  96.  
  97.                                             <p class="clearfix">
  98.                                                 <label for="et_newpost_category" class="inputlable"><?php _e('Category', 'AskIt'); ?>:</label>
  99.                                                 <?php wp_dropdown_categories( apply_filters( 'et_register_category_dropdown', array('hide_empty' => 0, 'hierarchical' => 1, 'id' =>'et_newpost_category', 'name' => 'et_newpost_category', 'exclude'=> '14,45') ) ); ?>
  100.                                             </p>
  101.  
  102.                                             <p class="clearfix">
  103.                                                 <label for="et_newpost_content" class="inputlable"><?php esc_html_e('Content', 'AskIt');?>:</label>
  104.                                                 <textarea name="et_newpost_content" id="et_newpost_content" class="input"><?php if ( isset( $_POST['et_newpost_content'] ) ) echo esc_textarea( $_POST['et_newpost_content'] ); ?></textarea>
  105.                                             </p>
  106.  
  107.                                             <input type="hidden" name="et_add_answer" value="proccess" />
  108.                                             <input class="register" type="submit" value="<?php esc_attr_e('Submit','AskIt'); ?>" id="submit" />
  109.  
  110.                                             <?php wp_nonce_field( 'et-register-form-submit', '_wpnonce-et-register-form-submitted' ); ?>
  111.                                         </form>
  112.                                     <?php } else { ?>
  113.                                         <p id="create_done"><?php esc_html_e('The post was created.','AskIt'); ?> <a href="<?php echo( esc_url( get_permalink($result) ) ); ?>"><?php esc_html_e('View the post','AskIt'); ?></a></p>
  114.                                     <?php } ?>
  115.                                 </div> <!-- end #create_new_post -->
  116.  
  117.                         <?php } ?>
  118.                         <div class="clear"></div>
  119.                     </div>
  120.                 </div> <!-- end .entry-content -->
  121.             </div> <!-- end .entry-top -->
  122.         </div> <!-- end .entry -->
  123.  
  124.         <div class="clear"></div>
  125.  
  126.         <?php if (get_option('askit_integration_single_bottom') <> '' && get_option('askit_integrate_singlebottom_enable') == 'on') echo(get_option('askit_integration_single_bottom')); ?>
  127.  
  128.     <?php endwhile; endif; ?>
  129.  
  130. </div> <!-- end #main-area -->
  131.  
  132. <?php get_sidebar(); ?>
  133.  
  134. <?php get_footer(); ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement