Different CSS for Admin?
Moderator: mkoch227
Different CSS for Admin?
I've setup the hesk software on my site customizing the frontend user side. The problem with this is that by doing this, its made a mess of the admin side.
I was hoping to get around this by using the default css file and a blank header/footer file for the admin area.
How could I do this?
I was hoping to get around this by using the default css file and a blank header/footer file for the admin area.
How could I do this?
Re: Different CSS for Admin?
You could try changing this in inc/header.inc.php:
To say:
(where "hesk_style_ADMIN_v24.css" is the CSS file to use for admin panel).
And for header/footer you could paste something like this inside each text file:
Code: Select all
<?php echo HESK_PATH; ?>hesk_style_v24.css
Code: Select all
<?php
if (basename(__DIR__) == 'admin') {define('IS_ADMIN', true);}
else {define('IS_ADMIN', false);}
echo HESK_PATH . (IS_ADMIN ? 'hesk_style_v24_ADMIN.css' : 'hesk_style_v24.css');
?>
And for header/footer you could paste something like this inside each text file:
Code: Select all
<?php
if (empty(IS_ADMIN))
{
?>
YOUR HEADER/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: Different CSS for Admin?
Thanks for coming back to me. It isnt working though, and just displays blank pages everywhere when I make the changes. It seems to be to do with the footer and header because once I revert those files everything returns to normal.
Does this look correct?
This is how my header.inc file
My header txt file
and my footer
Thanks for your help, appreciate it 
Does this look correct?
This is how my header.inc file
Code: Select all
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo (isset($hesk_settings['tmp_title']) ? $hesk_settings['tmp_title'] : $hesk_settings['hesk_title']); ?></title>
<meta http-equiv="Content-Type" content="text/html;charset=<?php echo $hesklang['ENCODING']; ?>" />
<link href="<?php
if (basename(__DIR__) == 'admin') {define('IS_ADMIN', true);}
else {define('IS_ADMIN', false);}
echo HESK_PATH . (IS_ADMIN ? 'hesk_style_v24_ADMIN.css' : 'hesk_style_v24.css');
?>" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="../css/portal.css">
<script language="Javascript" type="text/javascript" src="<?php echo HESK_PATH; ?>hesk_javascript_v24.js"></script>
Code: Select all
<?php
if (empty(IS_ADMIN))
{
?>
<div class="main_content">
<?php include ("../top.php"); ?>
<div class="portal_content">
<!-- VERTICAL AD -->
<div class="ad_160_600">
<?php include ("../160x600.php"); ?>
</div>
<div class="wide_column">
<div class="wide_column_content">
<?php
}
?>
Code: Select all
<?php
if (empty(IS_ADMIN))
{
?>
<?php include ("468x90.php"); ?>
</div>
</div>
</div>
<div style="clear:both"></div>
</div>
<?php include ("../bottom.php"); ?>
</body>
</html>
<?php
}
?>

Re: Different CSS for Admin?
Never mind, my error.
Try this instead:
header.inc.php
header/footer.txt
Try this instead:
header.inc.php
Code: Select all
<?php
if (strpos($_SERVER['PHP_SELF'], '/admin') !== false) {define('IS_ADMIN', true);}
echo HESK_PATH . (defined('IS_ADMIN') ? 'hesk_style_v24_ADMIN.css' : 'hesk_style_v24.css');
?>
Code: Select all
<?php
if (defined('IS_ADMIN'))
{
?>
YOUR 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: Different CSS for Admin?
Thanks for that. The CSS part is working fine now, but the header/footer is broken.
This is my header file as an example. I take out the condition if and it displays fine, so I know its that.
This is my header file as an example. I take out the condition if and it displays fine, so I know its that.
Code: Select all
<?php
if (defined('IS_ADMIN'))
{
?>
<div class="main_content">
<?php include ("../top.php"); ?>
<div class="portal_content">
<!-- VERTICAL AD -->
<div class="ad_160_600">
<?php include ("../160x600.php"); ?>
</div>
<div class="wide_column">
<div class="wide_column_content">
<?php
}
?>
Re: Different CSS for Admin?
It seems I don't have to worry though, the header/footer files aren't showing in the admin panel anyway 
Thanks again for your help!

Thanks again for your help!

Re: Different CSS for Admin?
This will show your code in admin pages only:
Changing it to this will show for customers only:
This will let you use a custom header for both:
Code: Select all
if (defined('IS_ADMIN'))
Code: Select all
if ( ! defined('IS_ADMIN'))
Code: Select all
<?php
if (defined('IS_ADMIN'))
{
?>
CODE FOR ADMIN PANEL HERE
<?php
}
else
{
?>
CODE FOR CUSTOMER SIDE 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: Different CSS for Admin?
It seems I spoke too soon
See these two screenshots. It's fine on the main menu of the admin area, but as soon as I go into a ticket there, it doesn't pick it up properly with the header/footer. The interesting thing is though, the rest of the admin section is fine, its just the ticketing section.
Screenshots of Pages:
http://s20.postimg.org/jwf0a47ft/mainmenu.jpg
http://s20.postimg.org/apwpmu27d/ticket.jpg
Sourcecode of Pages:
http://s20.postimg.org/9owgxpl7x/mainmenu_source.jpg
http://s20.postimg.org/vpctec3vx/ticket_source.jpg
Any ideas?
header
footer

See these two screenshots. It's fine on the main menu of the admin area, but as soon as I go into a ticket there, it doesn't pick it up properly with the header/footer. The interesting thing is though, the rest of the admin section is fine, its just the ticketing section.
Screenshots of Pages:
http://s20.postimg.org/jwf0a47ft/mainmenu.jpg
http://s20.postimg.org/apwpmu27d/ticket.jpg
Sourcecode of Pages:
http://s20.postimg.org/9owgxpl7x/mainmenu_source.jpg
http://s20.postimg.org/vpctec3vx/ticket_source.jpg
Any ideas?
header
Code: Select all
<?php
if (!defined('IS_ADMIN'))
{
?>
<div class="main_content">
<?php include ("../top.php"); ?>
<div class="portal_content">
<!-- VERTICAL AD -->
<div class="ad_160_600">
<?php include ("../160x600.php"); ?>
</div>
<div class="wide_column">
<div class="wide_column_content">
<?php
}
?>
Code: Select all
<?php
if (!defined('IS_ADMIN'))
{
?>
<?php include ("../468x90.php"); ?>
</div>
</div>
</div>
<div style="clear:both"></div>
</div>
<?php include ("../bottom.php"); ?>
</body>
</html>
<?php
}
?>
Re: Different CSS for Admin?
How about if you change to ?
Code: Select all
strpos($_SERVER['PHP_SELF'], '/admin')
Code: Select all
strpos($_SERVER['PHP_SELF'], 'admin')
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: Different CSS for Admin?
Perfect now, thanks again 
