Remove Header and Footer from Admin
Moderator: mkoch227
Remove Header and Footer from Admin
Script URL: www.pianowizardacademy.com/helpdesk
Version of script: 2.65
What terms did you try when SEARCHING for a solution: header,footer
Write your message below:
I have header and footer txts on main support site. It would be great to have the header and footer not appear in admin to reduce clutter.
Is that possible?
thanks
Version of script: 2.65
What terms did you try when SEARCHING for a solution: header,footer
Write your message below:
I have header and footer txts on main support site. It would be great to have the header and footer not appear in admin to reduce clutter.
Is that possible?
thanks
Re: Remove Header and Footer from Admin
You just need a way of detecting if a page is located in the "admin" folder.
For example, at the top of inc/header.inc.php (just below the if (!defined ....) line) add something like
Then check if $admin_panel variable is true to perform action, for example change to
This second part needs to be done in the footer.inc.php file too.
For example, at the top of inc/header.inc.php (just below the if (!defined ....) line) add something like
Code: Select all
$admin_panel = strpos($_SERVER['SCRIPT_FILENAME'], '/' . $hesk_settings['admin_dir'] . '/') !== false ? true : false;
Code: Select all
include(HESK_PATH . 'header.txt');
Code: Select all
if (!$admin_panel) {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
Re: Remove Header and Footer from Admin
Works like a charm with the header, not so with the footer.
Can't find footer.txt code to replace in the footer inc file... perhaps because it's encrypted?
Not a big deal anyway, it was the header that was in the way.
Thank you
Can't find footer.txt code to replace in the footer inc file... perhaps because it's encrypted?
Not a big deal anyway, it was the header that was in the way.
Thank you
Re: Remove Header and Footer from Admin
Right, but you can try adding this inside the footer.txt file:
Code: Select all
<?php global $admin_panel; if (!$admin_panel) { ?>
YOUR EXISTING FOOTER CODE HERE
<?php } ?>
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: Remove Header and Footer from Admin
Didn't work Klemen. Footer is still loading in Admin
Re: Remove Header and Footer from Admin
The code was missing global $admin_panel; I changed that so try it again, works for me now.
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: Remove Header and Footer from Admin
Nice job.
We'll be upgrading soon.
Will just have to remember that first piece of code in the core inc file when there are upgrades.
We'll be upgrading soon.
Will just have to remember that first piece of code in the core inc file when there are upgrades.
Re: Remove Header and Footer from Admin
Well you could just modify header and footer directly and ignore everything else. This way it will persist during updates, just make sure you don't overwrite the header.txt/footer.txt files.
header.txt
footer.txt
header.txt
Code: Select all
<?php if (strpos($_SERVER['SCRIPT_FILENAME'], '/' . $hesk_settings['admin_dir'] . '/') === false) { ?>
HEADER CODE HERE
<?php } ?>
Code: Select all
<?php if (strpos($_SERVER['SCRIPT_FILENAME'], '/' . $hesk_settings['admin_dir'] . '/') === false) { ?>
FOOTER CODE HERE
<?php } ?>
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: Remove Header and Footer from Admin
Nice Klemen. Hope this helps other too.
Re: Remove Header and Footer from Admin
By the way, in debug mode, I get this error in the admin:
Notice: Undefined variable: admin_panel in /inc/header.inc.php on line 121
only in admin. Is this related to the code we invoked?
This has no affect on performance.
Notice: Undefined variable: admin_panel in /inc/header.inc.php on line 121
only in admin. Is this related to the code we invoked?
This has no affect on performance.
Re: Remove Header and Footer from Admin
Use the original header.inc.php file and modify the header.txt file as suggests in my last post, that should fix it.
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: Remove Header and Footer from Admin
I am using the original header inc file.
Line 21 is : if (!$admin_panel) {include(HESK_PATH . 'header.txt');}
And only the header and footer txt files contain the code
As I said, everything works, just the error line in debug mode.
Line 21 is : if (!$admin_panel) {include(HESK_PATH . 'header.txt');}
And only the header and footer txt files contain the code
As I said, everything works, just the error line in debug mode.
Re: Remove Header and Footer from Admin
That's the modified, not original header.inc.php file. The original HESK file doesn't use $admin_panel variable.
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: Remove Header and Footer from Admin
Oops.
Thank you
Thank you