Not signed in ( Sign In)

Categories

Welcome, Guest

Want to take part in these discussions? Sign in if you have an account, or apply for one below

Vanilla 1.1.10 is a product of Lussumo. More Information: Documentation, Community Support.

    •  
      CommentAuthorTychondriax
    • CommentTimeOct 31st 2007 edited
     permalink
    I must admit, porting FlatPress themes is becoming kind of fun to me =P
    Behold my last work, Bitter-sweet Theme , this time a port from oswd.org.
    Maybe it'll need some fixes with Crescendo+1, but it won't be a problem, and moreover I'm going to design a multi-style version of it (one per color) =)
    Enjoy!!
    •  
      CommentAuthorNoWhereMan
    • CommentTimeOct 31st 2007
     permalink
    sweet, indeed
  1.  permalink
    What are you doing, man? Are you trying to steal my "job"??? :P

    Very good work... VERY VERY good work!!!
    •  
      CommentAuthorEmbrance
    • CommentTimeNov 1st 2007
     permalink
    Hey tycho could you modify the theme to make the header.jpg random?
    For example having head1.jpg and head2.jpg etc in the folder and the theme selects on randomly each tiem.On e107 Crahan theme,it was done this way:
    $logo = "logo".rand(1, 4);
    Could you possibly do that?
    •  
      CommentAuthorNoWhereMan
    • CommentTimeNov 2nd 2007 edited
     permalink
    suggestion to Tychondriax:

    in res/ put a file called head.css.php (double extension not really needed but makes clearer what it does)

    <?php
    $MIN_IMGS = 0;
    $MAX_IMGS = 9;

    // notifies the client this IS a css, despite php extension
    header('Content-Type: text/css');

    $i = mt_rand($MIN_IMGS, $MAX_IMGS); // randomizes 0 <= i <= 9
    $img = 'head' . $i . '.png'; // we'll suppose you have head0.png, head1.png, ..., head9.png

    the IMGS will be

    ?>

    #header-id-I-dont-remember {
    background : url(../imgs/<?php echo $img; ?>);
    }



    from style.css you'll import with

    @import url(head.css.php);

    I'd suggest this to be commented out, so one can enable it at request, and maybe put this info in a README (that nobody will ever read :P) or in the theme description, which svn as you should know displays in the panel
    •  
      CommentAuthorNoWhereMan
    • CommentTimeDec 23rd 2007 edited
     permalink
    This discussion made me realize another way to get this same behaviour;

    change your header.tpl so that the line

    <div class="header"></div>

    reads

    <div class="header rand-img-{"0"|mt_rand:9}"></div>

    now add to your css the definitions

    .rand-img-0 {background: url('../imgs/img-you-want-first.png'); }
    .rand-img-1 {background: url('../imgs/img-you-want-second.png'); }
    /* ... etc etc ... */
    .rand-img-9 {background: url('../imgs/img-you-want-last.png'); }


    of course mt_rand:9 can be changed into whatever value you want :)

    have fun!