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™

Pro Login Widget via PHP tag

s2Member Plugin. A Membership plugin for WordPress®.

Pro Login Widget via PHP tag

Postby jacksonmurphy » March 15th, 2011, 7:21 pm

I can't get this to work?

I insert this code:

Code: Select all
<?php echo s2member_pro_login_widget(); ?>


And nothing shows up?
Any ideas why this wouldn't work?
User avatar
jacksonmurphy
Registered User
Registered User
 
Posts: 7
Joined: March 15, 2011

Re: Pro Login Widget via PHP tag

Postby Cristián Lávaque » March 15th, 2011, 7:38 pm

Do you have s2Member Pro?

You'll also need this plugin http://wordpress.org/extend/plugins/php ... on-plugin/ for PHP to work in your posts.

Hope that helps. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Pro Login Widget via PHP tag

Postby jacksonmurphy » March 16th, 2011, 9:14 am

Hey Cristian-
Thanks for your response.
I do have s2Member Pro...
I am putting the php code inside a custom template... not inside a post or page.
User avatar
jacksonmurphy
Registered User
Registered User
 
Posts: 7
Joined: March 15, 2011

Re: Pro Login Widget via PHP tag

Postby Cristián Lávaque » March 16th, 2011, 11:28 am

OK, good. :)

Would you post between code tags the code of the template file with the login widget that's not showing up? Like this:

[code=php]Your template file code[/code]
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Pro Login Widget via PHP tag

Postby jacksonmurphy » March 16th, 2011, 11:51 am

You can view the test page here:
http://www.annawilson.com/pr-kit-test/

If I can get this widget to show, I want to be able to redirect the user back to this page... where they can view the content... once logged in (see code below)

This is what I currently have in my template:

Code: Select all

<?php
/**
 * Template Name: Presskit Test
 */
 
?>
 
<?php get_header(); ?>

    <!-- The class "grid_7" restricts the div to 7 columns wide -->
    <div id="content" class="grid_10 prefix_1">

        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <div class="post" id="post-<?php the_ID(); ?>">
        
            <div class="entry">
                
                <?php echo s2member_pro_login_widget(); ?> 

            </div><!-- end entry -->
            
        </div><!-- end post -->
        
        <?php endwhile; endif; ?>
        <?php edit_post_link('Edit this entry.''<p>''</p>'); ?>
        <br />
    </div><!-- end content -->

    <div id="sidebar" class="grid_4">
    
    </div>

<?php get_footer(); ?>


This is what I'm trying to do:

Code: Select all

