Page 2 of 2

Re: Call separate header.txt admin

Posted: Fri Aug 10, 2012 4:36 pm
by steve
This may be a silly question, are you sure you are logging into an ADMIN account?

Re: Call separate header.txt admin

Posted: Fri Aug 10, 2012 4:37 pm
by D12Eminem989
Yes, it's the only account there is. :lol:

Re: Call separate header.txt admin

Posted: Fri Aug 10, 2012 4:46 pm
by Klemen
Care to share your help desk URL so we can check situation live?

Re: Call separate header.txt admin

Posted: Fri Aug 10, 2012 4:58 pm
by steve
I tired this and it did not work for me either.

Code: Select all

if (strpos(__FILE__, 'admin') !== false)
{
   include(HESK_PATH . 'header_admin.txt');
}
else
{
   include(HESK_PATH . 'header.txt');
}
So I used this instead and it worked.

Code: Select all

    if ($_SESSION['isadmin'])
    {
       include(HESK_PATH . 'header_admin.txt');
    }
    else
    {
       include(HESK_PATH . 'header.txt');
    }

Re: Call separate header.txt admin

Posted: Fri Aug 10, 2012 6:16 pm
by Klemen
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:

Code: Select all

if (strpos($_SERVER['SCRIPT_FILENAME'], 'admin') !== false)
{
    include(HESK_PATH . 'header_admin.txt');
}
else
{
    include(HESK_PATH . 'header.txt');
}

Re: Call separate header.txt admin

Posted: Sat Aug 11, 2012 2:12 am
by D12Eminem989
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!

Re: Call separate header.txt admin

Posted: Sat Aug 11, 2012 8:32 am
by Klemen
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:

Code: Select all

<?php
if (strpos($_SERVER['SCRIPT_FILENAME'], 'admin') !== false)
{
    include(HESK_PATH . 'header_admin.txt');
}
else
{
    include(HESK_PATH . 'header_customer.txt');
}
?>
User original footer.inc.php and paste THIS into footer.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');
}
?>

Re: Call separate header.txt admin

Posted: Sat Aug 11, 2012 10:32 am
by D12Eminem989
Thank you Klemen, that worked perfectly - much appreciated!