qzuser1212 發表於 2023-2-4 23:40:33

【开源模板】Discuz!X3.5自适应模板兼容Discuz!X3.4过程记录

<br /><blockquote>极简蓝自适应模板是一款响应式模板,在官方默认模板的基础上进行了手机+平板+pc自适应优化。兼容宽窄模式切换,可在模板编辑页面更换颜色,兼容5种风格样式。</blockquote><br />本帖是记录在X3.5环境开发的<strong><font size="3">极简蓝自适应模板 </font></strong>适配Discuz!X3.4的过程。<br /><strong>不一定适用所有模板,仅做备份参考。</strong><br /><img title="千库编辑_电子产品展示样机.jpg" id="aimg_19719" aid="19719" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/202302/05/202109x4l7j7tocpj2jz1u.jpg" src="https://www.dismall.com/data/attachment/forum/202302/05/202109x4l7j7tocpj2jz1u.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="480" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /><br /><font style="color:rgb(64, 72, 91)"><font face="-apple-system, &amp;quot;"><font style="font-size:14px">本模板已经开源在gitee,开源版基本已经稳定, 开源版不会跟随线上版本更新,可以作为学习或二次开发后商用,不可二次出售或上架应用市场。</font></font></font><br /><font size="3"><font color="#ff0000"><strong>开源源码下载地址</strong></font></font>:<br /><br /><font size="5">1. 在线会员图标异常</font><br />forum/discuz.htm<br /><ol><li>&lt;img src=&quot;$online&quot; alt=&quot;icon&quot; /&gt;</ol>改为<br /> &lt;!--{eval $dz_version_num = str_ireplace('X','',$_G['setting']['version']);}--&gt; <br />&lt;!-- {if&nbsp;&nbsp;$<font style="background-color:rgb(247, 247, 247)">dz</font>_version_num&gt;3.4 } --&gt;<br />&nbsp; &nbsp;&lt;img src=&quot;$online&quot; alt=&quot;icon&quot; /&gt;<br />&lt;!-- {else} --&gt;<br />&nbsp; &nbsp;&lt;img src=&quot;{STATICURL}image/common/$online&quot; alt=&quot;icon&quot; /&gt;<br />&lt;!--{/if}--&gt;<br /> <br /><font size="5">2. 页面及发帖时会显示 or ''</font><br />直接搜索 or ''&nbsp;&nbsp;替换为空(这个应该是空值占位,不知道会不会出问题,目前没有遇到问题<br /><br /><font size="5">3. 右侧悬浮菜单 返回顶部及快速发帖图标不显示</font><br /><font size="2">如果引入Discuz!X3.5的字体就太大了没必要 只有三个字体图标 到iconfont上找了三个替换了</font><br /><font size="2"><br /></font><br /><ol><li><br /><li>/* 右侧悬浮菜单 */<br /><li>@font-face {<br /><li>&nbsp; &nbsp; font-family: &quot;iconfont&quot;; /* Project id 3880532 */<br /><li>&nbsp; &nbsp; src: url('//at.alicdn.com/t/c/font_3880532_hz1e9dvrmvg.woff2?t=1675524232880') format('woff2'),<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;url('//at.alicdn.com/t/c/font_3880532_hz1e9dvrmvg.woff?t=1675524232880') format('woff'),<br /><li>&nbsp; &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;url('//at.alicdn.com/t/c/font_3880532_hz1e9dvrmvg.ttf?t=1675524232880') format('truetype');<br /><li>&nbsp;&nbsp;}<br /><li>&nbsp;&nbsp;<br /><li>&nbsp;&nbsp;.iconfont {<br /><li>&nbsp; &nbsp; font-family: &quot;iconfont&quot; !important;<br /><li>&nbsp; &nbsp; font-size: 16px;<br /><li>&nbsp; &nbsp; font-style: normal;<br /><li>&nbsp; &nbsp; -webkit-font-smoothing: antialiased;<br /><li>&nbsp; &nbsp; -moz-osx-font-smoothing: grayscale;<br /><li>&nbsp;&nbsp;}<br /><li>&nbsp;&nbsp;<br /><li>#scrolltop {<br /><li>&nbsp; &nbsp; background: transparent !important;<br /><li>&nbsp; &nbsp; border: none !important;<br /><li>&nbsp; &nbsp; z-index: 999;<br /><li>}<br /><li><br /><li>#scrolltop a {<br /><li>&nbsp; &nbsp; background: var(--base);<br /><li>&nbsp; &nbsp; color: var(--white-bg);<br /><li>&nbsp; &nbsp; border-radius: 4px;<br /><li>&nbsp; &nbsp; margin-top: 8px;<br /><li>&nbsp; &nbsp; line-height: 30px !important;<br /><li>&nbsp; &nbsp; height: 30px !important;<br /><li>&nbsp; &nbsp; padding: 5px !important;<br /><li>}<br /><li><br /><li>#scrolltop a:before {<br /><li>&nbsp; &nbsp; line-height: 30px !important; <br /><li>&nbsp; &nbsp; display:inline-block;<br /><li>&nbsp; &nbsp; font-family: &quot;iconfont&quot; !important;<br /><li>&nbsp; &nbsp; font-size: 16px;<br /><li>&nbsp; &nbsp; font-style: normal;<br /><li>&nbsp; &nbsp; -webkit-font-smoothing: antialiased;<br /><li>&nbsp; &nbsp; -moz-osx-font-smoothing: grayscale;<br /><li>&nbsp; &nbsp; width:24px;<br /><li>&nbsp; &nbsp; font-size:24px;<br /><li>&nbsp; &nbsp; line-height:24px;<br /><li>}<br /><li> <br /><li>#scrolltop a.scrolltopa:before {<br /><li>&nbsp; &nbsp; content:&quot;\e633&quot;;<br /><li>}<br /><li>#scrolltop a.replyfast:before {<br /><li>&nbsp; &nbsp; content:&quot;\e6ba&quot;;<br /><li>}<br /><li>#scrolltop a.returnlist:before, #scrolltop a.returnboard:before {<br /><li>&nbsp; &nbsp; content:&quot;\e712&quot;;<br /><li>}</ol><br /><br /><font size="5">4. 发帖和回复按钮</font><br /><ol><li><br /><li>.pg_group #newspecial,<br /><li>.pg_forumdisplay #newspecial,<br /><li>.pg_viewthread #newspecial, .pgs #post_reply, .pgs #post_replytmp {<br /><li>&nbsp; &nbsp; <br /><li>&nbsp;&nbsp;<br /><li>&nbsp; &nbsp; padding: 0px 16px;<br /><li>&nbsp; &nbsp; background: var(--base);<br /><li>&nbsp; &nbsp; color: var(--white-bg);<br /><li>&nbsp; &nbsp; font-size: 14px;<br /><li>&nbsp; &nbsp;border-radius: 4px;<br /><li>&nbsp; &nbsp;letter-spacing: 2px;<br /><li>&nbsp; &nbsp; height: 26px;<br /><li>&nbsp; &nbsp; line-height: 26px;<br /><li>}</ol><font size="5">5.底部copyright显示异常</font><br /><br /><ol><li>&lt;p class=&quot;xs0&quot;&gt;{lang copyright}&lt;/p&gt;</ol><br /><font size="2"><br /></font><br /><font size="2">改为:</font><br /><ol><li>&lt;blockquote&gt;&lt;!--{eval $dz_version_num = str_ireplace('X','',$_G['setting']['version']);}--&gt;</ol><br /><br /><font size="5"><br />6.编辑器图标异常</font><br /> forum/post_editor_body.htm<br /><ol><li>&lt;img src=&quot;$bbcode&quot; title=&quot;$bbcode&quot; alt=&quot;$tag&quot; /&gt;</ol><br />改为<br /><br /><ol><li>&lt;!--{eval $dz_version_num = str_ireplace('X','',$_G['setting']['version']);}--&gt;<br /><li>&lt;!-- {if&nbsp; &nbsp;$dz_version_num&gt;3.4 } --&gt;<br /><li>&lt;img src=&quot;$bbcode&quot; title=&quot;$bbcode&quot; alt=&quot;$tag&quot; /&gt;<br /><li>&lt;!-- {else} --&gt;<br /><li>&lt;img src=&quot;{STATICURL}image/common/$bbcode&quot; title=&quot;$bbcode&quot; alt=&quot;$tag&quot; /&gt;<br /><li>&lt;!-- {/if} --&gt;</ol><br /><br /><br /><br /><br /><br />模板<em>, </em>size<em>, </em>适应<em>, </em>开源<em>, </em>url

