Change Layout According Day And Night

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    another plus to having ur css file in php is that no1 can get the link thru source and see ur css code so its safe no1 will see how u did ur css

    Comment


      #17
      Yes they can if the classes generate CSS files from user input.

      Comment


        #18
        <div class='quotetop'>QUOTE (ori @ Feb 21 2009, 09:44 AM) <{POST_SNAPBACK}></div>
        interesting idea but what bout sites where users make there own themes?[/b]
        Not exactly hard to do??????

        <div class='quotetop'>QUOTE (ori @ Feb 23 2009, 08:51 AM) <{POST_SNAPBACK}></div>
        who was the creator of wapside?

        oh and heres how i do my themes users can create there own thru database thee is only 1 theme file i wont give my css code or how it interacts with the database but heres how to get it started make a php file call it style.php and add this

        Code:
        <?php
        header("Content-type: text/css");
        header("Cache-Control: no-cache, must-revalidate");
        require(&#39;modules/db.php&#39;);
        $uid=$_GET["uid"];
        $bgcolor=users_table("bgcolor",$uid);
        $txtcolor=users_table("txtcolor",$uid);
        $linkcolor=users_table("linkcolor",$uid);
        $stylishcolor=users_table("stylishcolor",$uid);
        $navcolor=users_table("navcolor",$uid);
        $font=users_table("font",$uid);
        if(empty($bgcolor))$bgcolor="fff";
        if(empty($txtcolor))$txtcolor="000";
        if(empty($linkcolor))$linkcolor="3366ff";
        if(empty($stylishcolor))$stylishcolor="4a4839";
        if(empty($navcolor))$navcolor="3366ff";
        if(empty($font))$font="medium";
        ?>
        
        body {background-color:#<?=$bgcolor?>; color:#<?=$txtcolor?>; font-family:Verdana,Arial,Helvetica,sans-serif; font-size:<?=$font?>; margin:0px; padding:2px;}
        
        #etc etc jus add ur codes and use <?=$ and the php bits as defined above its quite easy
        code for html/xhtml

        <link rel=\"stylesheet\" type=\"text/css\" href=\"/style.php?uid=$uid\"/>[/b]
        ..........................

        Code:
        if(isday($time)){
        $file ="day";
        }else{
        $file ="night";
        }
        $css = "<link rel=\"stylesheet\" type=\"text/css\" href=\"/$filestyle.php?uid=$uid\"/>";

        Comment


          #19
          users dnt generate css files theres 1 php file that has the css code in it and jus gets the colors from what users hav saved thru database hav look at the code i posted its all there lol

          Comment


            #20
            <div class='quotetop'>QUOTE (something else @ Feb 24 2009, 02:46 AM) <{POST_SNAPBACK}></div>
            Not exactly hard to do??????



            ..........................

            Code:
            if(isday($time)){
            $file ="day";
            }else{
            $file ="night";
            }
            $css = "<link rel=\"stylesheet\" type=\"text/css\" href=\"/$filestyle.php?uid=$uid\"/>";
            [/b]
            was pointing out that day/night themes isnt exactly useful when users make there own theme onsite lol

            Comment


              #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&#39;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>










              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

              Comment


                #22
                heres how i do my edit theme page

                Code:
                $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&amp;update=1&amp;bgcolor=$hexcolor".$session."\"><img src=\"/images/hex/".$hexcolor.".gif\" alt=\"[$hexcolor]\"/></a>\n";
                foreach($colors as $hexcolor)$txtcolors.="<a href=\"".$action."options".$mod."theme&amp;update=1&amp;txtcolor=$hexcolor".$session."\"><img src=\"/images/hex/".$hexcolor.".gif\" alt=\"[$hexcolor]\"/></a>\n";
                foreach($colors as $hexcolor)$linkcolors.="<a href=\"".$action."options".$mod."theme&amp;update=1&amp;linkcolor=$hexcolor".$session."\"><img src=\"/images/hex/".$hexcolor.".gif\" alt=\"[$hexcolor]\"/></a>\n";
                foreach($colors as $hexcolor)$navcolors.="<a href=\"".$action."options".$mod."theme&amp;update=1&amp;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);
                Code:
                <?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>
                
                
                
                &lt;- [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&amp;f=png&amp;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 &amp; conditions[/url]]
                </div>
                </body>
                </html>

                Comment


                  #23
                  but for the day night code it should be something like
                  Code:
                  <? 
                  $hour = date(”H”); 
                  if ($hour > 9 || $hour < 18) 
                  { 
                  include(&#39;daycss.php&#39;); 
                  } 
                  elseif ($hour > 18 || $hour < 9) 
                  { 
                  include(&#39;nightcss.php&#39;); 
                  } 
                  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

                  PHP Code:
                  foreach ($_SERVER as $server => $value)
                  {
                  echo 
                  "$server is $value<br />";

                  Comment


                    #24
                    <div class='quotetop'>QUOTE (ori @ Feb 24 2009, 12:29 PM) <{POST_SNAPBACK}></div>
                    was pointing out that day/night themes isnt exactly useful when users make there own theme onsite lol[/b]
                    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

                    Comment


                      #25
                      you can also do this by mod rewrite
                      Code:
                      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

                      Comment


                        #26
                        <div class='quotetop'>QUOTE (Spook @ Mar 6 2009, 07:31 PM) <{POST_SNAPBACK}></div>
                        you can also do this by mod rewrite
                        Code:
                        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
                        [/b]
                        to use the.htaccess mod rewrite is realy nice idea
                        Advertise your mobile site for FREE with AdTwirl

                        Comment

                        Working...
                        X