<?php if (is_user_logged_in() && current_user_can("access_s2member_ccap_presskit")) { ?>
                
                    <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
                
                <?php } else { ?>
                
                    <h1>Members of the Press Only</h1>
                    Please login to view this page.
                    <?php echo s2member_pro_login_widget(); ?>
                
                <?php ?> 
User avatar
jacksonmurphy
Registered User
Registered User
 
Posts: 7
Joined: March 15, 2011

Re: Pro Login Widget via PHP tag

Postby Cristián Lávaque » March 16th, 2011, 12:36 pm

Yes, I see widget missing in the HTML, and you're doing it the way the documentation says. I'll ask Jason about it.

Regarding what you're trying to do, that should be fine. Since you're doing most of that in PHP, there's no real need to get in and out of PHP all the time, you could do it like this:

Code: Select all
<?php if (is_user_logged_in() && current_user_can('access_s2member_ccap_presskit'))
    the_content('<p class="serif">Read the rest of this page &raquo;</p>');
else
    echo '<h1>Members of the Press Only</h1> Please login to view this page.', s2member_pro_login_widget(); ?>
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Pro Login Widget via PHP tag

Postby jacksonmurphy » March 16th, 2011, 6:38 pm

Thanks Cristian! I very much appreciate all your help!
User avatar
jacksonmurphy
Registered User
Registered User
 
Posts: 7
Joined: March 15, 2011

Re: Pro Login Widget via PHP tag

Postby Cristián Lávaque » March 16th, 2011, 7:29 pm

You are welcome. :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010

Re: Pro Login Widget via PHP tag

Postby jacksonmurphy » March 17th, 2011, 8:55 am

Would it have anything to do with PHP settings on the server?
http://www.annawilson.com/test.php
User avatar
jacksonmurphy
Registered User
Registered User
 
Posts: 7
Joined: March 15, 2011

Re: Pro Login Widget via PHP tag

Postby Jason Caldwell » March 18th, 2011, 7:56 pm

Thanks for reporting your experience with s2Member.
~ and thank you Cristián for bringing this to my attention.
jacksonmurphy wrote:Would it have anything to do with PHP settings on the server?
http://www.annawilson.com/test.php

To answer this question. No, I doubt that it has anything to do with PHP configuration.

I've just been over this entire thread and I took a quick look at your test page. I'm sorry, there's nothing jumping right out at me. Everything here looks as if it should be working. My "best guess" at this point, is that your test page is actually NOT using that Page Template you're working from. Is it possible that you have another Page Template that creates similar output; and thus, is creating some confusion?

If this problem continues, please send an email to support with a Dashboard login.
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Pro Login Widget via PHP tag

Postby jacksonmurphy » March 18th, 2011, 9:51 pm

Hey Jason
I appreciate you taking time to help solve my issue here...
I'll email support...

But to make sure that the test page is using the correct template, I put some text in the template...
Also added the Login Widget to the sidebar...

http://www.annawilson.com/pr-kit-test/

Code: Select all

<?php
/**
 * Template Name: Presskit-Test
 */
 
?>
 
 <?php get_header(); ?>



    <!-- The class "grid_7" restricts the div to 7 columns wide -->
    <div id="content" class="grid_10 prefix_1">

        <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <div class="post" id="post-<?php the_ID(); ?>">
        
            <div class="entry">
                
                This is Presskit-Test Template:<br /><br />
                
                The login widget should show up here:<br />
                
               <?php echo s2member_pro_login_widget(); ?>


            </div><!-- end entry -->
            
        </div><!-- end post -->
        
        <?php endwhile; endif; ?>
        <?php edit_post_link('Edit this entry.''<p>''</p>'); ?>
        <br />
    </div><!-- end content -->

    <div id="sidebar" class="grid_4">
    <?php
    
if ( ! dynamic_sidebar'press-widget' ) ) : ?>
    <?php endif; // end primary widget area ?><br />
    </div>


<?php get_footer(); ?>
User avatar
jacksonmurphy
Registered User
Registered User
 
Posts: 7
Joined: March 15, 2011

Re: Pro Login Widget via PHP tag

Postby Jason Caldwell » March 22nd, 2011, 11:03 pm

After an inspection of this bug in a live environment, we've discovered that the mysterious problem reported here, has to do with some versions of PHP not dealing with call_user_func_array() on a non-static member function. This is going to be corrected in the maintenance release of s2Member v3.5.6. Thanks for your assistance in this matter!
~ Jason Caldwell / Lead Developer
& Zeitgeist Movie Advocate: http://www.zeitgeistmovie.com/

Is the s2Member plugin working for you? Please rate s2Member at WordPress.org.
You'll need a WordPress.org account ( comes in handy ). Then rate s2Member here Image
.
User avatar
Jason Caldwell
Lead Developer
Lead Developer
 
Posts: 4045
Joined: May 3, 2010
Location: Georgia / USA

Re: Pro Login Widget via PHP tag

Postby jacksonmurphy » March 23rd, 2011, 7:00 am

Thanks for helping resolve this! I appreciate it
User avatar
jacksonmurphy
Registered User
Registered User
 
Posts: 7
Joined: March 15, 2011

Re: Pro Login Widget via PHP tag

Postby Cristián Lávaque » March 23rd, 2011, 7:22 pm

Thank you for helping find it! :)
Cristián Lávaque http://s2member.net
Is s2Member working for you? Please rate it Image at WordPress.org. Thanks! :)
User avatar
Cristián Lávaque
Developer
Developer
 
Posts: 6836
Joined: December 22, 2010


Return to s2Member Plugin

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 1 guest

cron