Welcome to the archive of the old FlatPress support forum. Browse more than a decade of FlatPress wisdom! Login is disabled.

The current FlatPress support forum is available here: forum.flatpress.org
Bitter-Sweet Theme released on Wiki
  • 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!!
  • sweet, indeed
  • What are you doing, man? Are you trying to steal my "job"??? :P Very good work... VERY VERY good work!!!
  • 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?
  • suggestion to Tychondriax: in res/ put a file called head.css.php (double extension not really needed but makes clearer what it does)
    $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
  • This discussion made me realize another way to get this same behaviour; change your header.tpl so that the line
    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!
This discussion has been closed.
All Discussions
Start a New Discussion

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion