Пример #1
0
function truwriter_autologin()
{
    if ($_GET['autologin'] == 'writer') {
        // ACCOUNT USERNAME TO LOGIN TO
        $creds['user_login'] = '******';
        // ACCOUNT PASSWORD TO USE- stored as option
        $creds['user_password'] = truwriter_option('pkey');
        $creds['remember'] = true;
        $autologin_user = wp_signon($creds, false);
        if (!is_wp_error($autologin_user)) {
            wp_redirect(site_url() . '/write');
        }
    }
}
Пример #2
0
        }
    }
} elseif ($wAccessCode == '') {
    // no code required, log 'em in
    wp_redirect(site_url() . '/wp-login.php?autologin=writer');
    exit;
}
// ------------------------ presets ------------------------
// verify that a  form was submitted and it passes the nonce check
if (isset($_POST['truwriter_form_access_submitted']) && wp_verify_nonce($_POST['truwriter_form_access_submitted'], 'truwriter_form_access')) {
    // grab the variables from the form
    $wAccess = stripslashes($_POST['wAccess']);
    // let's do some validation, store an error message for each problem found
    $errors = array();
    if ($wAccess != $wAccessCode) {
        $errors[] = '<p><strong>Incorrect Access Code</strong> - try again? Hint: ' . truwriter_option('accesshint');
    }
    if (count($errors) > 0) {
        // form errors, build feedback string to display the errors
        $feedback_msg = '';
        // Hah, each one is an oops, get it?
        foreach ($errors as $oops) {
            $feedback_msg .= $oops;
        }
        $feedback_msg .= '</p>';
    } else {
        wp_redirect(site_url() . '/wp-login.php?autologin=writer');
        exit;
    }
}
// end form submmitted check
Пример #3
0
        ?>
						
						<div class="clear"></div>
					
					</div> <!-- /post-nav -->
				
				</div> <!-- /post-cat-tags -->
				
				<div class="clear"></div>
								
			</div> <!-- /post-meta -->
													                                    	        	        
		</div> <!-- /post -->
				
				<?php 
        if (truwriter_option('allow_comments')) {
            comments_template('', true);
        }
        ?>
				
									                        
   	<?php 
    }
} else {
    ?>

		<p><?php 
    _e("We couldn't find any writings that matched your query. Please try again.", "radcliffe");
    ?>
</p>
	
Пример #4
0
					
							<?php 
        if ($my_cc_mode == 'site') {
            ?>
					
							<label for="wLicense"><?php 
            _e('Creative Commons License Applied', 'wpbootstrap');
            ?>
</label>
								<p>All writing added to this site will be licensed:</p>
								<p class="form-control"><?php 
            echo cc_license_html(truwriter_option('cc_site'), $wAuthor);
            ?>
</p>
								<input type="hidden" name="wLicense" id="wLicense" value="<?php 
            echo truwriter_option('cc_site');
            ?>
">
								
				
							<?php 
        } elseif ($my_cc_mode == 'user') {
            ?>
								<label for="wLicense"><?php 
            _e('Creative Commons License', 'wpbootstrap');
            ?>
</label>
								<p>Choose your preferred license:</p>
								<select name="wLicense" id="wLicense" class="form-control">
								<option value="--">Select...</option>
								<?php 
Пример #5
0
?>

<div class="title-wrap">
<a href="<?php 
the_permalink();
?>
" title="<?php 
the_title();
?>
" class="post-header section medium-padding">
	
	<div class="post-meta-top">
	
		<?php 
the_time(get_option('date_format'));
if (truwriter_option('allow_comments') and comments_open()) {
    echo '<span class="sep">|</span> ';
    if (is_single()) {
        comments_popup_link('0 comments', '1 comment', '% comments', 'post-comments');
    } else {
        comments_number('0 comments', '1 comment', '% comments');
    }
}
?>
 


		<span class="sep">|</span> Reading Time: ~
		<?php 
$readtime = do_shortcode('[est_time]');
echo $readtime;