SMF SSI.php Functions
Current Version: 2.1.7
This file is used to demonstrate the capabilities of SSI.php using PHP include functions. The examples show the include tag, then the results of it.
Include Code
To use SSI.php in your page add at the very top of your page before the <html> tag on line 1 of your php file:
<?php require("SSI.php"); ?>
Some notes on usage
All the functions have an output method parameter. This can either be "echo" (the default) or "array"
If it is "echo", the function will act normally - otherwise, it will return an array containing information about the requested task. For example, it might return a list of topics for ssi_recentTopics.
This functionality can be used to allow you to present the information in any way you wish.
Additional Guides & FAQ
Need more information on using SSI.php? Check out Using SSI.php article.
Recent Topics Function
Code (simple mode)
<?php ssi_recentTopics(); ?>
Code (advanced mode)
<?php ssi_recentTopics($num_recent = 8, $exclude_boards = null, $include_boards = null, $output_method = 'echo'); ?>
Result
Recent Posts Function
Code
<?php ssi_recentPosts(); ?>
Result
Top Boards Function
Shows top boards by the number of posts.
Code
<?php ssi_topBoards(); ?>
Result
Top Topics
Shows top topics by the number of replies or views.
Code (show by number of views)
<?php ssi_topTopicsViews(); ?>
Result
Code (show by number of replies)
<?php ssi_topTopicsReplies(); ?>
Result
Top Poster Function
Shows the top poster's name and profile link.Code
<?php ssi_topPoster(); ?>
Result
Latest Member Function
Shows the latest member's name and profile link.
Code
<?php ssi_latestMember(); ?>
Result
Member of the Day
Shows one random member of the day. This changes once a day.
Code
<?php ssi_randomMember('day'); ?>
Result
|
junjao
junjao.com |
Who's Online Function
This function shows who are online inside the forum.
Code
<?php ssi_whosOnline(); ?>
Result
Log Online Presence
This function logs the SSI page's visitor, then shows the Who's Online list. In other words, this function shows who are online inside and outside the forum.
Code
<?php ssi_logOnline(); ?>
Result
Login Function
Shows a login box only when user is not logged in.
Code
<?php ssi_login(); ?>
Result
Logout Function
Shows a logout link only when user is logged in.
Code
<?php ssi_logout(); ?>
Result
Welcome Function
Greets users or guests, also shows user's messages if logged in.
Code
<?php ssi_welcome(); ?>
Result
Today's Calendar Function
Code
<?php ssi_todaysCalendar(); ?>
Result
Today's Birthdays Function
Code
<?php ssi_todaysBirthdays(); ?>
Result
Today's Holidays Function
Code
<?php ssi_todaysHolidays(); ?>
Result
Today's Events Function
Code
<?php ssi_todaysEvents(); ?>
Result
Forum Stats
Shows some basic forum stats: total members, posts, topics, boards, etc.
Code
<?php ssi_boardStats(); ?>
Result
Board News Function
Shows the latest posts from read only boards, or a specific board.
Code
<?php ssi_boardNews(); ?>
Result
junjao.com ได้อัปเดต php เป็นเวอร์ชัน 8.5.12 แล้ว 22/10/2569
ลูกค้าเก่า ที่ใช้ php เวอร์ชันต้องเปลี่ยนใหม่ เข้าหน้าเว็บ admin
การแก้ไขช่องโหว่ php ทำได้อย่างไร
หากคุณใช้งาน PHP ผ่าน Plesk ตามหน้าที่ส่งมาก่อนหน้านี้ ผมแนะนำให้ดำเนินการตามขั้นตอนต่อไปนี้ โดยสำรองข้อมูลก่อนทุกครั้ง เพื่อป้องกันเว็บไซต์ใช้งานไม่ได้หลังอัปเดต
## 1. ตรวจสอบและอัปเดต PHP
ขั้นตอนที่ 1 — ตรวจสอบเวอร์ชัน PHP
เข้า Plesk แล้วเลือก Domains → ชื่อโดเมน → PHP Settings
ตรวจสอบ PHP version, PHP handler และส่วนขยายที่เว็บไซต์ใช้งาน
ขั้นตอนที่ 2 — อัปเดตแพตช์
ตรวจสอบ PHP รุ่นที่ผู้ให้บริการรองรับ และติดตั้งแพตช์ความปลอดภัยล่าสุดที่เหมาะกับเว็บไซต์ หากใช้ PHP รุ่นเก่าที่หมดระยะสนับสนุน ควรวางแผนอัปเกรดไปยังรุ่นที่ยังได้รับการสนับสนุน
ขั้นตอนที่ 3 — ทดสอบหลังอัปเดต
ตรวจสอบหน้าเว็บ ระบบล็อกอิน ฟอร์มอัปโหลดไฟล์ ฐานข้อมูล และ Error Log หากเกิด HTTP 500 ให้ตรวจสอบสาเหตุก่อนปรับเปลี่ยนเวอร์ชันหรือ Handler
## 2. สำคัญมาก: ณ วันที่ 22 ตุลาคม 2026 มีประกาศช่องโหว่ PHP ระดับวิกฤต
ทีม PHP ประกาศเมื่อวันที่ 21 ตุลาคม 2026 ว่า PHP รุ่น 8.5.12, 8.4.27, 8.3.36 และ 8.2.35 แก้ไขช่องโหว่สำคัญ 2 รายการ ได้แก่ CVE-2026-109618 และ CVE-2026-109619 ซึ่งอาจทำให้ผู้โจมตีที่ไม่ได้เข้าสู่ระบบสั่งรันโค้ดบนเซิร์ฟเวอร์จากระยะไกลได้ 
PHP Static
ดังนั้น หากเว็บไซต์ของคุณใช้ PHP 8.5 รุ่นก่อน 8.5.12 ควรอัปเดตทันที แต่หากใช้ 8.5.12 อยู่แล้ว ให้ตรวจสอบว่าเป็นแพตช์ที่ติดตั้งจริงบนเว็บไซต์ ไม่ใช่เพียงมีตัวเลือกเวอร์ชันนี้ใน Plesk
ตรวจสอบรายละเอียดได้ที่ [ประกาศความปลอดภัย PHP อย่างเป็นทางการ](https://static.php.net/?utm_source=chatgpt.com)
## 3. ตั้งค่าความปลอดภัยเพิ่มเติม
| รายการ | สิ่งที่ควรทำ |
| ------------------- | --------------------------------------- |
| `display_errors` | ปิดการแสดงรายละเอียด Error ต่อผู้เข้าชม |
| `log_errors` | เปิดบันทึก Error เพื่อวิเคราะห์ปัญหา |
| `allow_url_include` | ปิด หากไม่มีความจำเป็น |
| `open_basedir` | จำกัดการเข้าถึงไฟล์ตามโฟลเดอร์ที่จำเป็น |
| PHP Extensions | ปิดส่วนขยายที่ไม่ใช้งาน |
| เว็บไซต์และปลั๊กอิน | อัปเดตแพตช์และลบส่วนที่เลิกใช้งาน |
ข้อควรระวัง: การตั้งค่าเหล่านี้ช่วยลดความเสี่ยงบางประเภท แต่ ไม่สามารถใช้แทนแพตช์ PHP ที่แก้ช่องโหว่โดยตรงได้ 
---------------------------------------------------------------
php 8.5.12 FastCGI application กับ php 8.5.12 CGI application ต่างกันอย่างไร
## 1. เปรียบเทียบ FastCGI กับ CGI
PHP 8.5.12 FastCGI application
ประมวลผลต่อเนื่อง
- สามารถนำโปรเซส PHP ที่ทำงานอยู่กลับมาใช้กับคำขอถัดไปได้
- โดยทั่วไปตอบสนองได้เร็วกว่า CGI แบบดั้งเดิม
- เหมาะกับเว็บไซต์ที่มีผู้เข้าชมหลายคนและใช้งานต่อเนื่อง
- อาจใช้หน่วยความจำมากกว่า ขึ้นอยู่กับการตั้งค่าเซิร์ฟเวอร์
อ้างอิง: 
[image](https://www.google.com/s2/favicons?domain=https://www.php.net\&sz=32)
Manual
+1
PHP 8.5.12 CGI application
รูปแบบดั้งเดิม
- ใช้กลไก CGI เพื่อเรียก PHP ประมวลผลคำขอ
- ในรูปแบบ CGI ดั้งเดิม อาจต้องสร้างโปรเซสใหม่บ่อยครั้ง
- โดยทั่วไปมีค่าใช้จ่ายในการประมวลผลต่อคำขอสูงกว่า FastCGI
- อาจเหมาะกับระบบเดิมที่กำหนดให้ใช้ CGI โดยเฉพาะ
อ้างอิง: 
[image](https://www.google.com/s2/favicons?domain=https://www.php.net\&sz=32)
Manual
+1
## 2. ตารางเปรียบเทียบ
| หัวข้อ | FastCGI | CGI |
| ---------------------- | --------------------- | -------------------------- |
| ความเร็วโดยทั่วไป | เร็วกว่า | ช้ากว่า |
| การใช้โปรเซสซ้ำ | ได้ | CGI ดั้งเดิมมักไม่ได้ |
| การใช้ RAM | อาจสูงกว่า | มักต่ำกว่าในบางรูปแบบ |
| เว็บไซต์ที่มีผู้ใช้มาก | เหมาะกว่าโดยทั่วไป | อาจรองรับได้จำกัดกว่า |
| ความเข้ากันได้ | ต้องตรวจสอบการตั้งค่า | ต้องตรวจสอบการตั้งค่า |
| ความปลอดภัย | ขึ้นกับการตั้งค่า | ต้องตั้งค่าอย่างระมัดระวัง |
หมายเหตุ: ประสิทธิภาพจริงขึ้นกับ Web Server, RAM, ส่วนขยาย PHP และการตั้งค่าโฮสติ้งด้วย
## 3. ควรเลือกตัวไหนสำหรับเว็บไซต์ของคุณ?
หากกำลังตั้งค่า PHP ใน Plesk สำหรับเว็บไซต์ทั่วไป เช่น เว็บไซต์สมาชิก เว็บบอร์ด SMF หรือเว็บไซต์ที่พัฒนาด้วย PHP ผมแนะนำแนวทางดังนี้
- เลือก FastCGI ก่อน หากเว็บไซต์และโฮสติ้งรองรับ เพราะโดยทั่วไปจัดการคำขอได้มีประสิทธิภาพกว่า CGI แบบดั้งเดิม
- เลือก CGI เมื่อเว็บไซต์หรือผู้ให้บริการโฮสติ้งกำหนดให้ใช้ หรือมีเหตุผลด้านความเข้ากันได้โดยเฉพาะ
- หากเปลี่ยนแล้วเกิด HTTP 500 ให้ตรวจสอบ Error Log, สิทธิ์ไฟล์ และการตั้งค่า PHP ก่อนสลับกลับ
## 4. ข้อควรระวังก่อนเปลี่ยน PHP
แม้ทั้งสองตัวจะเป็นเวอร์ชัน 8.5.12 เหมือนกัน แต่ไม่ได้รับประกันว่าเว็บไซต์จะทำงานเหมือนกันทุกประการ และการเปลี่ยน Handler ไม่ได้แก้ปัญหาความเข้ากันได้ของโค้ด PHP โดยอัตโนมัติ
-------------------------------------------------
USB Adapter Wi-fi เริ่มต้น ถึงปัจจุบันมีรุ่นใด และความเร็วเท่าไร
### ตารางพัฒนาการ USB Wi-Fi
| ยุค | มาตรฐาน | ชื่อ Wi-Fi | ความถี่ | ความเร็วสูงสุดโดยทฤษฎี | ความเร็วใช้งานจริงโดยประมาณ |
| -------- | ----------- | ------------ | ----------- | ---------------------: | --------------------------: |
| 1999 | 802.11b | — | 2.4 GHz | **11 Mbps** | ~5–6 Mbps |
| 2003 | 802.11g | — | 2.4 GHz | **54 Mbps** | ~20–30 Mbps |
| 2009 | 802.11n | **Wi-Fi 4** | 2.4/5 GHz | **600 Mbps** | ~150–400 Mbps |
| 2012–13 | 802.11ac | **Wi-Fi 5** | 5 GHz | **6.9 Gbps*** | ~500–1,000+ Mbps |
| 2019 | 802.11ax | **Wi-Fi 6** | 2.4/5 GHz | **9.6 Gbps*** | ~600–1,500 Mbps |
| 2020 | 802.11ax | **Wi-Fi 6E** | 2.4/5/6 GHz | **9.6 Gbps*** | ~800–2,000 Mbps |
| 2024 | 802.11be | **Wi-Fi 7** | 2.4/5/6 GHz | ~23 Gbps* | ~1–5+ Gbps |
| ปัจจุบัน | USB Wi-Fi 7 | **BE6500** | 2.4/5/6 GHz | **6.5 Gbps** | ขึ้นกับ Router/PC |
* เป็นค่าระดับ PHY สูงสุด ไม่ใช่ความเร็วที่ดาวน์โหลดได้จริงจากอินเทอร์เน็ต ([Intel][1])
### USB Wi-Fi รุ่นที่พบในตลาดปัจจุบัน
ระดับที่นิยมจะประมาณนี้:
**Wi-Fi 4**
* USB 802.11n
* 150 / 300 / 600 Mbps
* เหมาะกับเครื่องเก่า เช่น Windows 7/XP
* ราคาถูกมาก
**Wi-Fi 5**
* AC600
* AC1200
* AC1300
* AC1900
* AC2100
* ความเร็ว USB รุ่นดี ๆ ประมาณ 300–900 Mbps จริง
**Wi-Fi 6**
* AX1800
* AX3000
* AX5400
* เหมาะกับ Windows 10/11
* ถ้า Router เป็น Wi-Fi 6 จะเห็นประโยชน์ชัดเจนกว่า AC
**Wi-Fi 7 — รุ่นใหม่สุดสำหรับ USB**
ตัวอย่าง TP-Link Archer TBE400UH มีความเร็วรวมสูงสุด **6.5 Gbps**
* 6 GHz = **2,882 Mbps**
* 5 GHz = **2,882 Mbps**
* 2.4 GHz = **688 Mbps**
* รวม = **6,452 Mbps ≈ 6.5 Gbps**
* USB 3.0
* Tri-Band
* MLO
* 4K-QAM
* รองรับ Windows 10/11 64-bit ([TP-Link][2])
นอกจากนี้ TBE400U เป็นรุ่นขนาดเล็กที่ใช้ได้ทั้ง USB-A และ USB-C และมีสเปก BE6500 เช่นเดียวกัน ([TP-Link][3])




### แต่มีจุดสำคัญมาก
ตัวเลข **6,500 Mbps ไม่ได้หมายความว่าจะดาวน์โหลด Internet ได้ 6,500 Mbps**
ต้องดูทั้งระบบ:
**PC → USB 3.0 → Wi-Fi Adapter → Wi-Fi Router → LAN/Internet**
เช่น หาก Internet ของคุณมีความเร็ว 500 Mbps ต่อให้ซื้อ BE6500 ก็ยังดาวน์โหลด Internet ได้สูงสุดใกล้ ๆ **500 Mbps** เท่านั้น
แต่ถ้าใช้ส่งไฟล์ระหว่าง PC กับ NAS/PC อีกเครื่องในบ้าน ความเร็ว Wi-Fi 6/7 จะมีประโยชน์มากกว่า
### ถ้าเอามาใช้กับเครื่องเก่าของคุณ
ถ้าคุณกำลังถามต่อจากเรื่อง **Windows XP / เครื่องเก่า** ที่คุยกันก่อนหน้านี้ ผมแนะนำให้แยกเป็น 3 กรณี:
| เครื่อง | USB Wi-Fi ที่เหมาะ |
| --------------------------- | ------------------------------ |
| Windows XP | **802.11n 300 Mbps** |
| Windows 7/10 | **AC1200 / AC1300** |
| Windows 11 | **Wi-Fi 6 AX3000** |
| Windows 11 + Router Wi-Fi 7 | **Wi-Fi 7 BE6500** |
| ต้องการระยะไกล | รุ่น **High-Gain + เสาภายนอก** |
**ถ้าต้องการความคุ้มค่าในปี 2026 ผมมองว่า Wi-Fi 6 AX3000 เป็นจุดคุ้มที่สุด** ส่วน Wi-Fi 7 BE6500 เหมาะกับคนที่มี Router Wi-Fi 7 และ Internet/เครือข่ายภายในความเร็วสูงจริง ๆ
ถ้าคุณบอก **รุ่น PC + Windows ที่ใช้ + รุ่น Router + ความเร็ว Internet (เช่น 500/500 หรือ 1000/1000 Mbps)** ผมสามารถเลือก **USB Wi-Fi ที่แรงที่สุดและคุ้มที่สุด 5 รุ่น** ให้ได้ครับ.
[1]: https://www.thailand.intel.com/content/www/th/th/support/articles/000045852/wireless/legacy-intel-wireless-products.html?utm_source=chatgpt.com "ความแตกต่างระหว่างโปรโตคอล Wi-Fi และอัตราข้อมูล"
[2]: https://www.tp-link.com/th/home-networking/high-gain-adapter/archer-tbe400uh/?utm_source=chatgpt.com "Archer TBE400UH | BE6500 Wi-Fi 7 High Gain Wireless USB Adapter | TP-Link ประเทศไทย"
[3]: https://www.tp-link.com/us/home-networking/usb-adapter/archer-tbe400u/?utm_source=chatgpt.com "Archer TBE400U | BE6500 Tri-Band Wi-Fi 7 Mini Wireless USB Adapter | TP-Link"
------------------------------------------------------------
ถ้าหมายถึง **Wi-Fi AX300** หรือ **AX300** ต้องระวังว่าตัวเลขนี้อาจหมายถึงความเร็วรวมของอะแดปเตอร์ ไม่ใช่ความเร็วจริงที่ใช้งานได้
### AX300 = ประมาณ 300 Mbps
โดยทั่วไปอาจเป็นการระบุว่า
* **ความเร็วสูงสุดทางทฤษฎี:** ~300 Mbps
* **ความเร็วใช้งานจริง:** ประมาณ **100–200 Mbps** ขึ้นกับ Router, ระยะทาง, สัญญาณ และ USB
* 300 Mbps = **37.5 MB/s** ทางทฤษฎี
* ในการใช้งานจริงอาจอยู่ประมาณ **12–25 MB/s**
แต่ถ้าคุณหมายถึง **AX3000** (มีศูนย์อีกหนึ่งตัว) จะต่างกันมาก:
| รุ่น | ความเร็วรวมโดยทฤษฎี |
| ---------------- | -----------------------: |
| AX300 | ~300 Mbps |
| **AX3000** | **~3,000 Mbps (3 Gbps)** |
| AX5400 | ~5,400 Mbps |
| BE6500 (Wi-Fi 7) | ~6,500 Mbps |
**สรุป:** ถ้ากำลังเลือก USB Wi-Fi ผมแนะนำดูให้ชัดว่าเป็น **AX300 หรือ AX3000** เพราะความเร็วต่างกันประมาณ **10 เท่า**.
----------------------------------------------
windows11 เมนูตรวจสอบการทำงาน SSD
ถ้าต้องการ ตรวจสอบการทำงาน/สุขภาพ SSD ใน Windows 11 มีเมนูหลัก ๆ ดังนี้
1. ตรวจสุขภาพ SSD แบบง่ายที่สุด
กด Win + I → System → Storage → Advanced storage settings → Disks & volumes
เลือก SSD ที่ต้องการ → Properties
จะเห็นข้อมูล เช่น
รุ่น SSD
ความจุ
อุณหภูมิ (ถ้าไดรฟ์รองรับ)
Health / Drive health
อายุการใช้งานโดยประมาณ
ความเร็ว/ข้อมูลไดรฟ์บางส่วน
2. ตรวจสอบว่า SSD มีปัญหาหรือไม่ด้วย Windows
เปิด Terminal / PowerShell แบบ Administrator แล้วพิมพ์
Get-PhysicalDisk | Select FriendlyName, MediaType, HealthStatus, OperationalStatus
ตัวอย่างผลที่ดี:
FriendlyName MediaType HealthStatus OperationalStatus
Samsung SSD 970 SSD Healthy OK
ถ้าขึ้น Healthy / OK ถือว่า Windows ตรวจพบ SSD ทำงานปกติ
3. ตรวจสอบอายุและรายละเอียด SSD
กด Ctrl + Shift + Esc → Performance → Disk
จะเห็น
การใช้งาน SSD %
Read speed
Write speed
Capacity
Active time
ถ้าคุณต้องการ ตรวจ SSD ว่าเสื่อมกี่ % / เหลืออายุเท่าไร / TBW เท่าไร ผมแนะนำให้ตรวจด้วยโปรแกรมอย่าง CrystalDiskInfo เพราะ Windows 11 แสดงข้อมูลสุขภาพ SSD ได้ไม่ละเอียดเท่า SMART
--------------------------------------------
Recent Attachments Function
Code
<?php ssi_recentAttachments(); ?>
Result
| File | Posted by | Downloads | Filesize |
|---|---|---|---|
| junjao | 20 | 58.03KB | |
| junjao | 20 | 70.12KB | |
| junjao | 25 | 181.21KB | |
| junjao | 23 | 186.8KB | |
| junjao | 30 | 365.96KB | |
| junjao | 32 | 334.93KB | |
| junjao | 29 | 178.88KB | |
| junjao | 32 | 842.6KB | |
| junjao | 34 | 877.2KB | |
| junjao | 32 | 138.07KB |
Show Single Poll
Shows a poll in the specified topic.
Code
<?php ssi_showPoll($topicID); ?>
Result
Show Single Post
Fetches a post with a particular IDs. By default will only show if you have permission to the see the board in question. This can be overridden by passing the 2nd parameter as true.
Code
<?php ssi_fetchPosts($postIDs, $isOverride); ?>
Result
Show Single Member
Shows the specified member's name and profile link.
Code
<?php ssi_fetchMember($memberIDs); ?>
Result
Show Group Members
Shows all members in a specified group.
Code
<?php ssi_fetchGroupMembers($groupIDs); ?>
Result
Home Page Sample
This sample uses the following features: ssi_recentTopics(), ssi_logOnline(), ssi_welcome(), and ssi_boardNews(). ssi_recentTopics() is fetched using the array method, to allow further customizations on the output.Code
<?php require("SSI.php"); ?>
<!DOCTYPE html>
<html>
<head>
<title>SSI.php example for home page</title>
<style>
body { font-family: Arial, Tahoma, sans-serif; font-size: 80%; background: #DFDFDF; color: #FFFFFF; margin: 0 }
ul,ol { padding-left: 19px; margin: 0; }
li { font-size: 11px; }
h1,h2,h3 { margin: 0; padding: 0; }
h3 { font-size: 15px; }
a:link,a:visited { color: #FF9000; text-decoration: none; }
a:hover { text-decoration: underline; }
#container { background: #52514E; width: 100%; border: 1px solid midnightblue; line-height: 150%; margin: 0; }
#header,#footer { color: lightgray; background-color: #2A2825; clear: both; padding: .5em; }
#leftbar { background: #DF7E00; float: left; width: 160px; margin: 0; padding: 1em; }
#leftbar a { color: #000000; text-decoration: underline; }
#content { margin-left: 190px; padding: 1em; }
#navigation { float: right; }
#navigation a:link,#navigation a:visited { color: #FF9000; }
</style>
</head>
<body>
<div id="container">
<div id="header">
<div id="navigation">
<a href="#">Link</a> | <a href="#">Link</a> | <a href="#">Link</a> | <a href="#">Link</a> | <a href="#">Link</a>
</div>
<h1 class="header">YourWebsite.com</h1>
</div>
<div id="leftbar">
<h3>Recent Forum Topics</h3>
<ul>
<?php
// Using array method to show shorter display style.
$topics = ssi_recentTopics(8, null, null, 'array');
foreach ($topics as $topic)
{
// Uncomment the following code to get a listing of array elements that SMF provides for this function.
// echo '<pre>', print_r($topic), '</pre>';
echo '
<li><a href=\"', $topic['href'], '\">', $topic['subject'], '</a> ', $txt['by'], ' ', $topics[$i]['poster']['link'], '</li>';
}
unset($topics);
?>
</ul><br>
<h3>Online Users</h3>
<?php ssi_logOnline(); ?>
</div>
<div id="content">
<?php ssi_welcome(); ?><br><br>
<h2>News</h2>
<?php ssi_boardNews(); ?>
</div>
<div id="footer">
<a target="_blank" rel="noopener" rel="license" href="https://creativecommons.org/licenses/publicdomain/"><img alt="Creative Commons License" style="border-width:0" src="https://i.creativecommons.org/l/publicdomain/88x31.png"></a>
This sample website layout is dedicated to the <a target="_blank" rel="noopener" rel="license" href="https://creativecommons.org/licenses/publicdomain/">Public Domain</a>.
</div>
</div>
</body>
</html>