Change Layout According Day And Night

Started on the old forum in February 2009 · view the original in the archive · old links redirect here

25 replies · 1,816 views · started 17 years ago · 1 min read

TL;DR · summary of 25 replies
  • users can change themes not all sites can do that.
  • djlee suggested a one-line solution for changing day and night layouts without errors.
  • storing CSS files in PHP could be used for efficient storage and caching to reduce load times.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

12 participants
ozziemale31 Lead · 861 posts #21

another way you could make a color menu pick option like this below

<td align="left" valign="top" class="alt1"> <smallfont>**Choose the sign's background color:**</smallfont> </td> <td align="left" class="alt1"> <select name="shcol"> <option value="255,255,255" selected>White</option> <option value="0,0,255" style="background-color:#0000FF">Blue</option> <option value="185,207,232" style="background-color:#B9CFE8">Softblue</option> <option value="255,153,0" style="background-color:#FF9900">Orange</option> <option value="248,241,163" style="background-color:#F8F1A3">Yellow</option> <option value="0,255,0" style="background-color:#00FF00">Green</option> <option value="197,248,163" style="background-color:#C5F8A3">Softgreen</option> <option value="248,203,251" style="background-color:#F8CBFB">Pink</option> <option value="228,195,164" style="background-color:#E4C3A4">Brown</option> <option value="0,0,0" style="background-color:#000000; color=#FFFFFF">Black</option> </select> </td>

External image (may be gone) External image (may be gone)

External image (may be gone)

*****

**Dont Ask Me Dumb Questions.Or you'l get a Dumb Answer.. Want A Profesional Logo or Theme For Your wap site Pm Me.If I Have The Time Ill Make It For Free ***

ori Lead · 512 posts #22

heres how i do my edit theme page

$colors=array("990000","ff0000","ff6633","ff9900","ff9966","ffff00","339933","33cc33", "00ff00","99ff99","000066","0000cc", "3366ff","6699ff","00ffff","3399ff","990099","ff0099","ff9999","ffcccc","993300","cccc99", "666666","000000","ffffff");
foreach($colors as $hexcolor)$bgcolors.="<a href=\"".$action."options".$mod."theme&update=1&bgcolor=$hexcolor".$session."\"><img src=\"/images/hex/".$hexcolor.".gif\" alt=\"[$hexcolor]\"/></a>\n";
foreach($colors as $hexcolor)$txtcolors.="<a href=\"".$action."options".$mod."theme&update=1&txtcolor=$hexcolor".$session."\"><img src=\"/images/hex/".$hexcolor.".gif\" alt=\"[$hexcolor]\"/></a>\n";
foreach($colors as $hexcolor)$linkcolors.="<a href=\"".$action."options".$mod."theme&update=1&linkcolor=$hexcolor".$session."\"><img src=\"/images/hex/".$hexcolor.".gif\" alt=\"[$hexcolor]\"/></a>\n";
foreach($colors as $hexcolor)$navcolors.="<a href=\"".$action."options".$mod."theme&update=1&navcolor=$hexcolor".$session."\"><img src=\"/images/hex/".$hexcolor.".gif\" alt=\"[$hexcolor]\"/></a>\n";
$bgcolor=get_var("bgcolor");
if(empty($bgcolor))$bgcolor=users_table("bgcolor",$uid);
$txtcolor=get_var("txtcolor");
if(empty($txtcolor))$txtcolor=users_table("txtcolor",$uid);
$linkcolor=get_var("linkcolor");
if(empty($linkcolor))$linkcolor=users_table("linkcolor",$uid);
$navcolor=get_var("navcolor");
if(empty($navcolor))$navcolor=users_table("navcolor",$uid);
$font=get_var("font");
if(empty($font))$font=users_table("font",$uid);
<?xml version="1.0" encoding="UTF-8"?>
<!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">
<head>
<meta http-equiv="Cache-Control" content="max-age=30"/>
<title>{username} @ change theme</title>
<link rel="stylesheet" type="text/css" href="{directory}style.php?uid={uid}"/>
</head>
<body>
<div class="title">{username} @ change theme</div>
<div class="adblock">{mobads}</div>

[b]update theme[/b]

[img]{images}point.gif[/img][size="1"]here you can customize a theme for viewing this site!![/size]

{msg}

background color:

{bgcolors}

text color:

{txtcolors}

link color:

{linkcolors}

nav-bar color:

{navcolors}
</p>
<div>
<form action="{action}options{mode}theme" method="post">
<input type="hidden" name="update" value="1"/>
font:

<select name="font">
<option value="small">small</option>
<option value="medium">medium</option>
<option value="large">large</option>
</select>
<input type="hidden" name="ses" value="{ses}"/>
<input type="submit" value="select"/>
</form>
</div>

<- [url="{action}options{session}"]back[/url]

[img]{images}banner.gif[/img]

[url="{action}messages{session}"][[size="1"]2[/size]] messages[/url] |
[url="{action}friends{session}"][[size="1"]3[/size]] friends[/url] |
[url="{action}forums{session}"][[size="1"]4[/size]] forums[/url] |
[url="{action}chat{session}"][[size="1"]5[/size]] chat[/url]

[url="{action}home{session}"][img]/phpThumb/phpThumb.php?src=/images/logo.gif&f=png&w=20\[/img][[size="1"]0[/size]] main page[/url]
</p>
<div class="adblock2">{mobads2}</div>
<div class="navi">
©2008 {sitename} - [email]b4lth4z4r@live.com.au[/email]

[[url="{action}about{session}"]about us[/url]|[url="{action}terms{session}"]terms & conditions[/url]]
</div>
</body>
</html>
djdevil89 Senior · 287 posts #23

but for the day night code it should be something like

<? 
$hour = date(”H”); 
if ($hour > 9 || $hour < 18) 
{ 
include('daycss.php'); 
} 
elseif ($hour > 18 || $hour < 9) 
{ 
include('nightcss.php'); 
} 
else  
{ 
echo "Error!"; 
} 
?>

coz if you do it the way it is named above it will show the css code in your page instead of the layout

foreach ($_SERVER as $server => $value)
{
echo "$server is $value<br />";
}
something else Fellow · 2,296 posts #24

QUOTE (ori @ Feb 24 2009, 12:29 PM) <{POST_SNAPBACK}>

was pointing out that day/night themes isnt exactly useful when users make there own theme onsite lol

users could pick day and night themes ?????

or you could set it up to reverse there colour for night time theme

or if you really wanted to go all the way you could set it up to get brighter throughout day and darker towards night (differnt shades per hour)

or you could have it linked into weather aswell and have background images whatever the weather is in there location 🙂

Anshul Senior · 296 posts #25

you can also do this by mod rewrite

RewriteEngine on
RewriteCond   %{TIME_HOUR}%{TIME_MIN} >0700
RewriteCond   %{TIME_HOUR}%{TIME_MIN} <1900
RewriteRule   ^foo\.html$             foo.day.html
RewriteRule   ^foo\.html$             foo.night.html
GumSlone Administrator Principal · 1,690 posts #26

QUOTE (Spook @ Mar 6 2009, 07:31 PM) <{POST_SNAPBACK}>

you can also do this by mod rewrite

RewriteEngine on
RewriteCond   %{TIME_HOUR}%{TIME_MIN} >0700
RewriteCond   %{TIME_HOUR}%{TIME_MIN} <1900
RewriteRule   ^foo\.html$             foo.day.html
RewriteRule   ^foo\.html$             foo.night.html

to use the.htaccess mod rewrite is realy nice idea 😮

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close