members access

21
AlCaldarone.com @AlCaldarone

Upload: al-caldarone

Post on 14-Jul-2015

3.262 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Members access

AlCaldarone.com @AlCaldarone

Page 2: Members access
Page 3: Members access

Code

Assign permissions

Gather requirements

Develop schema

Plan

Connection strings

Assign relationships

Database

SQL

PHP

Security

Normalize tables

Encryption

Login page

Registration page

Lost password

Validations

Page 4: Members access

Heavy lifting is done!

Page 5: Members access

Plugin vs. DIY

Page 6: Members access

Top 5 Reasons I Did It MyselfTop 5 Reasons I Did It Myself

5) Client only had basic needs

4) Plugin Shmugin

3) Simpler for the client to maintain

2) I’m a glutton for punishment

1) Just kidding, it was actually super easy to develop and expand

*Please don’t sue me Mr. Letterman

Page 7: Members access

A combination

of simple concepts

WP Admin + Basic PHP

Page 8: Members access

Register sidebar widget

PHP

Add conditional statements

Create a template

Let

WordPress do the rest

Page 9: Members access

<?php//MEMBER SIDEBAR - Goes in Functions.php

register_sidebar( array( 'name' => __( ‘ATC Members Area', 'twentyten' ),

'id' => 'atc-members-area',

'description' => __( 'The ATC Members area', 'twentyten' ), 'before_widget' => '<li id="%1$s" class="widget-container %2$s">', 'after_widget' => '</li>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>',

) );

?>

Page 10: Members access

pick a template

any template

single.php

page.php

archive.phpcomments.php

sidebar.php

header.php

search.php

index.php

footer.php

404.php

Page 11: Members access

<?php // {Modeled from page.php} /*Template Name: Members Page*/

if ( is_user_logged_in() ) {get_header(); ?>

<div id="container"><div id="content" role="main">

<?php get_template_part( 'loop', 'page' );?>

</div> <!-- #content --></div> <!-- #container -->

<?php get_sidebar(); get_footer();

} else {wp_redirect( 'http://www.AnyWebsite.com/' );

} //End is_user_logged_in()

?>

Page 12: Members access

<?php// Added to sidebar.php

if ( is_user_logged_in() ) : ?><div id="secondary" class="widget-area" role="complementary">

<ul class="xoxo"><?php dynamic_sidebar( 'atc-members-area' ); ?>

</ul></div> <!-- #secondary .widget-area -->

<?php endif; ?>

Same dealfor the

sidebar widget

Page 13: Members access

Wrap

is_user_logged_in()around anything

you want to restrict

Page 14: Members access

Add custom menu

Members Sidebar

Page 15: Members access

Set template

Page 16: Members access
Page 17: Members access
Page 18: Members access
Page 19: Members access
Page 20: Members access

Custom Login and Registration

Customize WordPress login look & feelwith

Page redirect options based on User Role

Page 21: Members access

AlCaldarone.com@AlCaldarone

Thank You!

Done and Done!