<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http:
-->
$sqltype
=
"select type_name,type_description,type_path,type_id from `type` where type_parent= $type_id limit 6"
;
$ret
=mysql_query(
$sqltype
);
$type_idarray
=
array
();
$type_array
=
array
();
while
(
$rows_type
=mysql_fetch_array(
$ret
,MYSQL_ASSOC)){
$arrty
=
array
();
$type_idarray
[]=
$rows_type
[
'type_id'
];小分类ID集合
array_push
(
$arrty
,
count
(
$arrty
)+1,
$rows_type
[
'type_name'
]);
array_push
(
$arrty
,
count
(
$arrty
)+1,
$rows_type
[
'type_description'
]);
array_push
(
$arrty
,
count
(
$arrty
)+1,
$rows_type
[
'type_path'
]);
$type_array
=
array_pad
(
$type_array
,
count
(
$type_array
)+1,
$arrty
);
}
$content_array
=
array
();
foreach
(
$type_idarray
as
$value
) {
$type_id
=
$value
[
'type_id'
];
$sql_content
=
"select content_name,content_url from `content` where type_id=$type_id limit 3"
;
$rec
=mysql_query(
$sql_content
);
while
(
$rows_cent
=mysql_fetch_array(
$ret
,MYSQL_ASSOC)){
$arrz
=
array
();
array_push
(
$arrz
,
count
(
$arrz
)+1,
$rowzhuti_tour
[
'content_name'
]);内容名字
array_push
(
$arrz
,
count
(
$arrz
)+1,
$rowzhuti_tour
[
'content_url'
]);内容路径
$content_array
=
array_pad
(
$content_array
,
count
(
$content_array
)+1,
$arrz
);
}
}
$tempc_html
=
'type.tpl'
;模板
$obj_html
=FILE_PATH.
'/type.html'
;
$smarty
->assign(
'type_array'
,
$type_array
);
$smarty
->assign(
'content_array'
,
$content_array
);
$contentc
=
$smarty
->fetch(
$tempc_html
, null, null, false);
$fulnum
=
file_put_contents
(
$obj_html
,
$contentc
);