ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Conditional statements related to Member_id in forums

June 15, 2011 3:35pm

Subscribe [3]
  • #1 / Jun 15, 2011 3:35pm

    focusfusion

    58 posts

    This question may be related to a resolved thread.

    Hello!  I’ve been plagued by a lot of people signing up to our forum who just want links or something.  They are human beings, but they are not genuinely interested in our site. 

    In order to save time, but also weed out useless members, we’ve set up a “Member2” category (Member_id == “9”).  When you register, you can self activate, and this gives you member 2 status.  Then you are free to go in and fix up your profile if you like.

    However, Member2’s don’t have posting privileges.  They can’t post in forums or post comments.  To do so, a Member2 needs to “upgrade” to Member 1st class (e.g., “Members”).  This is done by having a conversation with us, human to human.  Talking to the bouncer. 

    This information is available in the first email that goes out when people register (the activation instructions).  But I’m afraid people will just click the link, activate, and not read the whole thing. 

    Therefore, I’d like to have a notice on the forums to remind Member2’s that, in order to post, they just need to contact us for an upgrade. 

    I wanted to put in a conditional statement in the forums, perhaps in the top bar, something like:

    {if member_id =="9"}If you would like to post on the forums, <a href="http://link">contact us for an upgrade.</a>{/if}

    It seems that this syntax doesn’t work - the conditional is not recognized.  Do I have to wrap it in something else?

    Are there other approaches to this situation?  out of curiosity, of your 116K registered users, are a lot of them just linkseekers? 

    Thanks for your help!

  • #2 / Jun 15, 2011 3:54pm

    focusfusion

    58 posts

    Also, perhaps there is a way to add this info to the bottom of the forum page.

    In addition to “Newest Members” - we’d have “Recently upgraded members” - and a conditional that lets us exclude “Member2”‘s.  Of course, we’d need to add something to the forum_lang.php file

    'upgraded_members' =>
    'Recently Upgraded Members:',

    as well as to some other template….

  • #3 / Jun 15, 2011 4:12pm

    Kernon

    173 posts

    Did you mean ‘group_id’ instead of ‘member_id’ (in your conditional)?

  • #4 / Jun 15, 2011 4:34pm

    focusfusion

    58 posts

    I tried it both ways.  Here, let me try again.

    Yep.  It just shows up.  Note I’m putting this inside the Top bar.html file:

    <div id='topBar'>
    <div class='topBarLinks'>
    
    {if logged_in}
        {lang:logged_in_as}  <b>{screen_name}</b>
        {include:top_bar_spacer}
        <a href="http://{path:your_profile}">{lang:your_profile}</a>
        {include:top_bar_spacer}
        <a href="http://{path:your_control_panel}">{lang:your_control_panel}</a>
        {include:top_bar_spacer}
        <a href="http://{path:memberlist}">{lang:memberlist}</a>
        {include:top_bar_spacer}
        <a href="http://{path:logout}">{lang:logout}</a>
    {if group_id=="9"}yowza{/if}
    
    {/if}
    
    </div>
    </div>
  • #5 / Jun 15, 2011 5:33pm

    Kernon

    173 posts

    Sorry, but what do you mean by “It just shows up”—is it working now?

  • #6 / Jun 16, 2011 7:27am

    John Henry Donovan

    12339 posts

    focusfusion,

    You could just use an announcement category and Forum. You can set any Forum or Category to be viewed only by certain member groups. Would that help?

  • #7 / Jun 16, 2011 9:31am

    focusfusion

    58 posts

    Sorry, but what do you mean by “It just shows up”—is it working now?

    The text, including the curly bracket and everything, shows up/is visible in the forum header. 

    I took it out again, pending proper language.

  • #8 / Jun 16, 2011 9:35am

    Kernon

    173 posts

    I was thinking that maybe you might try a conditional with something like “can_post”.  If they are logged in but can’t post, then they are (probably?) in the group that needs upgrading—- no?

    {if can_post}
    {if:else}
    If you would like to post on the forums, <a href="http://link">contact us for an upgrade.</a>
    {/if}

    I wonder if the forum template parser doesn’t have the full power of the regular template parser because I haven’t seen the ELSE construct used.

    If the above doesn’t work, then I suppose you could always resort to turning PHP on in your templates, which would obviously involve more effort to get the group ID, etc.

  • #9 / Jun 16, 2011 10:13am

    focusfusion

    58 posts

    focusfusion,

    You could just use an announcement category and Forum. You can set any Forum or Category to be viewed only by certain member groups. Would that help?

    That’s interesting.  So, by registering, suddenly they would go from seeing the forums, as anybody can, to seeing nothing but an announcement that they need to upgrade. 

    Or, I see what you’re saying.  Value added - an extra forum that just they can see, at the top of the forums.  OK.  I’ll add that.  It’s a practical workaround.

    Still wonder what kind of conditional statements I can add to the forums out of curiosity.

  • #10 / Jun 16, 2011 10:17am

    focusfusion

    58 posts

    I was thinking that maybe you might try a conditional with something like “can_post”.  If they are logged in but can’t post, then they are (probably?) in the group that needs upgrading—- no?

    Thanks!  But alas, that also doesn’t work.  The curly brackets and everything appear on the rendered page. 

    If the above doesn’t work, then I suppose you could always resort to turning PHP on in your templates, which would obviously involve more effort to get the group ID, etc.

    Well, we’re out of my depth.  I’ll stick with the “visible only to this class of members” forum announcement, and hope for the best.

    Thanks for your help!

    If anyone has more info on conditional statements in forums, add a link to this thread! 

    Thanks again all!  You’re the best.

  • #11 / Jun 17, 2011 12:28pm

    Kevin Smith

    4784 posts

    Hey focusfusion–

    I’ll leave this thread open for a bit to allow anyone else to offer some suggestions.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases