diff --git a/include/list.php b/include/list.php
index 6112ce7..99ab40c 100644
--- a/include/list.php
+++ b/include/list.php
@@ -1,45 +1,24 @@
-
'
- .$group["group_icon"].
- '
- '.$group["group_name"].
- '
- ';
- while($link = mysqli_fetch_array($links)) {
- // 循环每个链接
- $group_links = mysqli_query($con,"SELECT * FROM `lylme_links` WHERE `group_id` = ".$group["group_id"]);
- // 返回指定分组下的所有字段
- $link_num=mysqli_num_rows($group_links);
- // 释放结果集
- //echo gettype($fieldcount);
+while($group = mysqli_fetch_assoc($groups)) { //循环所有分组
+ echo '- '.$group["group_icon"].''.$group["group_name"].'
'; //输出分组图标和标题
+ while($link = mysqli_fetch_array($links)) { // 循环每个链接
+ $group_links = mysqli_query($con,"SELECT * FROM `lylme_links` WHERE `group_id` = ".$group["group_id"]); // 返回指定分组下的所有字段
+ $link_num=mysqli_num_rows($group_links); // 获取返回字段条目数量
if($link_num > $i ) {
$i = $i+1;
- echo "\n\n".'-
-
- '.$link["icon"].'
-
- '.$link["name"].'
-
-
-
';
+ echo "\n\n".'- '.$link["icon"].''.$link["name"].'
';
+ //输出图标和链接
}
if($link_num == $i) {
- echo '
'."\n\n" ;
- #输出分类结束标签
- $i = 0;
- break;
- //跳出当前循环
+ //判断当前分组链接循环完毕
+ echo ''."\n" ; //输出分类结束标签
+ $i = 0;
+ break; //重置$i为0跳出当前循环
}
- //获取分类下的网站数量
}
}
mysqli_close($con);