- เวอร์ชัน XF ที่เข้ากันได้
- 2.3
- VirusTotal reports
- https://www.virustotal.com/gui/file/5d589bbf4e419fdd934761dbaca390ca
VNXF-AdvertisingPlus-1.0.0.zip
MD5: 5d589bbf4e419fdd934761dbaca390ca
SHA-256: 5ffc5b098f02a4eaecd77c974085400e067da41e0f325dc7dd4daa44916640d7
XenForo's default advertising system has always been known for its optimized performance thanks to its static compile-time mechanism, but it is very limited in terms of practical management experience:
- Without a banner posting interface: Administrators are forced to manually write the HTML code for the <img> and <a> tags and find external image storage locations themselves.
- No automatic scheduling: Every time a monthly/quarterly advertising contract is signed, the admin has to make a note of the schedule to manually turn it on/off when it expires.
- Lack of flexible page filters: It's not possible to specify that ads should only be displayed on post pages (thread_view) or category pages (forum_view).
- Lack of standard wrapper tags: The absence of classes and identifying data attributes makes writing CSS to customize the interface or measure views/clicks (tracking analytics) much more difficult.
Key features
1. Upload banner images and visual links.
- Supports choosing between traditional HTML/Script code or Banner Images & Links .
- XenForo's built-in Upload Asset button allows you to upload images directly to the secure data/assets/advertising/ folder or paste your preferred image link.
- Supports separate images for mobile devices (Mobile ≤ 768px) : automatically generates the <picture> and <source media="..." tags in accordance with Responsive Web Design standards.
- The options include destination link, SEO-friendly alt text, the option to open in a new tab (target="_blank"), and the SEO protection attribute rel="nofollow sponsored".
2. Schedule the campaign (Start/End Time)
- Integrates a date picker and time picker for both start and end times.
- Automatically adjusts to the time zone set on the forum system.
- Turn ads on/off precisely to the second, completely automatically, via the system variable $xf.time — no Cron Job needed , no server resource usage.
- Visual status badges in the admin list: [Not yet due], [Running], [Expired].
3. Page filter by Template (= or !=)
- Precisely control the display position according to each interface template:
- All: Display on all pages (default).
- Show Only (=): Appears only on selected pages (e.g., only in thread_view posts).
- Do not display (!=): Hide on unwanted pages (e.g., hide on member_view page, conversation_view page).
- Supports importing template lists separated by commas or line breaks.
4. DOM Wrapper & Tracking Analytics tag
- Each ad is automatically wrapped in a <div> tag with the full identifier:
<div class="vnxf-ad-wrapper vnxf-ad--{ad_id} vnxf-ad--pos-{position_id} {custom_class}"
data-ad-id="{ad_id}"
data-ad-position="{position_id}">
<!-- Ad content -->
</div>
- Allows adding additional customizable CSS Classes (e.g., centering, shadowing, sticky...).
- Easily integrate Google Analytics, Google Tag Manager, or write your own CSS in extra.less.
Detailed user manual
Step 1: Access the Ads Manager.
- Log in to Admin CP .
- On the left-hand navigation menu, go to Setup → Advertising (or access the URL admin.php?advertising/).
- Click the Add advertisement button in the upper right corner.
Step 2: Set up general information
- Title: Give your advertisement a distinctive name (e.g., Banner Header - ABC Company).
- Position: Choose the display location on the forum interface (e.g., Container header, Thread view: Above messages, Forum list: Below nodes...).
- Display order: Enter the priority number if there are multiple ads in the same location.
- Active: Check this box to activate ads.
Step 3: Configure content formatting
The add-on offers two modes:Option A: Banner & Link Image Advertising (Recommended)
- In the Ad Format section , select Banner Image & Link (Upload Asset / URL) .
- Banner Image (Desktop):
- Click the Upload button to select image files from your computer and upload them directly to the forum's asset folder.
- Alternatively, paste the image URL directly if it's hosted on a CDN/external hosting service.
- Mobile Banner Image (Optional):
- If you have a banner designed specifically for mobile phones, either square or in a smaller size, click Upload here.
- When visitors access the site using a device with a screen resolution of ≤ 768px, the system will automatically switch to displaying this banner.
- Destination link (URL): Enter the website address that viewers will see when they click on the banner (e.g., https://doitac.com/khuyen-mai ).
- Alt text: Enter a description of the image to optimize SEO or display it while the image is loading.
- Link options:
- ☑ Open in a new tab: Adding target="_blank" prevents readers from being redirected to the forum.
- ☑ Add the nofollow attribute: Automatically add rel="nofollow sponsored noopener" to the ad link, complying with Google SEO standards.
Option B: Advertising via HTML/Script Code
- Select HTML/JavaScript/Script Code .
- Paste the ad embed code provided by the parties involved (Google AdSense, MGID, partner scripts, etc.).
Step 4: Set up the campaign schedule (Optional)
Expand the Advanced Settings section (Schedule, Template & CSS) :- Start time:
- Choose a start date for the ads.
- Enter a start time (e.g., 08:00). If left blank, the ad will start running immediately.
- End time:
- Choose the end date for the advertising contract.
- Enter the end time (e.g., 23:59).
- At this exact moment, the banner will automatically disappear from the public view without any manual action from the admin.
Step 5: Configure the display page (Template Targeting)
- All pages: Ads will appear on any page containing the selected display location.
- Display only on specified templates (=):
- Select and enter the names of your desired templates in the text box below.
- For example: Enter thread_view, forum_view if you only want ads to appear when viewing forum posts or categories.
- Not displayed on specified templates (!=):
- Select the desired template and enter its name.
- For example: Enter member_view, conversation_view, account_details to hide ads on your profile page and private inbox.
Installation & Upgrade
Install via CLI (Recommended)
php cmd.php xf-addon:install VNXF/AdvertisingPlusInstall via the Admin CP interface.
- Download the zip file VNXF-AdvertisingPlus-1.0.0.zip.
- Go to Admin CP → Add-ons → Install/upgrade from archive .
- Select the zip file and proceed with the automatic installation.
Uninstall
php cmd.php xf-addon:uninstall VNXF/AdvertisingPlus
Compatibility
- XenForo: 2.3.0 or higher (tested perfectly on XenForo 2.3.11).
- PHP: 8.0, 8.1, 8.2, 8.3+.
- Backward compatibility: 100% compatible with XenForo's pre-existing HTML ads.
Copyright
Developed and sponsored by the VNXF community - Vietnam XenForo Forum . All rights reserved.ระบบโฆษณาแบบมาตรฐานของ XenForo ได้เป็นที่รู้จักมาโดยตลอดในด้านประสิทธิภาพที่ได้รับการปรับแต่งให้เหมาะสมที่สุด ด้วยกลไกการคอมไพล์แบบสถิตในขั้นตอนการคอมไพล์ แต่ระบบนี้มีความจำกัดมากในด้านการจัดการในทางปฏิบัติ:
- โดยไม่มีอินเทอร์เฟซการโพสต์แบนเนอร์: ผู้ดูแลระบบต้องเขียนรหัส HTML สำหรับแท็ก <img> และ <a> ด้วยตนเอง และต้องค้นหาตำแหน่งจัดเก็บภาพจากแหล่งภายนอกด้วยตัวเอง
- ไม่มีระบบกำหนดเวลาอัตโนมัติ: ทุกครั้งที่มีการลงนามสัญญาโฆษณาแบบรายเดือน/รายไตรมาส ผู้ดูแลระบบต้องจดบันทึกกำหนดการเพื่อเปิด/ปิดโฆษณาด้วยตนเองเมื่อสัญญาหมดอายุ
- ขาดตัวกรองหน้าที่ยืดหยุ่น: ไม่สามารถกำหนดให้โฆษณาแสดงเฉพาะบนหน้าโพสต์ (thread_view) หรือหน้าหมวดหมู่ (forum_view) ได้
- ขาดแท็ก wrapper มาตรฐาน: การขาดคลาสและแอตทริบิวต์ข้อมูลระบุตัวตน ทำให้การเขียน CSS เพื่อปรับแต่งอินเทอร์เฟซหรือวัดจำนวนการดู/การคลิก (การติดตามข้อมูลวิเคราะห์) ยากขึ้นมาก
คุณสมบัติหลัก
1. อัปโหลดภาพแบนเนอร์และลิงก์ภาพ
- รองรับการเลือกระหว่างรหัส HTML/Script แบบดั้งเดิม หรือภาพแบนเนอร์และลิงก์ .
- ปุ่ม Upload Asset ช่วยให้คุณอัปโหลดภาพโดยตรงไปยังโฟลเดอร์ที่ปลอดภัย data/assets/advertising/ หรือวางลิงก์ภาพที่คุณต้องการ
- รองรับ ภาพแยกต่างหากสำหรับอุปกรณ์มือถือ (Mobile ≤ 768px) : สร้างแท็ก <picture> และ <source media="..." โดยอัตโนมัติตามมาตรฐานการออกแบบเว็บที่ตอบสนอง (Responsive Web Design)
- ตัวเลือกประกอบด้วย ลิงก์ปลายทาง ข้อความ alt ที่เป็นมิตรกับ SEO ตัวเลือกเปิดในแท็บใหม่ (target="_blank") และแอตทริบิวต์ป้องกัน SEO rel="nofollow sponsored"
2. กำหนดเวลาแคมเปญ (เวลาเริ่ม/เวลาสิ้นสุด)
- รวมเครื่องมือเลือกวันที่และเวลาสำหรับทั้งเวลาเริ่มต้นและเวลาสิ้นสุด
- ปรับให้สอดคล้องกับเขตเวลาที่ตั้งค่าไว้ในระบบฟอรั่มโดยอัตโนมัติ
- เปิด/ปิดโฆษณาได้อย่างแม่นยำถึงระดับวินาที โดยอัตโนมัติทั้งหมด ผ่านตัวแปรระบบ $xf.time — ไม่จำเป็นต้องใช้ Cron Job และไม่ใช้ทรัพยากรเซิร์ฟเวอร์
- ไอคอนสถานะแบบภาพในรายการผู้ดูแลระบบ: [ยังไม่ถึงกำหนด], [Running], [Expired].
3. กรองหน้าตามแม่แบบ (= หรือ !=)
- ควบคุมตำแหน่งการแสดงผลอย่างแม่นยำตามแต่ละเทมเพลตอินเทอร์เฟซ:
- ทั้งหมด: แสดงบนทุกหน้า (ค่าเริ่มต้น)
- แสดงเฉพาะ (=): แสดงเฉพาะบนหน้าที่เลือก (เช่น แสดงเฉพาะในโพสต์ของ thread_view)
- ไม่แสดง (!=): ซ่อนบนหน้าที่ไม่ต้องการ (เช่น ซ่อนบนหน้า member_view, หน้า conversation_view)
- รองรับการนำเข้าบัญชีรายชื่อเทมเพลตที่แยกด้วยเครื่องหมายจุลภาคหรือการขึ้นบรรทัดใหม่
4. DOM Wrapper & แท็กวิเคราะห์การติดตาม
- โฆษณาแต่ละชิ้นจะถูกห่อด้วยแท็ก <div> โดยอัตโนมัติ พร้อมด้วยตัวระบุเต็ม:
<div class="vnxf-ad-wrapper vnxf-ad--{ad_id} vnxf-ad--pos-{position_id} {custom_class}"
data-ad-id="{ad_id}"
data-ad-position="{position_id}">
<!-- เนื้อหาโฆษณา -->
</div>
- อนุญาตให้เพิ่ม (เช่น การจัดให้อยู่กลาง การเพิ่มเงา การทำให้ติดหน้าจอ...)
- สามารถผสาน Google Analytics หรือ Google Tag Manager ได้อย่างง่ายดาย หรือเขียน CSS ของคุณเองใน extra.less.
คู่มือผู้ใช้ฉบับละเอียด
ขั้นตอนที่ 1: เข้าสู่ Ads Manager.
- เข้าสู่ระบบ Admin CP .
- ในเมนูนำทางด้านซ้าย ให้ไปที่ ตั้งค่า → โฆษณา (หรือเข้าผ่าน URL admin.php?advertising/).
- คลิกปุ่ม เพิ่มโฆษณา ที่มุมขวาบน
ขั้นตอนที่ 2: ตั้งค่าข้อมูลทั่วไป
- ชื่อ: ตั้งชื่อโฆษณาของคุณให้โดดเด่น (เช่น Banner Header - ABC Company).
- ตำแหน่ง: เลือกตำแหน่งแสดงบนหน้าฟอรั่ม (เช่น ส่วนหัวคอนเทนเนอร์, มุมมองหัวข้อ: เหนือข้อความ, รายการฟอรั่ม: ใต้โหนด...)
- ลำดับการแสดง: ป้อนหมายเลขลำดับความสำคัญหากมีโฆษณาหลายรายการในตำแหน่งเดียวกัน
- เปิดใช้งาน: ทำเครื่องหมายในช่องนี้เพื่อเปิดใช้งานโฆษณา
ขั้นตอนที่ 3: ตั้งค่าการจัดรูปแบบเนื้อหา
ส่วนเสริมนี้มีสองโหมด:ตัวเลือก A: โฆษณาแบบแบนเนอร์และภาพลิงก์ (แนะนำ)
- ในส่วน รูปแบบโฆษณา , ให้เลือก ภาพแบนเนอร์และลิงก์ (อัปโหลดไฟล์ / URL) .
- ภาพแบนเนอร์ (เดสก์ท็อป):
- คลิกปุ่ม Upload เพื่อเลือกไฟล์ภาพจากคอมพิวเตอร์ของคุณและอัปโหลดโดยตรงไปยังโฟลเดอร์ทรัพยากรของฟอรัม
- หรือคุณสามารถวาง URL ของภาพโดยตรงได้ หากภาพนั้นถูกโฮสต์บน CDN หรือบริการโฮสต์ภายนอก
- ภาพแบนเนอร์สำหรับมือถือ (ไม่บังคับ):
- หากท่านมีภาพแบนเนอร์ที่ออกแบบมาโดยเฉพาะสำหรับโทรศัพท์มือถือ ไม่ว่าจะเป็นรูปสี่เหลี่ยมหรือขนาดที่เล็กกว่า ให้คลิก อัปโหลด ที่นี่
- เมื่อผู้เยี่ยมชมเข้าเว็บไซต์ด้วยอุปกรณ์ที่มีความละเอียดหน้าจอ ≤ 768px ระบบจะเปลี่ยนไปแสดงแบนเนอร์นี้โดยอัตโนมัติ
- ลิงก์ปลายทาง (URL): กรอกที่อยู่เว็บไซต์ที่ผู้ชมจะเห็นเมื่อคลิกบนแบนเนอร์ (เช่น, https://doitac.com/khuyen-mai ).
- ข้อความทางเลือก: ป้อนคำอธิบายของภาพเพื่อเพิ่มประสิทธิภาพ SEO หรือแสดงข้อความนี้ระหว่างที่ภาพกำลังโหลด
- ตัวเลือกลิงก์:
- ☑ เปิดในแท็บใหม่: การเพิ่ม target="_blank" จะป้องกันไม่ให้ผู้อ่านถูกเปลี่ยนเส้นทางไปยังฟอรัม
- ☑ เพิ่มแอตทริบิวต์ nofollow: เพิ่ม rel="nofollow sponsored noopener" ลงในลิงก์โฆษณาโดยอัตโนมัติ เพื่อให้สอดคล้องกับมาตรฐาน SEO ของ Google
ตัวเลือก B: การโฆษณาผ่านรหัส HTML/Script
- เลือก HTML/JavaScript/โค้ดสคริปต์ .
- วางรหัสฝังโฆษณาที่ให้โดยฝ่ายที่เกี่ยวข้อง (Google AdSense, MGID, สคริปต์ของพันธมิตร, เป็นต้น).
ขั้นตอนที่ 4: ตั้งค่ากำหนดเวลาแคมเปญ (ไม่บังคับ)
ขยายส่วน การตั้งค่าขั้นสูง (กำหนดเวลา, แม่แบบ & CSS) :- เวลาเริ่มต้น:
- เลือกวันที่เริ่มต้นสำหรับโฆษณา
- ป้อนเวลาเริ่มต้น (เช่น 08:00) หากไม่กรอกข้อมูล โฆษณาจะเริ่มแสดงทันที
- เวลาสิ้นสุด:
- เลือกวันที่สิ้นสุดสัญญาโฆษณา
- ป้อนเวลาสิ้นสุด (เช่น 23:59)
- ในเวลาที่ระบุนี้ แบนเนอร์จะ หายไปโดยอัตโนมัติ จากสายตาผู้ชม โดยไม่ต้องมีการดำเนินการด้วยมือจากผู้ดูแลระบบ
ขั้นตอนที่ 5: กำหนดค่าหน้าแสดงผล (การกำหนดเป้าหมายตามเทมเพลต)
- ทุกหน้า: โฆษณาจะปรากฏบนทุกหน้าที่มีตำแหน่งแสดงที่เลือกไว้
- แสดงเฉพาะบนเทมเพลตที่ระบุ (=):
- เลือกและป้อนชื่อเทมเพลตที่คุณต้องการลงในช่องข้อความด้านล่าง
- ตัวอย่าง: ป้อน thread_view, forum_view หากต้องการให้โฆษณาปรากฏเฉพาะเมื่อดูโพสต์ในฟอรัมหรือหมวดหมู่
- ไม่แสดงบนเทมเพลตที่ระบุ (!=):
- เลือกเทมเพลตที่ต้องการและป้อนชื่อของมัน
- ตัวอย่าง: ป้อน member_view, conversation_view, account_details เพื่อซ่อนโฆษณาบนหน้าโปรไฟล์และกล่องข้อความส่วนตัวของคุณ
การติดตั้งและอัปเกรด
ติดตั้งผ่าน CLI (แนะนำ)
php cmd.php xf-addon:install VNXF/AdvertisingPlusติดตั้งผ่านหน้า Admin CP
- ดาวน์โหลดไฟล์ zip VNXF-AdvertisingPlus-1.0.0.zip
- ไปที่ Admin CP → Add-ons → Install/upgrade from archive .
- เลือกไฟล์ zip และดำเนินการติดตั้งอัตโนมัติ
ถอนการติดตั้ง
php cmd.php xf-addon:ถอนการติดตั้ง VNXF/AdvertisingPlus
ความเข้ากันได้
- XenForo: 2.3.0 หรือสูงกว่า (ผ่านการทดสอบอย่างสมบูรณ์บน XenForo 2.3.11)
- PHP: 8.0, 8.1, 8.2, 8.3+
- ความเข้ากันได้กับเวอร์ชันเก่า: เข้ากันได้ 100% กับโฆษณา HTML ที่มีอยู่เดิมของ XenForo
