Categories > TinyButStrong general >

alternated color for a header section

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: ClausVB
Date: 2005-11-21
Time: 23:23

alternated color for a header section

Hi Skrol!

I got my first Beta online. Needs a lot of work and testing ...

I cannot do what I want with TBS and parentgrp, so I ask for help (again :-):

http://dl.clausvb.de/home_correct.htm
=> orange images

http://dl.clausvb.de/home.php
=> works with TBS, but the normal
1. Block: td bgcolor=blue
2. Block: td bgcolor=orange
does not seem to work here.

    require_once 'include/tbs_class.php';
    require_once 'include/config.php';
    require_once 'include/functions.php';
    require_once "lang/$lang.php";
    mysql_db_open($db_host, $db_user, $db_pw, $db_name);
    require_once 'include/header.php';

    $tmpl = new clsTinyButStrong;
    $tmpl->LoadTemplate($frontend_skin . '/tmpl/home.htm');

    $select = 'SELECT f_id, f_category_id, f_name, f_short_description, f_total, f_size, f_status, c_name FROM dl_files INNER JOIN dl_categories ON (f_category_id = c_id) ORDER BY f_category_id, f_id';
    $tmpl->MergeBlock('table_data', 'mysql', $select);
    $tmpl->Show(TBS_OUTPUT);

    mysql_close();
Template:
http://dl.clausvb.de/skins/MorpheusXSteelBlue/tmpl/home.htm

How can I integrate the orange images?

Regards,
Claus

PS: Thank you very much for your mail. I will answer it tomorrow.
By: Skrol29
Date: 2005-11-24
Time: 13:11

Re: alternated color for a header section

Hi ClauseVB,

I've put this post into a news thread.

I understand you want to have alternated colors (blue/orange) for a header section. Unfortunatley alternated display works only for normal sections.

I can see two workarounds:

1/ Use a main block instead of the header group, and then use sub-block for details. The main block can have alternated sections then.
But this will make the script to call several queries :(

2/ Use parameter "onformat" on the images that are supposed to change their display, and use it with a custom function wich returns 'blue' or 'orange' alternatively when the given value (the fields used for header) changes.

By: ClausVB
Date: 2006-01-08
Time: 19:12

Re: alternated color for a header section

Sorry, it took so long to answer.

I tried to create a different skin with TinyButStrong for "dl_stats". It is too complicated. "Extend" does not solve the problem always and working with "onformat" should work, but I cannot create different PHP-Code for different skins.

It would be so easy to do this with vLIB, but perhaps there is some way with TinyButStrong, too.

I solved the problems with PHP and
<? foreach($outer as $outer_array): ?>
HTML
class="cattitle"><?=$outer_array['c_name']?></a></span>
and so on.

I will contact you, if I have further time for a TinyButStrong solution.

Thank you very much for your effort.

Regards,
Claus