1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Moving user group with user upgrades?

Discussion in 'XenForo Questions and Support' started by danielwerner, Jun 19, 2013.

  1. danielwerner

    danielwerner Active Member

    I'm having a bit of trouble with my user upgrades. I know that the user groups are cumulative, but what about if I want to remove something for the paying users?

    I'm using http://xenforo.com/community/resources/bd-rotating-ads.292/ as a banner system, and I want members to be able to pay a small sum to remove the banners. But this doesn't work since when they pay, they will still be both in the Registered user group, and the new "Paying users" user group.

    Can I remove something for a user group, or move user group altogether when that user pays? How? Wouldn't be so fun to manually move them every time.

    Thanks!
     
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    That addon doesn't have adequate permissions to do what you want.

    I assume that addon uses a template hook. If you can find the hook or the relevant template for the ad then you can use template conditions:

    http://xenforo.com/community/threads/usergroup-checking-in-the-templates.9447/

    This will exclude members of the specified group:

    Code:
    <xen:if is="!{xen:helper ismemberof, $visitor, 4}">
    
    </xen:if>
    
     
  3. danielwerner

    danielwerner Active Member

    Hmm, but will the exclusion have higher priority than the fact that the user will still be in the registered-group?

    I tried adding the above tags, and it looks like this:

    Code:
    <xen:if is="!{xen:helper ismemberof, $visitor, 5}">
    <xen:set var="$messageContentAfterTemplate"><xen:hook name="ad_special_second_post"/></xen:set>
    
    <xen:if is="{$messageContentAfterTemplate}">
        <xen:include template="message">
            <xen:map from="$post" to="$message" />
        </xen:include>
    </xen:if>
    </xen:if>
    Still doesn't work I'm afraid. :( Will two xen:if's work btw? I tried setting only one to <xen:if is="{$messageContentAfterTemplate} AND !{xen:helper ismemberof, $visitor, 5}"> but that didn't work either.
     
  4. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Yes.

    Surely you only want that condition to be around the ad hook and not around the entire message template.
     
  5. danielwerner

    danielwerner Active Member

    Sorry, I don't understand this. I'm a designer, not a coder. :) This is what all of the rotating_ads code looks like. Am I supposed to put the conditionals around one of those hooks? Or is there a hook in some kind of thread-template? Searched for anything with the rotating_ads hooks, but found nothing. Would appreciate a bit of help here. Thanks in advance!

    Code:
    <xen:require css="message.css" />
    <xen:require css="bb_code.css" />
    
    <li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_admin} OR {$message.is_moderator}', 'staff'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
        <xen:include template="message_user_info">
            <xen:map from="$message" to="$user" />
        </xen:include>
        <div class="messageInfo primaryContent">
            <xen:if is="{$message.isNew}"><strong class="newIndicator"><span></span>{xen:phrase new}</strong></xen:if>
           
            <xen:if hascontent="true">
                <ul class="messageNotices">
                    <xen:contentcheck>
                        <xen:hook name="message_notices" params="{xen:array 'message={$message}'}">
                            <xen:if is="{$message.warning_message}">
                                <li class="warningNotice"><span class="icon Tooltip" title="{xen:phrase warning}" data-tipclass="iconTip flipped"></span>{$message.warning_message}</li>
                            </xen:if>
                            <xen:if is="{$message.isDeleted}">
                                <li class="deletedNotice"><span class="icon Tooltip" title="{xen:phrase deleted}" data-tipclass="iconTip flipped"></span>{xen:phrase this_message_has_been_removed_from_public_view}</li>
                            <xen:elseif is="{$message.isModerated}" />
                                <li class="moderatedNotice"><span class="icon Tooltip" title="{xen:phrase awaiting_moderation}" data-tipclass="iconTip flipped"></span>{xen:phrase this_message_is_awaiting_moderator_approval_and_is_invisible_to_normal}</li>
                            </xen:if>
                            <xen:if is="{$message.isIgnored}">
                                <li>{xen:phrase you_are_ignoring_content_by_this_member} <a href="javascript:" class="jsOnly DisplayIgnoredContent">{xen:phrase show_ignored_content}</a></li>
                            </xen:if>
                        </xen:hook>
                    </xen:contentcheck>
                </ul>
            </xen:if>
           
            <xen:hook name="message_content" params="{xen:array 'message={$message}'}">
            <div class="messageContent">       
                <article>
                    <blockquote class="messageText ugc baseHtml{xen:if $message.isIgnored, ' ignored'}">
                        <xen:include template="ad_message_body" />
                        {xen:raw $message.messageHtml}
                    </blockquote>
                </article>
               
                {xen:raw $messageContentAfterTemplate}
            </div>
            </xen:hook>
           
           
            <xen:if is="{$visitor.content_show_signature} && {$message.signature}">
                <div class="baseHtml signature ugc{xen:if $message.isIgnored, ' ignored'}"><aside>{xen:raw $message.signatureHtml}</aside></div>
            </xen:if>
           
            {xen:raw $messageAfterTemplate}
           
            <div id="likes-{$messageId}"><xen:if is="{$message.likes}"><xen:include template="likes_summary" /></xen:if></div>
        </div>
        <xen:hook name="message_below" params="{xen:array 'post={$message}','message_id={$messageId}'}" />
       
        <xen:include template="ad_message_below" />
       
    </li>
     
  6. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    To be able to use a template condition you need to find the relevant template hook or other template code that represents the ad. I don't have that information. Perhaps the author of the addon can help you.
     
  7. danielwerner

    danielwerner Active Member

    Thanks! I've posted the question in the addon-thread. If anyone knows, please help. :)
     

Share This Page