PHAHONYOTHIN.COM

กูรู => เครือข่าย => ข้อความที่เริ่มโดย: nattasan ที่ มิถุนายน 17, 2015, 01:05:23 am

หัวข้อ: การใส่โค้ดโฆษณา Adsense โดยไม่ใช้ Mods ของ SMF
เริ่มหัวข้อโดย: nattasan ที่ มิถุนายน 17, 2015, 01:05:23 am
สวัสดีครับ ผมใช้ SMF 2.0.9 ครับ

*** ก่อนทำอย่าลืม Backup ไฟล์ที่เราแก้ไว้หน่อยนะครับ

1. ที่แรกคือไปที่ Folder Theme ที่เราใช้ครับเลือก file -> index.template.php

1.1 กด Search ค้นหา
โค๊ด: [Select]
// Custom banners and shoutboxes should be placed here, before the linktree.
1.2 จากนั้นเติมต่อท้ายที่หาด้านบนด้วย
โค๊ด: [Select]
echo' <hr width="100%" size="1" class="hrcolor" /><center>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- โฆษณาแบบ 728 x 90 ลีดเดอร์บอร์ด (โฆษณาแบบรูปภาพ/สื่อสมบูรณ์) -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="XXXXXXXXX"
     data-ad-slot="XXXXXXXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></center>';

2. อีกที่นึงก็คือใต้ Signature ของ Users ทุกคนครับ

ที่ Theme เดิมเปลี่ยนมาเปิด file->Display.template.php แทนครับ

2.1 จากนั้นค้นหา
โค๊ด: [Select]
<div class="signature" id="msg_', $message['id'], '_signature">', $message['member']['signature'], '</div>';
2.2 จากนั้นเติมต่อท้ายที่หาด้านบนด้วย
โค๊ด: [Select]
echo' <hr width="100%" size="1" class="hrcolor" /><center>
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- โฆษณาแบบ 728 x 90 ลีดเดอร์บอร์ด (โฆษณาแบบรูปภาพ/สื่อสมบูรณ์) -->
<ins class="adsbygoogle"
     style="display:inline-block;width:728px;height:90px"
     data-ad-client="XXXXXXXXX"
     data-ad-slot="XXXXXXXXX"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></center>';

ขอขอบคุณข้อมูลดีๆจาก
http://www.thaiseoboard.com/index.php/topic,38604.40.html

ขอบคุณครับ