PriMoThemes — now s2Member® (official notice)
This is now a very OLD forum system. It's in READ-ONLY mode.
All community interaction now occurs at WP Sharks™. See: new forums @ WP Sharks™
Options +FollowSymLinks
RewriteEngine on
# index.php to /wp-login.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
<form name="loginform" id="loginform" action="http://www.site.com/wp-login.php" method="post">
<p>
<label>Username *<br />
<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
</p>
<p>
<label>Password *<br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
</p>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
<input type="hidden" name="redirect_to" value="http://www.site.com/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
Cristián Lávaque wrote:You could edit the template file for the homepage and use a conditional to check if the person is logged in before showing the posts, and redirect to wp-login.php if not.
WP Admin -> s2Member -> API / Scripting
<?php get_header(); ?>
<?php dynamic_sidebar(1); ?>
<?php if(get_option("ocmx_home_page_layout") == "widget") :
if (function_exists('dynamic_sidebar') && is_active_sidebar(2)) : ?>
<div id="widget-block" class="clearfix">
<ul class="widget-list">
<?php dynamic_sidebar(2); ?>
</ul>
</div>
<?php endif;
else : ?>
<ul class="double-cloumn clearfix">
<li id="left-column">
<ul class="blog-main-post-container">
<?php if (have_posts()) :
global $show_author;
$show_author = 1;
while (have_posts()) : the_post(); setup_postdata($post);
include(TEMPLATEPATH."/functions/fetch-list.php");
endwhile;
else :
ocmx_no_posts();
endif; ?>
</ul>
<?php motionpic_pagination("clearfix", "pagination clearfix"); ?>
</li>
<?php get_sidebar(); ?>
</ul>
<?php endif; ?>
<?php get_footer(); ?>
<?php if(is_user_logged_in()){ ?>
Content for anyone that is logged in, regardless of their Membership Level.
<?php } else { ?>
Some public content.
<?php } ?>
<?php if(is_user_logged_in()){ ?>
<?php get_header(); ?>
<?php dynamic_sidebar(1); ?>
<?php if(get_option("ocmx_home_page_layout") == "widget") :
if (function_exists('dynamic_sidebar') && is_active_sidebar(2)) : ?>
<div id="widget-block" class="clearfix">
<ul class="widget-list">
<?php dynamic_sidebar(2); ?>
</ul>
</div>
<?php endif;
else : ?>
<ul class="double-cloumn clearfix">
<li id="left-column">
<ul class="blog-main-post-container">
<?php if (have_posts()) :
global $show_author;
$show_author = 1;
while (have_posts()) : the_post(); setup_postdata($post);
include(TEMPLATEPATH."/functions/fetch-list.php");
endwhile;
else :
ocmx_no_posts();
endif; ?>
</ul>
<?php motionpic_pagination("clearfix", "pagination clearfix"); ?>
</li>
<?php get_sidebar(); ?>
</ul>
<?php endif; ?>
<?php get_footer(); ?>
<?php } else { ?>
<?php get_header(); ?>
<form name="loginform" id="loginform" action="http://www.site.com/wp-login.php" method="post">
<p>
<label>Username *<br />
<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
</p>
<p>
<label>Password *<br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
</p>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
<input type="hidden" name="redirect_to" value="http://www.site.com/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
<?php get_footer(); ?>
<?php } ?>
zerotosran wrote:where should i put these in?
<ul class="blog-main-post-container">
<?php if (have_posts()) :
global $show_author;
$show_author = 1;
while (have_posts()) : the_post(); setup_postdata($post);
include(TEMPLATEPATH."/functions/fetch-list.php");
endwhile;
else :
ocmx_no_posts();
endif; ?>
</ul>
<?php if (user_is_logged_in()) { ?>
<ul class="blog-main-post-container">
<?php if (have_posts()) :
global $show_author;
$show_author = 1;
while (have_posts()) : the_post(); setup_postdata($post);
include(TEMPLATEPATH."/functions/fetch-list.php");
endwhile;
else :
ocmx_no_posts();
endif; ?>
</ul>
<?php } else { ?>
Here goes the message you want to give to those who aren't logged in.
<?php } ?>
drbyte wrote:This will only show login form to none members including the header and footer....once they are logged in then it will show everything including your side bars.
- Code: Select all
<?php if(is_user_logged_in()){ ?>
<?php get_header(); ?>
<?php dynamic_sidebar(1); ?>
<?php if(get_option("ocmx_home_page_layout") == "widget") :
if (function_exists('dynamic_sidebar') && is_active_sidebar(2)) : ?>
<div id="widget-block" class="clearfix">
<ul class="widget-list">
<?php dynamic_sidebar(2); ?>
</ul>
</div>
<?php endif;
else : ?>
<ul class="double-cloumn clearfix">
<li id="left-column">
<ul class="blog-main-post-container">
<?php if (have_posts()) :
global $show_author;
$show_author = 1;
while (have_posts()) : the_post(); setup_postdata($post);
include(TEMPLATEPATH."/functions/fetch-list.php");
endwhile;
else :
ocmx_no_posts();
endif; ?>
</ul>
<?php motionpic_pagination("clearfix", "pagination clearfix"); ?>
</li>
<?php get_sidebar(); ?>
</ul>
<?php endif; ?>
<?php get_footer(); ?>
<?php } else { ?>
<?php get_header(); ?>
<form name="loginform" id="loginform" action="http://www.site.com/wp-login.php" method="post">
<p>
<label>Username *<br />
<input type="text" name="log" id="user_login" class="input" value="" size="20" tabindex="10" /></label>
</p>
<p>
<label>Password *<br />
<input type="password" name="pwd" id="user_pass" class="input" value="" size="20" tabindex="20" /></label>
</p>
<p class="forgetmenot"><label><input name="rememberme" type="checkbox" id="rememberme" value="forever" tabindex="90" /> Remember Me</label></p>
<p class="submit">
<input type="submit" name="wp-submit" id="wp-submit" class="button-primary" value="Log In" tabindex="100" />
<input type="hidden" name="redirect_to" value="http://www.site.com/wp-admin/" />
<input type="hidden" name="testcookie" value="1" />
</p>
</form>
<?php get_footer(); ?>
<?php } ?>
<?php /* Template Name: Widgetized Page */
get_header();
$widget_title = $post->post_title;
dynamic_sidebar($widget_title." Slider Widget");
if (function_exists('dynamic_sidebar') && is_active_sidebar($widget_title." 3 Column")) : ?>
<div id="widget-block" class="clearfix">
<ul class="widget-list">
<?php dynamic_sidebar($widget_title." 3 Column"); ?>
</ul>
</div>
<?php endif;
get_footer(); ?>
zerotosran wrote:so, i've used alternative protection option because it was the solution that i was looking for. it doesn't work
Cristián Lávaque wrote:zerotosran wrote:so, i've used alternative protection option because it was the solution that i was looking for. it doesn't work
Could you explain what you did, what happens, and what you expected?
Also, I suggest you watch these:
http://www.s2member.com/general-options-overview-video/
http://www.s2member.com/content-restric ... ble-video/
I hope that helps.
Cristián Lávaque wrote:OK. Did you watch the videos I suggested?
Users browsing this forum: No registered users and 1 guest