I have a function which returns an array:
category => News
datetime => 2005-12-15 8:37:21
parent_id => 1
I am not sure what you want to accomplish with your "parent_id", but you can use "setdbloop" like this:
SELECT author_name, IFauthor_name = ClausVB, 1, 0 AS boolean, DATE_FORMATFROM_UNIXTIMEpost_date, %W, %d %M %Y AS date_english FROM vlib_posts
If you have an existing array you can
- edit "datetime" with vlibDate
- use "parent_id" like you want to
and use create an LOOP-Array with "array_push" like
table_data = array;
� �while row = mysql_fetch_assocresult
� �{
� � � �array_pushtable_data, array
� � � � � �category = rowcategory,
� � � � � �birthday = date-formatDatesubstrrowdate_time, 0, 10, �%a, %d.%m.%Y,
� � � � � �parent_id = rowparent_id
� � � � � �
� � � �;
� �}
� �tmpl-setlooptable_data, table_data;
Its possible to use "setloop" without MySQL, too.
I have created a navigation like this:
?php
navigation_links = array
�0 = array
� aktiv = 0,
� nav_punkt = die letzten f�nf,
� url = gb_top5
�,
�1 = array
� aktiv = 0,
� nav_punkt = neuer Eintrag,
� url = gb_neu
�
;
switch navigation1
{
�case top5
� navigation_links0aktiv = 1;
�break;
�case neu
� navigation_links1aktiv = 1;
�break;
�default
� // bei gb_xy liefert der require_once |...| navigation1 einen Fehler
� navigation1 = intro;
}
?
and I can use it with vlibTemplate.
I create my main site with:
include header.php;
include body.php;
include navigation[0] . navigation[1] . .php //content
include footer.php;
A
complete different approach is possible, too. You can use
tmpl_include file=doctype_header.htm
tmpl_include file=body.htm
tmpl_include file={varcontent}
tmpl_include file=footer.htm
instead.
Please read
Modular programming with TMPL_INCLUDE for further information.
Regards,
Claus