链轮框架
约 365 字大约 1 分钟
2025-07-31
样式展示:
PHP代码:
function get_lianlun_dq($aid){
global $dsql;
$row = $dsql->GetOne("select relid from dede_link where aid = $aid and fenlei = 'dq' and xmlx = 'rm' and pos = 'all'");
$ids = str_replace('|', ',', $row['relid']);
$sql = "select typename,typedir from dede_arctype where id in ($ids)";
$dsql->Execute('me', $sql);
$str = '';
while ($row = $dsql->GetArray()) {
$str .= '\<li class="fl t-c"> \<a href="'.$GLOBALS['cfg_basehost'].''.$row['typedir'].'/" title="'.$row['typename'].'一点点官网" target="_blank">'.$row['typename'].'一点点官网\</a>\</li>';
}
if($str == ''){
$typenames = "'大上海'";
$sql = "select typename,typedir from dede_arctype where reid = 17 and typename not in ($typenames) order by rand() limit 20";
$dsql->Execute('me',$sql);
while ($row = $dsql->GetArray()) {
$str .= '\<li class="fl t-c"> \<a href="'.$GLOBALS['cfg_basehost'].''.$row['typedir'].'/" title="'.$row['typename'].'一点点官网" target="_blank">'.$row['typename'].'一点点官网\</a>\</li>';
}
}
return $str;
}
HTML代码:
\<ul class="sdn-lb-list font14 o-h">
{dede:field.id function='get_lianlun_dq(@me)'/}
\</ul>
css样式:
.sdn-lb-box {
padding: 40px 0 57px 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing:border-box;
box-sizing: border-box;
}
.sdn-lb-list {
width: 100%;height: auto;
}
.sdn-lb-list li {
width: auto; height: 36px;line-height: 36px;
border: 1px solid #cecece;
border-radius: 18px;
padding: 0 12px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing:border-box;
box-sizing: border-box;
margin-right: 20px;
margin-bottom: 24px;
}
.sdn-lb-list li a {
color: #5a5a5a;display: block;width: 100%;height: 100%;
}
.sdn-lb-list li:hover {
border: 1px solid #eb5405;
}
.sdn-lb-list li:hover a {
color:#eb5405
}
.t-c{
text-align: center;
}
.fl{
float: left;display: inline;
}
.font14{
font-size: 14px!important;
}
.o-h{
overflow: hidden;
}
更新: 2024-06-13 09:58:39
原文: <https://www.yuque.com/seoers/uyyd4f/qnxhfb>