微论坛手册之表结构标签说明
一、表结构
CREATE TABLE `sky_mod_forum` ( `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, `title` varchar(50) CHARACTER SET utf8 NOT NULL DEFAULT '', `userid` mediumint(8) unsigned NOT NULL DEFAULT '0', `gid` int(10) unsigned NOT NULL DEFAULT '0', `catid` int(10) unsigned NOT NULL DEFAULT '0', `love_num` smallint(5) unsigned NOT NULL DEFAULT '0', `fav_num` smallint(5) unsigned NOT NULL DEFAULT '0', `forward_num` smallint(5) unsigned NOT NULL DEFAULT '0', `keywords` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', `description` varchar(255) CHARACTER SET utf8 NOT NULL DEFAULT '', `dateline` int(10) unsigned NOT NULL DEFAULT '0', `status` tinyint(3) unsigned NOT NULL DEFAULT '0', `comment_num` int(11) unsigned NOT NULL DEFAULT '0', `imgurl` varchar(225) CHARACTER SET utf8 NOT NULL DEFAULT '', `last_time` int(11) unsigned NOT NULL DEFAULT '0', `grade` int(11) unsigned NOT NULL DEFAULT '0', `isrecommend` tinyint(4) unsigned NOT NULL DEFAULT '0', `view_num` int(11) unsigned NOT NULL DEFAULT '0', `isnew` tinyint(4) unsigned NOT NULL DEFAULT '0', `tags` varchar(225) CHARACTER SET utf8 NOT NULL DEFAULT '', `videourl` varchar(225) CHARACTER SET utf8 NOT NULL DEFAULT '', `money` decimal(3,1) unsigned NOT NULL DEFAULT '0.0', `gold` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '奖励', `updatetime` datetime DEFAULT '2022-03-01 21:32:01', `createtime` datetime NOT NULL DEFAULT '2022-03-01 21:32:01', `imgsdata` text CHARACTER SET utf8, PRIMARY KEY (`id`), KEY `cat_id` (`catid`,`id`), KEY `gid` (`gid`), KEY `uid_id` (`userid`,`id`) ) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC;
二、ForumList 帖子列表
列表数据:
[{catid: 22 cname: "" comment_num: 9 dateline: 1621738098 description: "暴雨之后的牛头溪,这场洪水过后,大家可以来烧烤了" gid: 6 group_title: "共创家园" id: 123526 imgsdata: "attach/2021/05/23/165902635.jpg" imgslist: ["https://fd175.oss-cn-hangzhou.aliyuncs.com/attach/2021/05/23/165902635.jpg"] imgurl: "https://fd175.oss-cn-hangzhou.aliyuncs.com/attach/2021/05/23/165902635.jpg" love_num: 3 money: "0.0" nickname: "lrjxgl" status: 1 timeago: "2021年05月23日" title: "暴雨之后的牛头溪" user: {userid: 14, username: "lrjxgl", telephone: "15985840591", nickname: "lrjxgl", money: "10574.00",…} user_head: "https://fd175.oss-cn-hangzhou.aliyuncs.com/attach/2021/07/08/165902977.jpg" userid: 14 view_num: 203 }]
列表模板
{foreach item=c from=$list} <div class="sglist-item"> <div class="flex mgb-10"> <img gourl="/module.php?m=forum_home&userid={$c.userid}" src="{$c.user_head}.100x100.jpg" class="wh-40 bd-radius-50" /> <div class="flex-1 mgl-5"> <div class="flex flex-ai-center mgb-5"> <div class="f14 fw-600 ">{$c.nickname}</div> <span class="mgl-5 cl-warning f12">{$c.user.rank.rank_name}</span> </div> <div class="flex"> <div class="f12 cl3">{$c.timeago}</div> </div> </div> <div gourl="/module.php?m=forum&a=list&gid={$c.gid}" class="cl2 f12">来自{$c.group_title}</div> </div> <a href="/module.php?m=forum&a=show&id={$c.id}"> {if isset($c.imgslist) } {if count($c.imgslist)<=1} <div class="flex"> <div class="sglist-title flex-1 mgb-10">{$c.title}</div> {foreach item=img from=$c.imgslist} <img src="{$img}.100x100.jpg" class="wh-100 mgl-10" /> {/foreach} </div> {elseif count($c.imgslist)<=3 } <div class="sglist-title mgb-10">{$c.title}</div> <div class="sglist-imglist"> {foreach item=img from=$c.imgslist} <img src="{$img}.small.jpg" class="sglist-imglist-img{$c.imgslist|count}" /> {/foreach} </div> {else} <div class="sglist-title mgb-10">{$c.title}</div> <div class="sglist-imglist"> {foreach item=img from=$c.imgslist} <img src="{$img}.small.jpg" class="sglist-imglist-img" /> {/foreach} </div> {/if} {else} <div class="sglist-title mgb-10">{$c.title}</div> {/if} <div class="sglist-ft"> <div class="sglist-ft-love">{$c.love_num}</div> <div class="sglist-ft-cm">{$c.comment_num}</div> <div class="sglist-ft-view">{$c.view_num}</div> </div> </a> </div> {/foreach}
三、帖子详情