Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Sign In
Not a member yet? Click here to register.

Add User Panel information to Theme Header


Print Track
I'm trying to add some of the data from the user_info_panel.php file to the theme.php file for my custom theme.

When I attempt to achieve this and call:

$userdata['user_name']


Nothing appears. I assume I need to include maincore but I don't know how to include it from theme.php in my theme directory as I don't know the directory?

7 replies

Put echo in front of it
Yes mate, I've echo'd it. The string is empty.
Are you logged in? Else the userdata is empty.
Yes I'm logged in, the following if statement recognises that the user is logged in...

if (iMEMBER) {


but the string

$userdata['user_name']


is empty.

Do you know how to include maincore from the theme.php file??
The maincore is already included otherwise there would be no iMEMBER constant.

I tested if i add a statement echo $userdata['user_name']; it displays my logon name.
Can you put the statement in an panel or something for testing?
It works in a panel, but I don't want it in a panel I want to be in the header so it's included on every page. Is there somewhere else I could put the code that isn't in the theme.php file?

Merged on Mar 18 2018 at 11:41:44:
Oh wow, I feel dumb.

Just had to

global $userdata;


at the beginning of the function. Doh'
You will never forget that:)
author superchiefchief
forumContent Administration - 8
replies8 posts
viewed1,186 times
activeLast updated on 1 year ago

Related

Logon without Logon Panel?
Started by
N
NealWalters - 7 posts
Added new panel name shows "name"
Started by
K
kevin_h - 3 posts
Custom page on a Custom Panel
Started by
M
mmccoy - 7 posts

Hot Questions

noob
SEO url rewrite
noob - 19 posts
M
How to add my site at google?
Memberz - 31 posts
T
Admin Panel
tris_hill - 10 posts
atmalikasanli
How to remove copyright?
atmalikasanli - 9 posts
A
Remove News Panel?
atom6 - 13 posts
You can view all discussion threads in this forum.
You cannot set up a bounty in this discussion thread.
You can start a new discussion thread in this forum.
You cannot reply in this discussion thread.
You cannot start on a poll in this forum.
You cannot upload attachments in this forum.
You can download attachments in this forum.
You cannot up or down-vote on the post in this discussion thread.
Users who participated in discussion: douwe_yntema, superchiefchief