Made some more sensible parts, login form functional.
authorlaury <laury@gaslightmedia.com>
Mon, 6 Jun 2016 21:10:19 +0000 (17:10 -0400)
committerlaury <laury@gaslightmedia.com>
Mon, 6 Jun 2016 21:10:19 +0000 (17:10 -0400)
13 files changed:
archive.php
front-page.php
glm-associate-template.php
glm-members-only-template.php
home.php
index.php
landing-page.php
page-3323.php
parts/content-section.php [new file with mode: 0644]
parts/glm-members-only-login-form.php [new file with mode: 0644]
parts/glm-members-only-lostpass-form.php [new file with mode: 0644]
parts/glm-members-only-top-bar.php [new file with mode: 0644]
sidebar.php

index c828f7b..d6341bc 100644 (file)
@@ -3,20 +3,20 @@
     <div class="row">
       
 <!--
-       <p>Categories</p>
-                    <div id="category-menu">
-                            <ul>
-                                <?php
-                                $args = array(
-                                'orderby' => 'name',
-                                'order' => 'ASC'
-                                );
-                              $categories = get_categories($args);
-                                foreach($categories as $category) { 
-                                  echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  } 
-                                ?>
-                            </ul>
-                    </div>
+    <p>Categories</p>
+        <div id="category-menu">
+            <ul>
+                <?php
+                $args = array(
+                'orderby' => 'name',
+                'order' => 'ASC'
+                );
+              $categories = get_categories($args);
+                foreach($categories as $category) { 
+                  echo '<li><a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a> </li> ';  } 
+                ?>
+            </ul>
+        </div>
 -->
         <div id="blog-posts-over" class="small-12 medium-9 columns">
            
             <div class="row content blog-posts-container">
               <!--  <div class="small-11 small-centered columns"> -->
                   <?php
-                                        if (has_post_thumbnail()) {
-                                                $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
-                                               echo '<a href="'.get_the_permalink().'" class="blog-featured-archive small-12 medium-6" style="background-image:url('.$image_data[0].');"></a>';
-                                               
-                                               echo '<div class="small-12 medium-6 small-centered columns right">';
-                                        } else {
-                                            echo '<div class="small-12 small-centered columns">';
-                                        }
-                                    ?>
+                        if (has_post_thumbnail()) {
+                                $image_data = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), "full");
+                               echo '<a href="'.get_the_permalink().'" class="blog-featured-archive small-12 medium-6" style="background-image:url('.$image_data[0].');"></a>';
 
-                       <div class="row">
-                                        <div class="small-12 columns">
-                                            <article id="<?php the_ID()?>" <?php post_class()?>>
-                                                <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
-                                                <?php echo the_advanced_excerpt(); ?>
-                                                <hr>
-                                                <div class="blog-excerpt-date">
-                                                    Posted on <strong><?php the_time('F jS, Y'); ?></strong>
-                                                </div>
-                                            </article>
-                                        </div>
-                                    </div>
+                               echo '<div class="small-12 medium-6 small-centered columns right">';
+                        } else {
+                            echo '<div class="small-12 small-centered columns">';
+                        }
+                    ?>
+
+                    <div class="row">
+                        <div class="small-12 columns">
+                            <article id="<?php the_ID()?>" <?php post_class()?>>
+                                <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
+                                <?php echo the_advanced_excerpt(); ?>
+                                <hr>
+                                <div class="blog-excerpt-date">
+                                    Posted on <strong><?php the_time('F jS, Y'); ?></strong>
+                                </div>
+                            </article>
+                        </div>
+                    </div>
                 </div>
             </div>
             <?php endwhile; ?>
index 06e0526..90506fa 100644 (file)
         <div class="edit-wrapper">
             <div class="row">
                 <div id="main-content" class="small-12 columns">
-                    <?php if(have_posts()) : while(have_posts()): the_post();?>
-                    <?php the_content();?>
-                    <?php endwhile; else:?>
-                    <p><?php _e('Sorry, no posts yet');?></p>
-                    <?php endif;?>
+                    <?php get_template_part('parts/content-section'); ?>
                 </div>
             </div>
         </div>
