1.0.3 Don't show listings until user login

Discussion in 'General Support' started by kidkal, Apr 26, 2012.

  1. kidkal

    kidkal New Member

    Joined:
    Apr 26, 2012
    Messages:
    2
    Likes Received:
    0
    Hi,

    Is it possible to make WeBid not show items in auction until the user logs in?

    So the "Home" tab would only show the login and password dialog boxes, same as "Sell an Item" and "Message Board" tabs.

    Thanks!
     
  2. Box Lot

    Box Lot Super Moderator Staff Member Developer

    Joined:
    Dec 18, 2008
    Messages:
    2,561
    Likes Received:
    134
    'B_LOGGED_IN' => $user->logged_in
    is defined in header.php so you can use that.

    <!-- IF B_LOGGED_IN eq false-->
    what you want to show those not logged in
    <!-- ELSE -->
    what you want to show to those who ARE logged in
    <!-- ENDIF -->
     
  3. kidkal

    kidkal New Member

    Joined:
    Apr 26, 2012
    Messages:
    2
    Likes Received:
    0
    Solved

    Hi,

    After digging around for a while I added the clause to index.php, in similar spot to msgboard.php.

    Code:
    // Is the seller logged in?
    if (!$user->is_logged_in())
    {
            $_SESSION['REDIRECT_AFTER_LOGIN'] = 'index.php';
            header('location: user_login.php');
            exit;
    }
    Your suggestion misled me a bit but gave me the hint that I needed to do the digging (there's no settings for this option).

    Thanks.
     
    Last edited: Apr 27, 2012
  4. nay27uk

    nay27uk Super Moderator Staff Member

    Joined:
    Nov 24, 2009
    Messages:
    4,200
    Likes Received:
    312
    What boxlot was saying is in your .tpl all you needed to do was add

    PHP:
    <!-- IF B_LOGGED_IN --> 
    show this 
    <!-- ELSE --> 
    dont show this 
    <!-- ENDIF --> 
    where show this is the html you want displayed if they are loged in, and the dont show this is what is shown if they are not loged in.

    For example

    PHP:
    <!-- IF B_LOGGED_IN -->
    <
    li><a href="{SITEURL}user_menu.php?">{L_622}</a></li>
    <
    li><a href="{SSLURL}logout.php?">{L_245}</a></li>
    <!-- ELSE -->
    <
    li><a href="{SSLURL}register.php?">{L_235}</a></li>
    <
    li><a href="{SSLURL}user_login.php?">{L_052}</a></li>
    <!-- ENDIF -->
     
    Last edited: Apr 27, 2012

Share This Page