Categories > TinyButStrong general >

With the example : Display by page, i want ...

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: MightyRaven
Date: 2003-08-18
Time: 14:47

With the example : Display by page, i want ...

I can do with TBS to display by Alphabets like Phone Book ?
By: Skrol29
Date: 2003-08-18
Time: 23:59

Re: With the example : Display by page, i want ...

Hello MightyRaven,

Here is one solution :

First you build an array with all the letter of the alphabet.
You use this array to display the index using the MergeBlock method.

Using a form a what you want, you must have the letter that the user wants. You display the result using another MergeBlock method on another block which display the list og items that begins with the choosen letter.
Example :
$TBS->MergeBlock('list',$cnx_id,"SELECT * FROM t_book WHERE b_title like '%".$letter."'")


By: MightyRaven
Date: 2003-08-21
Time: 15:56

Re: With the example : Display by page, i want ...

hi,

it's works ! but i get strange display format with my template HTM
The problem is :

When it no contain no DATA on display web page result is like this :
Each alpha are linked.

A B C D E F G H I J K L M N

If i click on M for MightyRaven

Result diplay like that :

A                B C D E ...
MightyRaven

It's like between A and B, create some space until the last character of MightyRaven ! All Data is same output result


my HTM :

[code}
<table width="550" cellpadding="0" cellspacing="0" class="" summary="">
                                <tr>
                                    <td width="550" valign="">                           
                                    <div align="left"><a href="[sys.script_name]?letter=[blk.val]">[blk.val;block=td]</a></div>
                                    </td>
                                  </tr>
                                <tr>
                                    <td width="550" valign=""><div align="left">[blk1.nom;block=tr];[blk1.prenom]</div></div></td>                                       
                                  </tr>
                        </table>
[/code}


My PHP :

[code}
include_once("tbs_class.php") ;

//Connexion à la base de donnée
require($_SERVER["DOCUMENT_ROOT"].'/cnx_mysql.php');
//Le fichier cnx_mysql.php contiens les lignes suivnates :
//  $cnx_id = mysql_connect('localhost','user','password') ;
//  mysql_select_db('dbname',$cnx_id) ;

$recset = array("A","B","C","D","E","F","G","H","I","J","K","L","M") ;

    $TBS = new clsTinyButStrong ;
    $TBS->LoadTemplate("joueurs_tpl.htm") ;
    //Fusion du block par page
    $RecCnt =$TBS->MergeBlock("blk",$recset);
   
    //Affichage de la liste des pages
    $TBS->MergeBlock("blk1",$cnx_id,"SELECT * FROM joueur WHERE nom LIKE '$letter%' ");
    //$TBS->MergeBlock("bljoueurs",$cnx_id,"SELECT id_joueur,nom,prenom FROM joueur ORDER BY nom") ;
    mysql_close($cnx_id) ;
    $TBS->show() ;

?>
By: Pirjo Posio
Date: 2003-08-21
Time: 16:20

Re: With the example : Display by page, i want ...

Hi,
I don't know the answer to your question, but I wonder one thing.
Why do you (and Skrol29 in his examples) use <div> -tags? You can put "align" directly to <td> without <div>, if this is the reason...
Anyway, you have two </div></div> tags.
- Pirjo
By: Skrol29
Date: 2003-08-21
Time: 16:35

Re: With the example : Display by page, i want ...

I work with Dreamweaver.
By default, it use <dir> for those things, but I have seen something in the options to tune that.
By: Skrol29
Date: 2003-08-21
Time: 16:40

Re: With the example : Display by page, i want ...

Hello Mighty,

The list of players's name (joueurs) is displayed in the same array as the list of letter.
So the first cell of letters is the same size as the size of names.

Use a embeded table for the navigator bar and it should be more nice.