Change Layout According Day And Night

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

    Change Layout According Day And Night

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?
    $hour = date(”H”);
    if ($hour > 9 || $hour < 1
    {
    include(&#39;daycss.css&#39;);
    }
    elseif ($hour > 18 || $hour < 9)
    {
    include(&#39;nightcss.css&#39;);
    }
    else
    {
    echo "Error!";
    }
    ?></div>



    u can accordingly add your stuff ......for ex if u want sun in the morning u can put the background image of the sunn.....at the night u can do it with a image of a moon...!!!!!!!!!!!!!!!!!!! thanks ......only for u my brother farhad may your soul rest in peace ...................

    #2
    interesting idea but what bout sites where users make there own themes?

    Comment


      #3
      <div class='quotetop'>QUOTE (ori @ Feb 21 2009, 03:14 PM) <{POST_SNAPBACK}></div>
      interesting idea but what bout sites where users make there own themes?[/b]
      hmmmmm dint get ya ...cn u post the site were ppl make their own theme

      Comment


        #4
        My site users can change themes not all sites can do that ..

        But i got a error lol

        this didnt wont to work for me
        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
        Visit: WapMasterz Coming Back Soon!
        _______
        SCRIPTS FOR SALE BY SUBZERO
        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
        _______
        Info & Tips
        php.net
        w3schools.com

        Comment


          #5
          <div class='quotetop'>QUOTE (tkrocks @ Feb 21 2009, 03:21 PM) <{POST_SNAPBACK}></div>
          hmmmmm dint get ya ...cn u post the site were ppl make their own theme[/b]
          like my site...



          Comment


            #6
            bad idea .. else error ??? theres no reason for the else to be called true .. but why risk it .. simple method in one line ...
            Code:
            include((date("H") > 18 && date("H") < 9 ? "night" : "day").".css");
            1 line so its cleaner and if date fails for whatever reason the else param is called and the day.css file is included .. this way the site will always work and no error messages

            Comment


              #7
              <div class='quotetop'>QUOTE (REY619 @ Feb 21 2009, 04:07 PM) <{POST_SNAPBACK}></div>
              like my site...



              [/b]

              thats alot of options u dnt reali need lol should make it bit neater

              Comment


                #8
                <div class='quotetop'>QUOTE (ori @ Feb 22 2009, 06:43 AM) <{POST_SNAPBACK}></div>
                thats alot of options u dnt reali need lol should make it bit neater[/b]
                lol yeah.. thats not for everybody, just the geeky ones use it, others use default themes.. :D
                Ppl mess it up pretty easily, if they dont know what they&#39;re doing..

                Comment


                  #9
                  this is how i edit themes

                  currently only admin can do it once i get time and hopefully with another new script users can fully edit anything regarding a theme
                  background images, text effects etc etc the lot hopefully

                  Comment


                    #10
                    ive actually been working on a new css based theme system.. hears a few ideas ive been playing with that might help you

                    1. What about storing an entire CSS file in a text/Blob field, u cud use blob for a quick and easy way to store the css file or use a serialised string in a text field which you can the parse into a basic css file for inclusion

                    2. Once you have a more efficient way of storing it, what about load times.. everyone knows the best way to lower load times is with caching .. so lets cache the css. Personally id have an unlimited time cache, and only update the cached file when the user updates the css (you could directly update teh cache, or delete the cached file and on next page load a new css will be generated)

                    3. So we have a prety efficient system. But i hate uneeded data in a database. especially since i make any site i create easily scaleable. So maybe we could rip out all the stored css files and store them independantly. Its easy to parse information from a file, if your not good with regex then have a serialised string commented at the top of the css file. so when a users comes to edit the css settings, u read from that string using explode or something. much easier way of doing it

                    so we have a css file that doesnt rely on the database, a theme engine which doesnt require table lookups on every page load, a way to save the css file and a way to edit the file. Then all u need is a way of checking for a valid file, so thats just a conditional statement in the head tags of the document.

                    Code:
                    $uid = 1; // example i dunno what u use for user ids
                    
                    if(file_exists("cache/usrcss/$uid.css"))
                     echo "<link rel=&#39;stylesheet&#39; type=&#39;text/css&#39; href=&#39;cache/usrcss/$uid.css&#39; />";
                    else
                     echo "<link rel=&#39;stylesheet&#39; type=&#39;text/css&#39; href=&#39;default.css&#39; />";
                    simple bit of code and thats a nice, semi optimised theme engine that is far more scalable than the current theme engines your using (ive only seen 3 sites theme engines however but since the owners are idiots, im guessing its some default copy and paste theme code since the screenprints above look similar to theirs)

                    anyway just a few ideas i jotted down, it could be optimised further and be made for complex for a truely unique engine but i aint giving away all my ideas

                    Comment


                      #11
                      Had this idea same idea but haven&#39;t implemented anything in wapside yet will be doing soon

                      Comment


                        #12
                        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\"/>

                        Comment


                          #13
                          Wap2k is loll
                          Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                          Visit: WapMasterz Coming Back Soon!
                          _______
                          SCRIPTS FOR SALE BY SUBZERO
                          Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                          FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                          _______
                          Info & Tips
                          php.net
                          w3schools.com

                          Comment


                            #14
                            <div class='quotetop'>QUOTE (amylee @ Feb 22 2009, 05:19 AM) <{POST_SNAPBACK}></div>
                            this is how i edit themes

                            currently only admin can do it once i get time and hopefully with another new script users can fully edit anything regarding a theme
                            background images, text effects etc etc the lot hopefully[/b]
                            amy this code is cool ;)
                            if like my post click:

                            http://coding-talk.com/images/totall...ost_thanks.gif

                            Comment


                              #15
                              There are several ready to use css parser classes at phpclasses.org which make it easy to edit and create new css files.
                              Advertise your mobile site for FREE with AdTwirl

                              Comment

                              Working...
                              X