[RSS Feed/News] Need to detect node or page

Status
Not open for further replies.

XenForo

Administrative
  • Thread starter
  • Admin
  • #1
I've been using this code for a long time now and it works great:
Code:

Code:
$fileDir = '/path/to/public_html';

require($fileDir.'/src/XF.php' );
\XF::start($fileDir);

$app = \XF::setupApp('XF\Pub\App');
$app->start();

$visitor = \XF::visitor();

$user_id = $visitor['user_id'];

When I have my own custom page I use this code to fetch the $user_id but is there a way to check if the page itself is a node or a page? Because if it's a node then it fails because of this code:

Code:

$fileDir =...

Read more
Read more about this Feed . . .
 
Status
Not open for further replies.
Back
Top Bottom