- 'HEADER_IMAGE_WIDTH' => (($res == '800x600') ? '400' : '480'),
here is a tip I found on Austin's forum (maker of Amod)
As we all know, someone on 800x600 sees your site different from someone on a smaller resolution. For those who want to change that, here ya go.
Open page_header.php & at the top find
- Code: Select all
- define('HEADER_INC', TRUE);
after that add
- Code: Select all
- if (isset($HTTP_COOKIE_VARS['users_resolution']))
- $res = $HTTP_COOKIE_VARS['users_resolution'];
then find
- Code: Select all
- $template->assign_vars(array(
- 'SITENAME' => $board_config['sitename'],
after that add
- Code: Select all
- 'HEADER_IMAGE_WIDTH' => (($res == '800x600') ? '400' : '480'),
close & save it.
Then open overall_header.tpl for any header you want to modify, find
- Code: Select all
- </head>
before that add
- Code: Select all
- <script type="text/javascript">
- <!--
- writeCookie();
- function writeCookie()
- {
- var today = new Date();
- var the_date = new Date("December 31, 2023");
- var the_cookie_date = the_date.toGMTString();
- var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
- var the_cookie = the_cookie + ";expires=" + the_cookie_date;
- document.cookie=the_cookie
- }
- //-->
- </script>
And now everytime someone comes to your site, it will set a cookie with their screen resolution. This way you can determine how to size it. As you see we size it in page_header.php
- Code: Select all
There. If they are on a 800x600 we make the image width a bit smaller (400) and if they are not on 800x600 we make it a bit bigger (actual size of 480)
Now to use it, whatever image you want to auto-size needs
- Code: Select all
- width="{HEADER_IMAGE_WIDTH}"
Added to the image tag.