Community Support Forums — WordPress® ( Users Helping Users ) — 2011-03-01T12:14:15-05:00 http://www.primothemes.com/forums/feed.php?f=4&t=2411 2011-03-01T12:14:15-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2411&p=7268#p7268 <![CDATA[Re: Dynamic CCAP]]>
Code:
<?php if (current_user_can("access_s2member_level1")){ ?>

    Some premium content for all Level 1 Members.

    <?php if (current_user_can("access_s2member_ccap_" S2MEMBER_CURRENT_USER_LOGIN)){ ?>

        <?php while (have_posts()) : the_post(); ?>

        <div id="post-<?php the_ID(); ?><?php post_class(); ?>>
        <div class="post-header">
        <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
        <p>by <?php the_author(); ?> on <?php the_time('F j, Y'?></p>
        </div>

        <?php the_excerpt(); ?>

        <div class="post-meta">
        <ul>
        <li><?php comments_popup_link('Leave your comment''One comment''% comments'); ?><?php the_tags(' &bull; Tagged as: '', '''); ?></li>
        <li>Share on <a href="http://twitter.com/home?status=Currently reading: <?php the_title_attribute(); ?> <?php the_permalink(); ?>">Twitter</a>, <a href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&amp;t=<?php the_title_attribute(); ?>">Facebook</a>, <a href="http://del.icio.us/post?v=4;url=<?php the_permalink(); ?>">Delicious</a>, <a href="http://digg.com/submit?url=<?php the_permalink(); ?>">Digg</a>, <a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title_attribute(); ?>">Reddit</a></li>
        <?php edit_post_link('Edit this post''<li>''</li>'); ?>
        </ul>
        </div>
        </div>

        <?php endwhile; ?>

    <?php ?>

    <?php if (current_user_can("access_s2member_ccap_videos")){ ?>
        Display videos as well.
    <?php ?>

<?php } else { ?>
    Some public content.
<?php ?>

Statistics: Posted by Cristián Lávaque — March 1st, 2011, 12:14 pm


]]>
2011-03-01T04:21:20-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2411&p=7261#p7261 <![CDATA[Re: Dynamic CCAP]]>
Code:
<?php if (current_user_can("access_s2member_level1")){ ?>

Some premium content for all Level 1 Members.

<?php if (current_user_can("access_s2member_ccap_" . S2MEMBER_CURRENT_USER_LOGIN)){ ?>
Display links for music as well.
<?php } ?>

<?php if (current_user_can("access_s2member_ccap_videos")){ ?>
Display videos as well.
<?php } ?>

<?php } else { ?>
Some public content.
<?php } ?>


Now. Instead of static text like

Display links for music as well
i'd like to insert some wp queries like

Code:
<?php while (have_posts()) : the_post(); ?>

<div id="post-<?php the_ID(); ?><?php post_class(); ?>>
<div class="post-header">
<h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<p>by <?php the_author(); ?> on <?php the_time('F j, Y') ?></p>
</div>

<?php the_excerpt(); ?>

<div class="post-meta">
<ul>
<li><?php comments_popup_link('Leave your comment', 'One comment', '% comments'); ?><?php the_tags(' &bull; Tagged as: ', ', ', ''); ?></li>
<li>Share on <a href="http://twitter.com/home?status=Currently reading: <?php the_title_attribute(); ?> <?php the_permalink(); ?>">Twitter</a>, <a href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&amp;t=<?php the_title_attribute(); ?>">Facebook</a>, <a href="http://del.icio.us/post?v=4;url=<?php the_permalink(); ?>">Delicious</a>, <a href="http://digg.com/submit?url=<?php the_permalink(); ?>">Digg</a>, <a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title_attribute(); ?>">Reddit</a></li>
<?php edit_post_link('Edit this post', '<li>', '</li>'); ?>
</ul>


Unfortunately i can't get this to work.

any idea? thank you so much! flo

Statistics: Posted by flxmeister — March 1st, 2011, 4:21 am


]]>
2011-02-22T17:21:10-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2411&p=7041#p7041 <![CDATA[Re: Dynamic CCAP]]>
Hmm... could you explain what you want to insert where? I'm not sure I understand what you're asking.

