diff --git a/class/main.class.php b/class/main.class.php index e1d2d31..9649133 100644 --- a/class/main.class.php +++ b/class/main.class.php @@ -31,22 +31,7 @@ class CWV3 { } public function override_css() { - - $img = get_option( 'cwv3_bg_image', '' ); - $color = get_option( 'cwv3_bg_color' ); - ?> ! isset( $_COOKIE['cwv3_pages'] ) ? '' : json_decode( stripslashes( @$_COOKIE['cwv3_pages'] ), true ), - 'posts' => ! isset( $_COOKIE['cwv3_posts'] ) ? '' : json_decode( stripslashes( @$_COOKIE['cwv3_posts'] ), true ), - 'categories' => ! isset( $_COOKIE['cwv3_cats'] ) ? '' : json_decode( stripslashes( @$_COOKIE['cwv3_cats'] ), true ) - ); - - $sw = get_option( 'cwv3_sitewide' ); - $hm = get_option( 'cwv3_homepage' ); - $mi = get_option( 'cwv3_misc' ); - - if ( ! empty( $sw ) ) { - return ! empty( $cData['pages']['sitewide'] ) ? $cData['pages']['sitewide'] : false; - } - - if ( is_front_page() && ! empty( $hm ) ) { - return ! empty( $cData['pages']['home'] ) ? $cData['pages']['home'] : false; - } - - if ( ( is_archive() || is_search() ) && ! empty( $mi ) ) { - // Protect misc pages aswell - return ! empty( $cData['pages']['other'] ) ? $cData['pages']['other'] : false; - } - - if ( is_page() && 'yes' == get_post_meta( $post->ID, 'cwv3_auth', true ) ) { - $c = $cData['pages'][ $post->ID ]; - return ! empty( $c ) ? $c : false; - } - - $id = ( is_attachment() ? $post->post_parent : $post->ID ); - // First see if categories are setup in the admin side. - $catData = get_option( 'cwv3_cat_list' ); - $curCat = get_the_category( $id ); - if ( 'post' == get_post_type( $id ) && $this->in_cat( $catData, $curCat ) ) { - // 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. - 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. - if ( 'yes' == get_post_meta( $post->ID, 'cwv3_auth', true ) && ! is_front_page() ) { - return ! empty( $cData['posts'][ $post->ID ] ) ? $cData['posts'][ $id ] : false; - } - - return true; + return cwv3_auth_reply(); } public function in_cat( $catIDs, $catArray ) { @@ -292,36 +227,8 @@ class CWV3 { public function render_dialog() { - $d = get_option( 'cwv3_denial' ); - if ( 3 == $this->check_data() && 'enabled' == $d[0] ) { - $dtype = true; - }else { - $dtype = false; - } - $etxt = get_option( 'cwv3_enter_txt', 'Enter' ); - $extxt = get_option( 'cwv3_exit_txt', 'Exit' ); + cwv3_the_dialog(); - $cwv3_title = ( true == $dtype ) ? get_option( 'cwv3_den_title' ) : get_option( 'cwv3_d_title' ); - $cwv3_content = ( true == $dtype ) ? get_option( 'cwv3_den_msg' ) : get_option( 'cwv3_d_msg' ); - - $exit_url = get_option( 'cwv3_exit_link', '#' ); - $enter_url = get_option( 'cwv3_enter_link', '#' ); -?> - -
-
-
-
-
- -
- -
-
-
-
- - +
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+ +
+
+
+
+