Call separate header.txt admin
Moderator: mkoch227
Re: Call separate header.txt admin
This may be a silly question, are you sure you are logging into an ADMIN account?
-Steve
-
- Posts: 12
- Joined: Fri Aug 10, 2012 12:28 pm
Re: Call separate header.txt admin
Yes, it's the only account there is. 

Re: Call separate header.txt admin
Care to share your help desk URL so we can check situation live?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Re: Call separate header.txt admin
I tired this and it did not work for me either.
So I used this instead and it worked.
Code: Select all
if (strpos(__FILE__, 'admin') !== false)
{
include(HESK_PATH . 'header_admin.txt');
}
else
{
include(HESK_PATH . 'header.txt');
}
Code: Select all
if ($_SESSION['isadmin'])
{
include(HESK_PATH . 'header_admin.txt');
}
else
{
include(HESK_PATH . 'header.txt');
}
-Steve
Re: Call separate header.txt admin
I wouldn't recommend using $_SESSION as it is still set even if you browse customer pages.
Try this. If this doesn't work I must say I'm out of ideas lol:
Try this. If this doesn't work I must say I'm out of ideas lol:
Code: Select all
if (strpos($_SERVER['SCRIPT_FILENAME'], 'admin') !== false)
{
include(HESK_PATH . 'header_admin.txt');
}
else
{
include(HESK_PATH . 'header.txt');
}
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 12
- Joined: Fri Aug 10, 2012 12:28 pm
Re: Call separate header.txt admin
Thanks for the help guys and Klemen, that last code you posted worked. Thanks a ton, it's much appreciated. 
Is it possible for you to edit the footer.inc.php for me and include the above but a footer_admin.txt, then attach it here? I am not licensed so I can't edit it myself.
Thank you!

Is it possible for you to edit the footer.inc.php for me and include the above but a footer_admin.txt, then attach it here? I am not licensed so I can't edit it myself.
Thank you!
Re: Call separate header.txt admin
Actually, I have an even better idea that doesn't require editing any files and will be compatible with updates!
Use original header.inc.php and files and paste THIS into header.txt:
User original footer.inc.php and paste THIS into footer.txt:
Use original header.inc.php and files and paste THIS into header.txt:
Code: Select all
<?php
if (strpos($_SERVER['SCRIPT_FILENAME'], 'admin') !== false)
{
include(HESK_PATH . 'header_admin.txt');
}
else
{
include(HESK_PATH . 'header_customer.txt');
}
?>
Code: Select all
<?php
if (strpos($_SERVER['SCRIPT_FILENAME'], 'admin') !== false)
{
include(HESK_PATH . 'footer_admin.txt');
}
else
{
include(HESK_PATH . 'footer_customer.txt');
}
?>
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
You should follow me on Twitter here
Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools


Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...
Also browse for php hosting companies, read php books, find php resources and use webmaster tools
-
- Posts: 12
- Joined: Fri Aug 10, 2012 12:28 pm
Re: Call separate header.txt admin
Thank you Klemen, that worked perfectly - much appreciated!