Try wrapping code blocks with the code tags to make them easier to read. ;)

[code=php]Your code goes here. [/code]

Statistics: Posted by Cristián Lávaque — February 22nd, 2011, 5:21 pm


]]>
2011-02-22T17:09:14-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2411&p=7039#p7039 <![CDATA[Re: Dynamic CCAP]]>
Code:
<?php if (current_user_can("access_s2member_level1")){ ?>
             
             Some premium content for all Level 1 Members.
         
             <?php if (current_user_can("access_s2member_ccap_" . S2MEMBER_CURRENT_USER_LOGIN)){ ?>
                 Display links for music as well. 
             <?php } ?>
             
             <?php if (current_user_can("access_s2member_ccap_videos")){ ?>
                 Display videos as well.
             <?php } ?>
         
         <?php } else { ?>
             Some public content.
         <?php } ?>


but instead of showing a static text line i'd like to insert a query. doenst work ;( any idea what is wrong by simply inserting

Code:
<?php while (have_posts()) : the_post(); ?>
            
        <div id="post-<?php the_ID(); ?><?php post_class(); ?>>
            <div class="post-header">
                <h3><a href="<?php the_permalink(); ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
                <p>by <?php the_author(); ?> on <?php the_time('F j, Y') ?></p>
            </div>
            
            <?php the_excerpt(); ?>
            
            <div class="post-meta">
                <ul>
                    <li><?php comments_popup_link('Leave your comment', 'One comment', '% comments'); ?><?php the_tags(' &bull; Tagged as: ', ', ', ''); ?></li>
                    <li>Share on <a href="http://twitter.com/home?status=Currently reading: <?php the_title_attribute(); ?> <?php the_permalink(); ?>">Twitter</a>, <a href="http://www.facebook.com/share.php?u=<?php the_permalink(); ?>&amp;t=<?php the_title_attribute(); ?>">Facebook</a>, <a href="http://del.icio.us/post?v=4;url=<?php the_permalink(); ?>">Delicious</a>, <a href="http://digg.com/submit?url=<?php the_permalink(); ?>">Digg</a>, <a href="http://www.reddit.com/submit?url=<?php the_permalink(); ?>&amp;title=<?php the_title_attribute(); ?>">Reddit</a></li>
                    <?php edit_post_link('Edit this post', '<li>', '</li>'); ?>
                </ul>
            </div>
        </div>

        <?php endwhile; ?>
        
        <?php if (show_posts_nav()) : ?>
        
        <div class="post-navigation">
            <ul>
                <li><?php next_posts_link('&laquo; Previous page') ?></li>
                <li><?php previous_posts_link('Next page &raquo;') ?></li>
            </ul>
        </div>
        
        <?php endif; ?>
        
    <?php else : ?>

    <h2 class="page-title">Nothing found</h2>
    <p>There are not posts belonging to this category or tag. Try searching below:</p>
    <?php get_search_form(); ?>
    
    <?php endif; ?>


insetad of static text? thanks!

Statistics: Posted by flxmeister — February 22nd, 2011, 5:09 pm


]]>
2011-02-21T11:42:31-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2411&p=6990#p6990 <![CDATA[Re: Dynamic CCAP]]>
Code:
'access_s2member_ccap_' . S2MEMBER_CURRENT_USER_LOGIN

Statistics: Posted by Cristián Lávaque — February 21st, 2011, 11:42 am


]]>
2011-02-20T12:03:53-05:00 http://www.primothemes.com/forums/viewtopic.php?t=2411&p=6939#p6939 <![CDATA[Dynamic CCAP]]>
i need to make the ccap query dynamic. instead of having the static

<?php if (current_user_can("access_s2member_ccap_xyz")){ ?>


i need something like

<?php if (current_user_can("access_s2member_ccap_USERNAME")){ ?>

i do not know how to integrate the <?php echo S2MEMBER_CURRENT_USER_LOGIN; ?> query.

anyone any ideas? thanks for your help!


flo

Statistics: Posted by flxmeister — February 20th, 2011, 12:03 pm


]]>