แนะนำ ถามให้หายข้องใจ > ประสปการณ์คนทำเวป
(SMF) เพิ่ม banner หรือ ตัวนับสถิติ บริเวน footer
(1/1)
Phoenix:
อยากใส่banner หรือตัวนับบ้างไม่รู้จะทำอย่างไร ลองค้นๆ จากหลายๆ เวปในที่สุดก็ได้วิธีมาจาก
ได้มาแล้วก็กลัวจะลืม เราเองก็ป้ำๆ เป๋อๆ อยู่ด้วย เอามารวบรวมไว้ดีกว่า
เริ่มแรกต้องรู้ก่อนว่าจะต้องแก้ไขไฟล์ไหน ผมใช้ default theame ครับ วิธีแก้ก็ดังนี้
ไฟล์ที่ต้องแก้ไข [ฟอรั่ม]/Themes/default/index.template.php
บริเวณที่ต้องค้นหาเพื่อทำการแก้ไข
--- Quote --- // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer_section"><div class="frame">';
echo '
<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li><a id="button_xhtml" href="http://validator.w3.org/check/referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';
--- End quote ---
Phoenix:
แก้ไข โดยเพิ่ม code ที่ต้องการเข้าไป ในที่นี้ผมทำไว้เป็นไฟล์ชื่อ banner2.txt โดย upload file ไปไว้ที่ folder หลักของบอร์ดนะครับ
code banner2.txt
--- Quote ---<!-- Histats.com START -->
<a href="http://www.histats.com" target="_blank" title="histats.com" >
<script type="text/javascript" language="javascript">
.....
.....
....
</noscript>
<!-- Histats.com END -->
--- End quote ---
Phoenix:
code เมื่อทำการแก้ไขเสร็จเรียบร้อย
--- Quote --- // Show the "Powered by" and "Valid" logos, as well as the copyright. Remember, the copyright must be somewhere!
echo '
<div id="footer_section"><div class="frame">';
include_once('banner2.txt');
echo '
<ul class="reset">
<li class="copyright">', theme_copyright(), '</li>
<li><a id="button_xhtml" href="http://validator.w3.org/check/referer" target="_blank" class="new_win" title="', $txt['valid_xhtml'], '"><span>', $txt['xhtml'], '</span></a></li>
', !empty($modSettings['xmlnews_enable']) && (!empty($modSettings['allow_guestAccess']) || $context['user']['is_logged']) ? '<li><a id="button_rss" href="' . $scripturl . '?action=.xml;type=rss" class="new_win"><span>' . $txt['rss'] . '</span></a></li>' : '', '
<li class="last"><a id="button_wap2" href="', $scripturl , '?wap2" class="new_win"><span>', $txt['wap2'], '</span></a></li>
</ul>';
--- End quote ---
footballshirt:
ขอบคุณครับ จะได้ไปใช้กับบอร์ดตัวเองบ้าง ;D
Navigation
[0] Message Index
Go to full version