index 8afef40..cf0c847 100644 (file)
@@ -12,11 +12,7 @@ Template Name: GLM Associate Template
         <div class="row">
             <div id="main-content" class="small-12 columns">
             <?php // get_template_part('parts/bread-crumbs'); ?>
-            <?php if(have_posts()) : while(have_posts()): the_post();?>
-            <?php the_content();?>
-            <?php endwhile; else:?>
-            <p><?php _e('Sorry, no results found.');?></p>
-            <?php endif;?>
+                <?php get_template_partart('parts/content-section'); ?>
             </div>
         </div>
         
index 720cf35..fe7af16 100644 (file)
@@ -15,69 +15,22 @@ Template Name: GLM Members Only Template
         <?php } else { ?>
             <div class="small-12 large-8 columns right">
         <?php } ?>
-                <div class="row">
-                    <div id="main-content" class="small-12 columns">         
-                    <?php if (current_user_can("glm_members_main_menu")) { ?>
-                        <div id="glm-member-front-header" class="small-12 columns">
-                            <div class='glm-member-greeting'>Hello,     <?php $current_user = wp_get_current_user();echo $current_user->user_login ?>.</div>
-                            <a class='button glm-button' href="<?php echo wp_logout_url( home_url() ); ?>">Logout</a>
-                            <?php if (current_user_can("glm_members_member")) { ?>
-                                <a class='button glm-button' href='<?php echo get_admin_url() ?>admin.php?page=glm-members-admin-menu-member'>Enter Member Admin Area</a>                        
-                            <?php } ?>
-                        </div>
-                        <?php if (is_in_tree(get_option("glm_member_db_option_member_detail_id"))) {}?>
+                <div class="row"> 
+                    <div id="main-content" class="small-12 columns">   
+                    <?php if (current_user_can("glm_members_member")) { ?>
+                        <!-- If user is logged in as a member, display top bar, bread crumbs, & content -->
+                        <?php get_template_part('parts/glm-members-only-top-bar'); ?>
                         <?php get_template_part('parts/bread-crumbs'); ?>
-                        <?php if(have_posts()) : while(have_posts()): the_post();?>
-                            <?php the_content();?>
-                        <?php endwhile; else:?>
-                            <p><?php _e('Sorry, no results found.');?></p>
-                        <?php endif;?>
+                        <?php get_template_part('parts/content-section'); ?>
+                    <?php } else if (get_the_ID() == get_option("glm_members_database_option_members_only_id")) {?>
+                        <!-- Otherwise, if it's the main members only page, display content & form -->
+                        <?php get_template_part('parts/content-section'); ?>
+                        <?php get_template_part('parts/glm-members-only-login-form'); ?>
                     <?php } else { ?>
-                        <div class="wp_login_error">
-                            <p id="glm-member-login-notification">
-                            <?php if( isset( $_GET['login'] ) && $_GET['login'] == 'failed' ) { ?>
-                                The information you entered is incorrect. Please try again.
-                            <?php } 
-                            else if( isset( $_GET['login'] ) && $_GET['login'] == 'empty' ) { ?>
-                                Please enter both username and password.
-                            <?php } else { ?>
-                                Please log in to gain access to this page
-                            <?php } ?>
-                            </p>
-                        </div> 
-                        <div id='glm-member-login-form'>
-                            <?php 
-                                update_option('glm_member_db_frontend_login_request', 'true');
-                                wp_login_form(1, get_permalink()); 
-                                ?>
-                        </div>
-                        <a id="glm-member-password-lost-link" title="Lost Password">Lost Password?</a>
-                        <div id="glm-member-password-lost-form">
-                            <?php if ( $attributes['show_title'] ) : ?>
-                                <h3><?php _e( 'Forgot Your Password?', 'personalize-login' ); ?></h3>
-                            <?php endif; ?>
-
-                            <p>
-                                <?php
-                                    _e(
-                                        "Enter your email address and we'll send you a link you can use to pick a new password.",
-                                        'personalize_login'
-                                    );
-                                ?>
-                            </p>
-
-                            <form id="lostpasswordform" action="<?php echo wp_lostpassword_url(); ?>" method="post">
-                                <p class="form-row">
-                                    <label for="user_login"><?php _e( 'Email', 'personalize-login' ); ?>
-                                    <input type="text" name="user_login" id="user_login">
-                                </p>
-
-                                <p class="lostpassword-submit">
-                                    <input type="submit" name="submit" class="lostpassword-button"
-                                           value="<?php _e( 'Reset Password', 'personalize-login' ); ?>"/>
-                                </p>
-                            </form>
-                        </div>
+                        <!-- Otherwise, display main members only page content & form -->
+                        <?php echo get_post_page_content(get_option("glm_members_database_option_members_only_id")); ?>
+                        <?php get_template_part('parts/glm-members-only-login-form'); ?>
+                        
                     <?php } ?>
                     </div>
                 </div>
index 153e2c2..7606e8c 100644 (file)
--- a/home.php
+++ b/home.php
                         echo '<div class="small-12 small-centered columns">';
                     }
                 ?>
