The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I have a question about this line
#1
Hi, I have a question about this line
PHP Code:
<?php if(isset($user) && $user->isLoggedIn()){ } ?>
is only found in the index.php of the root of the site. My question is whether I should keep that line alone there or should I incorporate it into my other custom pages?
  Reply
#2
You can use wherever you want to manipulate page content depending on wether the user is logged in or not,
Code:
<?php if(isset($user) && $user->isLoggedIn()){ ?><P>You are logged in</p>
<?php }else{ ?>
<p>Not logged in</p>
<?php }?>

or to manage access to pages. I usually use the admin dashboard for that though.
It's very flexible really, but The only lines that you have to include in custom pages are:


Code:
<?php require_once 'PATH/TO/init.php'; ?>
<?php require_once $abs_us_root.$us_url_root.'users/includes/header.php'; ?>
<?php require_once $abs_us_root.$us_url_root.'users/includes/navigation.php'; ?>
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)