qzuser1212 發表於 2023-2-5 15:28:58

编辑器问题已解决

用户已删除 發表於 2023-2-5 16:23:32

<br /><br /><img title="截图202302051814168249.jpg" id="aimg_19718" aid="19718" src1="static/image/common/none.gif" zoom="https://www.dismall.com/data/attachment/forum/202302/05/181416u659m975atcmz57c.jpg" src="https://www.dismall.com/data/attachment/forum/202302/05/181416u659m975atcmz57c.jpg" class="zoom" onclick="zoom(this, this.src, 0, 0, 0)" width="580" inpost="1" onmouseover="showMenu({'ctrlid':this.id,'pos':'12'})" /><br /><br /><br />$_G['setting']['version']出来的是带“X”的,所以去掉下“X”再比较大小<br /><br /><font color="#ff0000">&lt;!--{eval $zz_version_num = str_ireplace('X','',$_G['setting']['version']);}--&gt;</font><br />&lt;!-- {if&nbsp;&nbsp;$zz_version_num&gt;3.4 } --&gt;<br />&nbsp; &nbsp;&lt;img src=&quot;$online&quot; alt=&quot;icon&quot; /&gt;<br />&lt;!-- {else} --&gt;<br />&nbsp; &nbsp;&lt;img src=&quot;{STATICURL}image/common/$online&quot; alt=&quot;icon&quot; /&gt;<br />&lt;!--{/if}--&gt;<br /><br /><br /><br />

onetheme 發表於 2023-2-5 18:16:45

<br />好的 学习了。不过很奇怪,那个代码居然也生效了。

qzuser1212 發表於 2023-2-5 18:19:09

<br />好像的确能用

onetheme 發表於 2023-2-5 18:29:06

<br />开源介绍里写了你不看<br /><img id="aimg_Wz1QO" onclick="zoom(this, this.src, 0, 0, 0)" class="zoom" src="https://pic.imgdb.cn/item/63df8a304757feff335462a4.png" onmouseover="img_onmouseoverfunc(this)" lazyloadthumb="1" border="0" alt="" />

用户已删除 發表於 2023-2-5 18:46:16

支持一下吧~
頁: [1]
查看完整版本: 【开源模板】Discuz!X3.5自适应模板兼容Discuz!X3.4过程记录