Archive for myfreeforum.org Before posting please check the "stickies" in the support forums.
Please ask questions in real English and not "txt". You will get a better response.
Please do not ask support questions via PMs.
 

The free forums are now under new ownership, a full announcement will be made shortly

       myfreeforum.org Forum Index -> Portal components
825th_Outlaw

Portal visible to logged in users only

I have added a portal on the left hand side, which I want to add a time zone clock (like the one you have on the howtodoit forum, but will ask that separately)

I followed this 'How to do it':
Code:
[b]To Make the portals appear on the left hand side of the index page you'll need to ADD this peice of code into your overall_header.tpl file AT THE BOTTOM[/b]

Code:
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td width="125" align="left" valign="top">
<!-- BEGIN switch_forum_view -->
<table><tr>
<td valign="top">
{MYFF.ANNOUNCE show_results="topics" link="FORUM"}{MYFF.STICKY show_results="topics" link="FORUM"}{MYFF.TOPPOSTERS}
</td></table>
<!-- END switch_forum_view -->
</td>
    <td valign="top" align="center">


[b]and the bit below needs to be ADDED into your overall_footer.tpl file AT THE TOP[/b]

Code:
</td>
</tr>
</table>



And it works fine. looks how I want it to etc.

Now, I have had several goes at adding the same code used to hide the calendar, so it eneded up looking like this:

Code:
overall_header.tpl file AT THE BOTTOM

Code:
[b]<!-- BEGIN switch_user_logged_in-->[/b]
portal here

<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr>
    <td width="125" align="left" valign="top">
<!-- BEGIN switch_forum_view -->
<table><tr>
<td valign="top">
{MYFF.ANNOUNCE show_results="topics" link="FORUM"}{MYFF.STICKY show_results="topics" link="FORUM"}{MYFF.TOPPOSTERS}
</td></table>
<!-- END switch_forum_view -->
</td>
    <td valign="top" align="center">
[b]<!-- END switch_user_logged_in-->[/b]




and the bit below needs to be ADDED into your overall_footer.tpl file AT THE TOP

Code:
[b]<!-- BEGIN switch_user_logged_in-->[/b]
</td>
</tr>
</table>
[b]<!-- END switch_user_logged_in-->
[/b]


Now, this KIND of worked, the portal did infact dissappear on logout, and my 'portal here' text showed when I logged in, so did a space where the portal SHOULD have been, but the portal itself didnt show.

I have tried putting the code spread over the two header & footer, that made a right mess ....

I have tried putting the code in different places. always showed a gap where it SHOULD have been, so the code seems to be showing the table structure of teh portal, just not the contents.

I do remember from a post i read whilst looking for the calendar solution, that nesting these commands doesnt always work, and I see there is a
Code:
<!-- BEGIN switch_forum_view -->
command in the middle of the header part of the code. Could this stop it working? why cant I nest the commands, they dont overlap, 'Switch Forum'  appears to operate fully within the bounds of 'switch user logged in'. Normally i can nest code as long as it never 'overlaps' (although we are talking 4gl database, not php)

So possibly the nesting of commands like this:

Code:
<!-- BEGIN switch_user_logged_in-->

      <!-- BEGIN switch_forum_view -->
              {MYFF.ANNOUNCE show_results="topics" link="FORUM"}{MYFF.STICKY show_results="topics" link="FORUM"}{MYFF.TOPPOSTERS}
      <!-- END switch_forum_view -->

<!-- END switch_user_logged_in-->

is causing the failure.

What do I need to do to get the desired result please ? If by nesting this way, it will never work, then thats also fine, will save me several more hours of trial and failure!

My forum Link, where you can see the last version before giving up and posting this
(This last version keeps the table gap, wether logged in or not)


regards

Paul
myff admin

You cannot nest switches. You can however nest:

<!-- S_USER_LEVEL != -1 -->

type statements.
825th_Outlaw

Hmm, ok, that makes sense.

But where do I find a list of the user level codes ?

I tried various things, assuming == -1 means equals user logged out.

Tried <> 0 , and > 0, but got the same results

If I use user_level == -1 then everything between that statement and the endif will only show if user logged out.

then I also assume > 0 (if valid argument iallows everything between that and the endif will show when any user_level higher than 0 is logged in ??

and yes, I did search for the user_level statement

regards

Paul
825th_Outlaw

Ok, added this:

Code:
<!-- IF S_USER_LEVEL > 0 -->



taken from another post (also added the endif )

when I log out, the portal dissappears as i want, but when I log in, the SPACE for the portal shows, but not the portal.

I have the above code in the right places on both header and footer.

What have i got wrong ??

Paul
myff admin

http://forum.myfreeforum.org/about7129.html&highlight=switch
825th_Outlaw

Thanks Admin

Oh, WOO HOO )) I got it working!

I studied the codes, and decided that what I had WAS right , but someting odd was going on ....


so ... I removed all traces of the portal, checked the forum was ok, added the portal back in to make sure it was visible logged in (and at the moment, also logged out)

I then re added the exact same code (s_uer_level > 0 ) in the same places, and it works! logged out, no portal, logged in , Portal shows on left!

I must have got a rougue bit of code in there somewhere.

Anyway, problem solved! I am very happy, and will now start on the next bit.

look out for more questions ...

Appreciate the help

Paul

The forum with/witout portal!

       myfreeforum.org Forum Index -> Portal components
Page 1 of 1
Create your own free forum | Buy a domain to use with your forum