Zikula: A Flexible Open Source Content Management System
home | forum | international support | contact us

Support Forum

Start ::  PostNuke 0.7 Support ::  XTE Support ::  Find out if user isloggedin

Moderated by: Support Team

Bottom
Find out if user isloggedin

  • Link to this postingPosted: 19.03.2004, 03:36
    Profile Homepage
    aperevolution
    rank:
    Freshman Freshman
    registered:
     January 2004
    Status:
    offline
    last visit:
    20.03.04
    Posts:
    11
    I tried using the $isloggedin variable in the theme to display info according to the logged in status. No luck.

    I want to show the login box when not logged in and a submit news link in its place when they are logged in.
  • Link to this postingPosted: 19.03.2004, 12:47
    Profile Homepage
    Simon
    rank:
    Steering Committee Steering Committee
    registered:
     December 2002
    Status:
    offline
    last visit:
    01.09.08
    Posts:
    13408
    if (pnUserLoggedIn())


    ?

    See the pnAPI reference (look left!)

    -----
    Regards,
    Simon

    itbegins.co.uk - Zikula Consulting

    Please read the Support Guide
  • Link to this postingPosted: 20.03.2004, 07:16
    Profile Homepage
    aperevolution
    rank:
    Freshman Freshman
    registered:
     January 2004
    Status:
    offline
    last visit:
    20.03.04
    Posts:
    11
    Thats exactly how I did it with AutoTheme but I can't find a way to escape the theme and use PHP so it just puts it in as text.
  • Link to this postingPosted: 20.03.2004, 09:00
    Profile Homepage
    phpnut
    rank:
    Developer Developer
    registered:
     October 2002
    Status:
    offline
    last visit:
    24.03.06
    Posts:
    269
    Try this

    Code
    <!--[PHP]-->
    Your code.
    <!--[/PHP]-->


    You could also write a custom plugin and put it in Xanthia/pluggins.

    Use the function.greetings.php or the function.user.php as a example.
    -----
    Larry E. Masters
  • Link to this postingPosted: 20.03.2004, 10:09
    Profile Homepage
    aperevolution
    rank:
    Freshman Freshman
    registered:
     January 2004
    Status:
    offline
    last visit:
    20.03.04
    Posts:
    11
    I got this error when I tried. did you make that tag up?

    Fatal error: Smarty error: [in userdb:p3m_x/master.htm line 12]: [plugin] unknown tag - 'PHP' (core.load_plugins.php, line 118) in /home/project3/www/www/pn/includes/classes/Smarty/Smarty.class.php on line 1883
  • Link to this postingPosted: 20.03.2004, 13:55
    Profile Homepage
    phpnut
    rank:
    Developer Developer
    registered:
     October 2002
    Status:
    offline
    last visit:
    24.03.06
    Posts:
    269
    No I did not make up that tag. I made a mistake.

    Should be lower case.

    Code
    <!--[php]-->
    Your code.
    <!--[/php]-->

    -----
    Larry E. Masters
  • Link to this postingPosted: 20.03.2004, 21:53
    Profile Homepage
    Landseer
    rank:
    Steering Committee Steering Committee
    registered:
     January 2003
    Status:
    offline
    last visit:
    21.08.08
    Posts:
    846
    You can also do this:

    Code
    <!--[ pnsessiongetvar name=uid assign=uid ]-->


    This assigns the users uid to $uid. Now you can check with

    Code
    <!--[ if $uid<>"" ]-->
        You are logged in. Your name is <!--[ pnusergetvar name=uname ]-->.
    <!--[ else ]-->
        You are not logged in.
    <!--[ /if ]-->


    Works fine in my Xanthia themes.

    Frank

Start ::  PostNuke 0.7 Support ::  XTE Support ::  Find out if user isloggedin

Main Menu

Extensions Database

Documentation

Development

Login





 


 Log in Problems?
 New User? Sign Up!

Donate to Zikula