RSS Feed/News Need to detect node or page

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,648
Points
823

Reputation:

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

Continue reading...
 
Status
Not open for further replies.
Top