package route import ( "opennamu/route/tool" "strconv" ) func Get_bbs_list_ui(config tool.Config, bbs_all_data []map[string]string, bbs_id_to_name map[string]string) string { count := 0 data_html := "" for _, in_data := range bbs_all_data { count_str := strconv.Itoa(count) count += 1 bbs_title := in_data["title"] bbs_id := in_data["set_id"] bbs_code := in_data["set_code"] bbs_date := in_data["date"] bbs_user_id := in_data["user_id_render"] bbs_comment_length_api := Api_bbs_w_comment(config, "length", bbs_id + "-" + bbs_code) bbs_comment_length := bbs_comment_length_api["data"].(int) bbs_comment_length_str := strconv.Itoa(bbs_comment_length) bbs_view_count := "0" if _, ok := in_data["view_count"]; ok { bbs_view_count = in_data["view_count"] } bbs_name := "" if len(bbs_id_to_name) != 0 { bbs_name = bbs_id_to_name[bbs_id] } left := "" left += `` + tool.HTML_escape(bbs_title) + `` if bbs_name != "" { left += ` (` + bbs_name + `)` } left += ` [` + bbs_comment_length_str + `]` right := "" right += `` right += bbs_view_count + " | " right += bbs_user_id + " | " right += bbs_date data_html += tool.Get_list_ui(left, right, "", "") } return data_html } func View_bbs_main(config tool.Config, page string) string { db := tool.DB_connect() defer tool.DB_close(db) bbs_list_api_data := Api_bbs_list(config) bbs_id_to_name := map[string]string{} data_html := "