Template Modifcations

  • That IS WCF built-in code.


    No, you got the syntax slightly off by closing the if-block prematurely. Putting it together you'd get:

    Code
    {assign var=groupIDs value= "1"|explode}
    {if $__wcf->getUser()->getGroupIDs()|in_array:$groupIDs}
    You're seeing this because you're a member of a particular usergroup
    {else}
    Nope :(
    {/if}

    You only need to assign once to fetch the values, there is no point in repeating it.

    Sadly this is not working. :( I wrapped the whole template usersOnlineList .... No change.

  • Group 1 should be everyone, so this makes no sens if you would like to limit the visibility...

    I used group #4. Group #4 should see everything, but everyone else (using the else statement), should see the error message.

  • The whole code I used was... (mind the note, for shortness)


  • Try this one:

  • Try this one:


    Sorry, no dice (Did not work)

  • well, catching the whole template wont be a really good idea, so put in after line 97 only {if 4|in_array:$__wcf->user->getGroupIDs()} (befor {foreach from=$objects item=user}) and then in line 183 after {/foreach} the rest:


    Code
    {else}
    <p class="error">
    Access denied. You’re not authorized to view this page.
    </p>
    {/if}
  • well, catching the whole template wont be a really good idea, so put in after line 97 only {if 4|in_array:$__wcf->user->getGroupIDs()} (befor {foreach from=$objects item=user}) and then in line 183 after {/foreach} the rest:


    Code
    {else}
    <p class="error">
    Access denied. You’re not authorized to view this page.
    </p>
    {/if}

    Sorry. Thanks for trying. But that did not work either.

  • Let's recap...

    • Create template groups (default template as parent, only option)
    • Search for desired template
    • Copy template and assign to previously created template group
    • Make desired edit
    • Save
  • 6. Go to your style and apply the template group to it

    Error.


  • Please attach your current template here :)

    I took the original template usersOnlineList and copied it to a template group I call, extra (simple enough, right?)


    Then I followed @Morik helpful instructions here
    Template Modifcations


    Although he was a bit off by the number lines (for example, he said line 97, turned out to be 98). But that's not a big deal. I lose count sometimes too. I applied my changes and end up with this (see code).



  • No, you ignored the line numbers...


  • I took the original template usersOnlineList and copied it to a template group I call, extra (simple enough, right?)
    Then I followed @Morik helpful instructions here
    Template Modifcations


    Although he was a bit off by the number lines (for example, he said line 97, turned out to be 98). But that's not a big deal. I lose count sometimes too. I applied my changes and end up with this (see code).





    I just discovered a flaw in that.... That places the ELSE before the IF so, ya... Not valid... Switching them around also does not work.

  • Yes, 1 or 2 lines are a thing, but you put the else statement about 100 lines above the suggested position...

  • Yes, 1 or 2 lines are a thing, but you put the else statement about 100 lines above the suggested position...

    This is true... I placed them where you told me to place them


    well, catching the whole template wont be a really good idea, so put in after line 97 only {if 4|in_array:$__wcf->user->getGroupIDs()} (befor {foreach from=$objects item=user}) and then in line 183 after {/foreach} the rest:



    Code
    {else}
    <p class="error">
    Access denied. You’re not authorized to view this page.
    </p>
    {/if}


    Which turned out to be the incorrect order. However, even when swapping the order... It still did not work.

  • No, the Order was absolutly fine, you just ignored the line number for the second part.
    I told you to place it in line 183 and you put it to line 80 which is far away from the correct position.
    look at my template i'll postet befor:
    Template Modifcations

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!