PHP Tidy
This commit is contained in:
@ -237,21 +237,21 @@ class CWV3{
|
|||||||
$mi = get_option( 'cwv3_misc' );
|
$mi = get_option( 'cwv3_misc' );
|
||||||
|
|
||||||
if ( $sw[0] == 'enabled' ) {
|
if ( $sw[0] == 'enabled' ) {
|
||||||
return (!empty($cData['pages']['sitewide']) ? $cData['pages']['sitewide'] : false);
|
return !empty( $cData['pages']['sitewide'] ) ? $cData['pages']['sitewide'] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_home() && $hm[0] == 'enabled' ) {
|
if ( is_home() && $hm[0] == 'enabled' ) {
|
||||||
return (!empty($cData['pages']['home']) ? $cData['pages']['home'] : false);
|
return !empty( $cData['pages']['home'] ) ? $cData['pages']['home'] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ( is_archive() || is_search() ) && $mi[0] == 'enabled' ) {
|
if ( ( is_archive() || is_search() ) && $mi[0] == 'enabled' ) {
|
||||||
// Protect misc pages aswell
|
// Protect misc pages aswell
|
||||||
return (!empty($cData['pages']['other']) ? $cData['pages']['other'] : false);
|
return !empty( $cData['pages']['other'] ) ? $cData['pages']['other'] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( is_page() && get_post_meta( $post->ID, 'cwv3_auth', true ) == 'yes' ) {
|
if ( is_page() && get_post_meta( $post->ID, 'cwv3_auth', true ) == 'yes' ) {
|
||||||
$c = $cData['pages'][$post->ID];
|
$c = $cData['pages'][$post->ID];
|
||||||
return(!empty($c) ? $c : false);
|
return !empty( $c ) ? $c : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
$id = ( is_attachment() ? $post->post_parent : $post->ID );
|
$id = ( is_attachment() ? $post->post_parent : $post->ID );
|
||||||
@ -261,11 +261,11 @@ class CWV3{
|
|||||||
if ( get_post_type( $id ) == 'post' && $this->inCat( $catData, $curCat ) ) {
|
if ( get_post_type( $id ) == 'post' && $this->inCat( $catData, $curCat ) ) {
|
||||||
// If the current category is selected in the admin page, that means the administrator wishes to protect it.
|
// If the current category is selected in the admin page, that means the administrator wishes to protect it.
|
||||||
// respect the admin's wishes and do it.
|
// respect the admin's wishes and do it.
|
||||||
return(!empty($cData['categories'][$post->ID]) ? $cData['categories'][$id] : false );
|
return !empty( $cData['categories'][$post->ID] ) ? $cData['categories'][$id] : false;
|
||||||
}
|
}
|
||||||
// Since that's not the case, we need to check post_meta data and see if this post is protected.
|
// Since that's not the case, we need to check post_meta data and see if this post is protected.
|
||||||
if ( get_post_meta( $post->ID, 'cwv3_auth', true ) == 'yes' && !is_home() ) {
|
if ( get_post_meta( $post->ID, 'cwv3_auth', true ) == 'yes' && !is_home() ) {
|
||||||
return(!empty($cData['posts'][$post->ID]) ? $cData['posts'][$id] : false );
|
return !empty( $cData['posts'][$post->ID] ) ? $cData['posts'][$id] : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'failed all checks';
|
return 'failed all checks';
|
||||||
@ -298,7 +298,7 @@ class CWV3{
|
|||||||
<div id="cwv3_auth">
|
<div id="cwv3_auth">
|
||||||
<div id="cwv3_title"><?php if ( $dtype == true ): ?><?php echo get_option( 'cwv3_den_title' ); ?><?php else: ?><?php echo get_option( 'cwv3_d_title' ); ?><?php endif; ?></div>
|
<div id="cwv3_title"><?php if ( $dtype == true ): ?><?php echo get_option( 'cwv3_den_title' ); ?><?php else: ?><?php echo get_option( 'cwv3_d_title' ); ?><?php endif; ?></div>
|
||||||
<div id="cwv3_content"><?php if ( $dtype === true ): ?><?php echo do_shortcode( get_option( 'cwv3_den_msg' ) ); ?><?php else: ?><?php echo do_shortcode( get_option( 'cwv3_d_msg' ) ); ?><?php endif; ?></div>
|
<div id="cwv3_content"><?php if ( $dtype === true ): ?><?php echo do_shortcode( get_option( 'cwv3_den_msg' ) ); ?><?php else: ?><?php echo do_shortcode( get_option( 'cwv3_d_msg' ) ); ?><?php endif; ?></div>
|
||||||
<div id="cwv3_btns"><?php if($dtype !== true): ?><div id="cwv3_enter"><a href="javascript:;" id="cw_enter_link"><?php echo (!empty($etxt) ? $etxt : 'Enter'); ?></a></div><?php endif; ?><div id="cwv3_exit"><a href="javascript:;" id="cw_exit_link"><?php echo (!empty($extxt) ? $extxt : 'Exit'); ?></a></div></div>
|
<div id="cwv3_btns"><?php if ( $dtype !== true ): ?><div id="cwv3_enter"><a href="javascript:;" id="cw_enter_link"><?php echo !empty( $etxt ) ? $etxt : 'Enter'; ?></a></div><?php endif; ?><div id="cwv3_exit"><a href="javascript:;" id="cw_exit_link"><?php echo !empty( $extxt ) ? $extxt : 'Exit'; ?></a></div></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- END CWV3 Dialog -->
|
<!-- END CWV3 Dialog -->
|
||||||
|
@ -7,8 +7,8 @@ Author: Jerry Wood Jr.
|
|||||||
Version: 3.5.1
|
Version: 3.5.1
|
||||||
Author URI: http://plugish.com
|
Author URI: http://plugish.com
|
||||||
*/
|
*/
|
||||||
require_once (dirname(__FILE__).'/inc/options.inc.php');
|
require_once dirname( __FILE__ ).'/inc/options.inc.php';
|
||||||
require_once (dirname(__FILE__).'/lib/jw_simple_options/simple_options.php');
|
require_once dirname( __FILE__ ).'/lib/jw_simple_options/simple_options.php';
|
||||||
require_once (dirname(__FILE__).'/class/main.class.php');
|
require_once dirname( __FILE__ ).'/class/main.class.php';
|
||||||
$cwv3_options = new JW_SIMPLE_OPTIONS( $cwv3_op_data );
|
$cwv3_options = new JW_SIMPLE_OPTIONS( $cwv3_op_data );
|
||||||
register_uninstall_hook( __FILE__, $cwv3_options->uninstall() );
|
register_uninstall_hook( __FILE__, $cwv3_options->uninstall() );
|
Reference in New Issue
Block a user