What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Is there a PHP code for this?

Pages: (2): « First [ 1 ] 2 » Last »
Is there a PHP code for this?
Author: Message:
Woraug
Full Member
***

Avatar
A Credit to Dementia

Posts: 128
Reputation: 2
36 / Male / –
Joined: Sep 2006
O.P. Is there a PHP code for this?
Basically, what I'm wanting to do is have varying backgrounds for my site.  I want to have the code detect what resolution whoever is visiting the site, and set a specified image as the background.  If I set a small image as the background, it doesn't look good tiled or stretched.  If I set a big image as a background, you can't see the whole thing, or it looks terrible downsized.
[Image: Sentinel.png]
12-10-2006 02:49 AM
Profile E-Mail PM Web Find Quote Report
Menthix
forum admin
*******

Avatar

Posts: 5537
Reputation: 102
40 / Male / Flag
Joined: Mar 2002
RE: Is there a PHP code for this?
AFAIK resolution can only be detected with javascript. PHP will certainly not work, PHP runs serverside, the resolution is clientside.

Keep in mind that there is a big difference between screen resolution and browser window resolution.

I personally wouldn't fill the background with one big image, it probably wont look good when a user resizes the window while viewing your page and keep a watch on the filesize of the image.
Finish the problem
Menthix.net | Contact Me
12-10-2006 03:02 AM
Profile E-Mail PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: Is there a PHP code for this?
Meh you dont even need javascprt you can use css
Touch Innovation - touch friendly programs/applications for the windows mobile!


12-10-2006 03:05 AM
Profile E-Mail PM Web Find Quote Report
Menthix
forum admin
*******

Avatar

Posts: 5537
Reputation: 102
40 / Male / Flag
Joined: Mar 2002
RE: Is there a PHP code for this?
CSS can't detect the user's screen resolution or browser window resolution, and that was what he asked for. Correct me if i'm wrong.
Finish the problem
Menthix.net | Contact Me
12-10-2006 03:07 AM
Profile E-Mail PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: Is there a PHP code for this?
No but it can stretch to the width and height of the browser and thats all he wants from what i see.
Touch Innovation - touch friendly programs/applications for the windows mobile!


12-10-2006 03:08 AM
Profile E-Mail PM Web Find Quote Report
Menthix
forum admin
*******

Avatar

Posts: 5537
Reputation: 102
40 / Male / Flag
Joined: Mar 2002
RE: Is there a PHP code for this?
quote:
Originally posted by Nathan
it can stretch to the width and height of the browser
quote:
Originally posted by Woraug
it doesn't look good tiled or stretched.
Finish the problem
Menthix.net | Contact Me
12-10-2006 03:10 AM
Profile E-Mail PM Web Find Quote Report
Nathan
Veteran Member
*****

Avatar
Yeah, "large dimensions" ;)

Posts: 2984
Reputation: 76
– / Male / Flag
Joined: Apr 2005
RE: Is there a PHP code for this?
Hmm sorry,
My bad
Touch Innovation - touch friendly programs/applications for the windows mobile!


12-10-2006 03:12 AM
Profile E-Mail PM Web Find Quote Report
rav0
Veteran Member
*****

Avatar
i have an avatar

Posts: 1419
Reputation: 29
35 / Male / Flag
Joined: Aug 2003
RE: Is there a PHP code for this?
I'd just but a big image as the backgroud, and if a user has their browser window smaller (or as big as it goes, but their screen resolution is low), let the image be cropped.

You should be able to see most of the image, and you can't detect the exact size of the page, just the screen rosolution, so there will be a border or cropping unless you end up being really lucky. The background is only in the background anyway.
| [Image: dorsh] |

(\ /)
(O.o)
(> <)

This is Bunny. Copy Bunny into your signature to help him on his way to world domination
12-10-2006 05:00 AM
Profile E-Mail PM Web Find Quote Report
stu
Junior Member
**

Avatar
Stu

Posts: 82
Reputation: 1
39 / Male / Flag
Joined: Sep 2004
RE: Is there a PHP code for this?
you could just use a script that detects what res they are using and redirect them to an appropriate page. not to sure how to just change the background picture though.  To redirect them just use something like
code:
<script language="JavaScript">
<!--
if ((screen.width>=1024) && (screen.height>=768))
{
window.location="highres.html";
}
else
{
  window.location="lowres.html";
}
//-->
</script>
enter whatever values you want for the width and height
12-19-2006 03:09 AM
Profile E-Mail PM Web Find Quote Report
Woraug
Full Member
***

Avatar
A Credit to Dementia

Posts: 128
Reputation: 2
36 / Male / –
Joined: Sep 2006
O.P. RE: Is there a PHP code for this?
What would I do to that code to make it do like:

if resolution = 1024x768: redirect to background1.jpg
if resolution = 1280x1024: redirect to background2.jpg
if resolution = 1600x1200: redirect to background3.jpg

ect.

Sorry, me and coding don't get along very well [Image: fox_swt.gif]
[Image: Sentinel.png]
12-19-2006 10:20 AM
Profile E-Mail PM Web Find Quote Report
Pages: (2): « First [ 1 ] 2 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On