You are not logged in. Please login or register.


Post new reply

Post new reply

Compose and post your new reply

You may use: BBCode

All fields with bold label must be completed before the form is submitted.

Required information for guests


Required information

(delete this if you are not)

Topic review (newest first)

3

Actually, it's been discovered that the example code as given causes ochiba to malfunction for reasons that are not immediately obvious, so please do not use it.

2

Hmm, that's pretty clean - nicely done. The next version of ochiba I'm working on is going to use a different template system (Smarty) so the implementation will be different but your code above has given me some ideas. Thanks!

1

Ever wanted to change the site appearance a wee bit for each of your sub-boards? A different colour for the headers maybe, or the background, or your standard font, or all of those? Here's a how-to for those who share my customization need:

It's really easy as pie, just add the following code to your page.php file:

        ///colour-code
        $path_to_color = array("/a" => "#abc",
                               "/b" => "#000",
                               "/c" => "#cab",
                               "/d" => "#fff"
                               );
        $path = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH);
        //echo $path; //uncomment if the code fucks up
        if(isset($path_to_color[$path])){
            $tmpl->setVariable("COLOR", $path_to_color[$path]);
        }else{
            $tmpl->setVariable("COLOR", "#aaa");
        }
        ///end colour-code

Naturally, you will need to specify your own sub-boards and colours in the first few lines.
Afterwards just add {COLOR} at any point you want in your templates (including - of course - css specifications _within_ the templates) The code will _NOT_ work if you add {COLOR} in your .css file.

For multiple colour changes just introduce more variables.

atm I've only just used/tested this for colours because they're the most handy way of customizing sub-boards whilst maintaining consistency. - But there's no reason why the code wouldn't work for other parameters: width, font-weight, font-family, even div id or class names. Maybe this could even serve as a starting point for some un-hackish way of stylizing sub-boards autonomously. Just take it from here and start experimenting.

Have phun kids.



Generated in 0.016 seconds (72% PHP - 28% DB) with 9 queries