-                         <article id="<?php the_ID()?>" <?php post_class()?>>
-                            <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
-                                <?php echo the_advanced_excerpt(); ?>
-                                <hr class="contentBreak">
-                                <div class="blog-excerpt-date">
-                                    Posted on <strong><?php the_time('F jS, Y'); ?></strong>
-                                </div>
-                        </article>
+                <article id="<?php the_ID()?>" <?php post_class()?>>
+                    <h2 class="entry-title"><a href="<?php the_permalink(); ?>"><?php the_title();?></a></h2>
+                    <?php echo the_advanced_excerpt(); ?>
+                    <hr class="contentBreak">
+                    <div class="blog-excerpt-date">
+                        Posted on <strong><?php the_time('F jS, Y'); ?></strong>
+                    </div>
+                </article>
                 </div>
             </div>
             <?php endwhile; ?>
index 75b375b..cb46756 100644 (file)
--- a/index.php
+++ b/index.php
                 <div class="row">
                     <?php get_template_part('parts/bread-crumbs'); ?>
                     <div id="main-content" class="small-12 columns">
-                        <?php if(have_posts()) : while(have_posts()): the_post();?>
-                        <?php the_content();?>
-                        <?php endwhile; else:?>
-                        <p><?php _e('Sorry, no results found.');?></p>
-                        <?php endif;?>
+                        <?php get_template_part('parts/content-section'); ?>
                     </div>
                 </div>
             </div>
index ae6a796..51fd5d0 100644 (file)
@@ -12,11 +12,7 @@ Template Name: Landing Page
         <div class="row">
             <div id="main-content" class="small-12 columns">
             <?php if ( !isset( $_REQUEST['glm_action'] ) ) : ?>
-                <?php if(have_posts()) : while(have_posts()): the_post();?>
-                <?php the_content();?>
-                <?php endwhile; else:?>
-                <p><?php _e('Sorry, no results found.');?></p>
-                <?php endif;?>
+                <?php get_template_part('parts/content-section'); ?>
             <?php endif;?>
             </div>
         </div>
index e52fbb2..e78a4d0 100644 (file)
    
                     <?php get_template_part('parts/bread-crumbs'); ?>
                     <div id="main-content" class="small-12 columns">
-                        <?php if(have_posts()) : while(have_posts()): the_post();?>
-                        <?php the_content();?>
-                        <?php endwhile; else:?>
-                        <p><?php _e('Sorry, no results found.');?></p>
-                        <?php endif;?>
+                        <?php get_template_part('parts/content-section'); ?>
                         <div class="row dlGuides">
                             <div class="small-12  medium-6 large-3 columns guide">
                                <a href="<?php bloginfo('stylesheet_directory'); ?>/assets/guide_coolthings_2015.pdf">
diff --git a/parts/content-section.php b/parts/content-section.php
new file mode 100644 (file)
index 0000000..5ef5e10
--- /dev/null
@@ -0,0 +1,5 @@
+<?php if(have_posts()) : while(have_posts()): the_post();?>
+    <?php the_content();?>
+<?php endwhile; else:?>
+    <p><?php _e('Sorry, no results found.');?></p>
+<?php endif;?>
\ No newline at end of file
diff --git a/parts/glm-members-only-login-form.php b/parts/glm-members-only-login-form.php
new file mode 100644 (file)
index 0000000..1f079aa
--- /dev/null
@@ -0,0 +1,19 @@
+                        <div class="wp_login_error">
+                            <p id="glm-member-login-notification">
+                            <?php if( isset( $_GET['login'] ) && $_GET['login'] == 'failed' ) { ?>
+                                The information you entered is incorrect. Please try again.
+                            <?php } 
+                            else if( isset( $_GET['login'] ) && $_GET['login'] == 'empty' ) { ?>
+                                Please enter both username and password.
+                            <?php } else { ?>
+                                Please log in to gain access to this page
+                            <?php } ?>
+                            </p>
+                        </div> 
+                        <div id='glm-member-login-form'>
+                            <?php 
+                                update_option('glm_members_database_frontend_login_request', 'true');
+                                wp_login_form(1, get_permalink()); 
+                                ?>
+                        </div>
+                        <?php get_template_part('parts/glm-members-only-lostpass-form'); ?>
\ No newline at end of file
diff --git a/parts/glm-members-only-lostpass-form.php b/parts/glm-members-only-lostpass-form.php
new file mode 100644 (file)
index 0000000..296b1dd
--- /dev/null
@@ -0,0 +1,25 @@
+
+                        <a id="glm-member-password-lost-link" title="Lost Password">Lost Password?</a>
+                        <div id="glm-member-password-lost-form">
+
+                            <p>
+                                <?php
+                                    _e(
+                                        "Enter your email address and we'll send you a link you can use to pick a new password.",
+                                        'personalize_login'
+                                    );
+                                ?>
+                            </p>
+
+                            <form id="lostpasswordform" action="<?php echo wp_lostpassword_url(); ?>" method="post">
+                                <p class="form-row">
+                                    <label for="user_login"><?php _e( 'Email', 'personalize-login' ); ?>
+                                    <input type="text" name="user_login" id="user_login">
+                                </p>
+
+                                <p class="lostpassword-submit">
+                                    <input type="submit" name="submit" class="lostpassword-button"
+                                           value="<?php _e( 'Reset Password', 'personalize-login' ); ?>"/>
+                                </p>
+                            </form>
+                        </div>
\ No newline at end of file
diff --git a/parts/glm-members-only-top-bar.php b/parts/glm-members-only-top-bar.php
new file mode 100644 (file)
index 0000000..c08da40
--- /dev/null
@@ -0,0 +1,7 @@
+<div id="glm-member-front-header" class="small-12 columns">
+    <div class='glm-member-greeting'>Hello,     <?php $current_user = wp_get_current_user();echo $current_user->user_login ?>.</div>
+    <a class='button glm-button' href="<?php echo wp_logout_url( home_url() ); ?>">Logout</a>
+    <?php if (current_user_can("glm_members_member")) { ?>
+<!--        <a class='button glm-button' href='<?php // echo get_admin_url() ?>admin.php?page=glm-members-admin-menu-member'>Enter Member Admin Area</a>                        -->
+    <?php } ?>
+</div>
\ No newline at end of file
index ea6f419..3541128 100644 (file)
@@ -3,6 +3,6 @@
                                 <?php glm_side_menu(); ?>
                             </div>
                             <a href="<?php echo get_permalink(3323); ?>"><img src="<?php bloginfo('template_url');?>/assets/request-guides.jpg"></a>
-                                <a href="<?php echo get_permalink(3309); ?>"><img src="<?php bloginfo('template_url');?>/assets/269-cool-things.jpg"></a>
-                                <a href="<?php echo get_permalink(3327); ?>"><img src="<?php bloginfo('template_url');?>/assets/email-signup.jpg"></a>
+                            <a href="<?php echo get_permalink(3309); ?>"><img src="<?php bloginfo('template_url');?>/assets/269-cool-things.jpg"></a>
+                            <a href="<?php echo get_permalink(3327); ?>"><img src="<?php bloginfo('template_url');?>/assets/email-signup.jpg"></a>
                         </div>
\ No newline at end of file