Categories > TinyButStrong general >

PHP Version 4.3.10 - which TBS version should I use now/sub-heading problem

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: TREVOR
Date: 2009-05-21
Time: 12:09

PHP Version 4.3.10 - which TBS version should I use now/sub-heading problem

Dear Skrol29,
I am amazed to find that it was in December 2006 that you tweaked my coding so that my dynamic pages would work. My website still uses the TBS version downloaded at that time and my ISP uses PHP 4.3.10. I am still very pleased with the way they work.

I now want to improve some of my longer pages such as http://ccgi.handsel.plus.com/alpha/sil0308/sneck1/s_neck1.php by inserting a sub-heading every time the main code changes. (ie when S1001D becomes S1001F ). I am fairly sure the solution is to use your "p1" parameter - but I then need to get a serial display inside that sub-block and I am having difficulty getting my head round this!

Your example in the manual shows PHP code where the two linked queries select from two different tables. I only use one table - I do have a spare field I can dedicate for sub-headings (although I would prefer to generate them with a sub-string function) - can I use the "p1" parameter with just the one table?

Also do I need to update my TBS file anyway? - and if so which one should I now use?

Best wishes........Trevor
By: Skrol29
Date: 2009-05-22
Time: 00:08

Re: PHP Version 4.3.10 - which TBS version should I use now/sub-heading problem

Hi Trevor,

For your sub-heading you should use parameter "headergrp" to define a special section which is displayed each time a field is changing. No need to use p1. And it should be working with parameter "serial".

http://www.tinybutstrong.com/manual.php#html_block_prm_headergrp

> Also do I need to update my TBS file anyway?
> - and if so which one should I now use?

You are maybe using TBS 3.3.0. If you web application may have maintenance or changes, then it is better to use the last TBS version because it offers features that lot of users are missing. Also TBS 3.4.0 is very stable.



By: TomH
Date: 2009-05-22
Time: 00:15

Re: PHP Version 4.3.10 - which TBS version should I use now/sub-heading problem

Trevor,

Before you try subqueries - take a careful look at the "Groupings" example at http://www.tinybutstrong.com/examples.php

Groupings is very useful and simplifies things greatly.

There are two primary ways to control output
(1) headergroup
(2) parentgroup

See the manual for details...
http://www.tinybutstrong.com/manual.php#html_block_prm_parentgrp

An example that shows multiple level of 'headergroup's is available at http://tomhenry.us/tbs3/myinventory/catalog.php

The template code looks like this...
<table bgcolor="#FFFFC4" width="95%" cellspacing=0 cellpadding=2 border=[var.border] >
<!-- <tr><td colspan=6>Here are the current In Stock items</td></tr> -->

         <tr><td bgcolor="#E5E5E5" class='reverse' colspan=99>     <font face="Comic Sans MS,EraserDust,Helvetica,sans-serif" size="+0" color="#800000"><b>[blk1.category;block=tr;headergrp=category]</font></td></tr>
       
        <tr><td bgcolor="#FFFF97" colspan=2> Vendor:<b>    [blk1.vendorid;block=tr;headergrp=vendorid]</b></td>
        <td bgcolor="#FFFF97" class='reverse' colspan=1>SKU</td>
        <td bgcolor="#FFFF97" class='reverse' colspan=1>Units</td>
        <td bgcolor="#FFFF97" class='reverse' align=right>Price</td>
        <td bgcolor="#FFFF97" class='reverse' align=right> List &#160;  &#160; </td></tr>
       
        <tr><td></td><td class='resultrows' valign=top>[blk1.description;block=tr;headergrp=vendorsku]</td>
        <td class='resultrows'><a href="[var..script_name]?id=[blk1.id]">[blk1.vendorsku]</a></td>
        <td class='resultrows' valign=top align=left width=10>[blk1.units]</td>
        <td class='resultrows' valign=top align=right>[blk1.ourprice]</td>
        <td class='resultrows' valign=top align=right>[blk1.retailprice] &#160;  &#160; </td>
        </tr>

<tr><td bgcolor="#EFEFEF" align=center colspan=6>[onload;file='navbar.inc']</td></tr>
</table>


Hope that helps a little,TomH
By: TREVOR
Date: 2009-05-23
Time: 13:18

Re: PHP Version 4.3.10 - which TBS version should I use now/sub-heading problem

Thank you Skrol29 and thank you TomH. Using the parameter "headergrp" does the trick. My coding skill and experience are such that it has taken me a little time and fiddling, but I have now got the result I wanted. I am very pleased indeed.

If you try http://ccgi.handsel.plus.com/alpha/sil0308/sneck1/s_neck1.php you will see that the page is now much easier to read.

I have also upgraded to TBS version 3.4.0 (I think I was using 3.2 before) and the pages do seem to run just that little bit faster and smoother.

Thank you again...Best wishes...Trevor