SMF SSI.php Functions
Current Version: 2.1.8
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
junjao
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
junjao
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
การลง windows11 ใหม่ บน microsoft surface ทำอย่างไร
ผมแนะนำวิธีใช้ **Microsoft Surface Recovery Image** เพราะเป็นไฟล์ Windows ที่ Microsoft จัดเตรียมให้ตรงกับรุ่น Surface โดยเฉพาะ ช่วยให้ไดรเวอร์ หน้าจอสัมผัส Wi-Fi และอุปกรณ์ต่าง ๆ ทำงานได้ถูกต้อง
## **1. เลือกวิธีติดตั้ง Windows ใหม่**
**วิธีที่ 1: Reset this PC**
- ไม่ต้องใช้ USB
- เลือกเก็บไฟล์ส่วนตัวหรือลบทั้งหมดได้
- เหมาะกับเครื่องที่ยังเข้า Windows ได้
**วิธีที่ 2: USB Recovery Image**
- ล้างและติดตั้ง Windows ใหม่
- ใช้ USB Flash Drive
- เหมาะกับเครื่องค้าง เปิด Windows ไม่ได้ หรือต้องการลงใหม่ทั้งหมด
## **2. ขั้นตอนติดตั้งแบบ USB Recovery (แนะนำ)**
แนะนำ
ใช้ USB Flash Drive ขนาด 32 GB ขึ้นไป
**ขั้นตอนที่ 1: เตรียมอุปกรณ์**
- USB Flash Drive 32 GB ขึ้นไป
- คอมพิวเตอร์อีกเครื่องที่ใช้งาน Windows ได้
- อินเทอร์เน็ต
- สายชาร์จ Surface
**ขั้นตอนที่ 2: ดาวน์โหลด Windows Recovery ของ Surface**
1. เข้าเว็บไซต์ Microsoft: [Surface Recovery Image Download](https://support.microsoft.com/en-us/surface-recovery-image?epb=1\
2. เข้าสู่ระบบ Microsoft Account
3. เลือกรุ่น Surface
4. กรอก Serial Number
5. ดาวน์โหลดไฟล์ Recovery Image (.zip)
**ขั้นตอนที่ 3: สร้าง USB สำหรับติดตั้ง**
1. เสียบ USB เข้าคอมพิวเตอร์
2. ค้นหา `Recovery Drive` ใน Windows
3. เปิด Create a recovery drive
4. เอาเครื่องหมายถูกออกจาก Back up system files
5. เลือก USB แล้วกด Create
6. เมื่อเสร็จแล้ว แตกไฟล์ Recovery Image ที่ดาวน์โหลดมา
7. Copy ไฟล์ทั้งหมดลง USB และเลือก Replace ไฟล์เดิมเมื่อมีข้อความถาม
**ขั้นตอนที่ 4: เริ่มติดตั้ง Windows ใหม่**
1. ปิดเครื่อง Surface
2. เสียบ USB Recovery
3. กดปุ่ม Volume Down ค้างไว้
4. กดปุ่ม Power หนึ่งครั้ง
5. เมื่อโลโก้ Surface ปรากฏ ให้ทำตามขั้นตอนการบูต USB
6. เลือกภาษาและ Keyboard
7. เลือก Recover from a drive
8. เลือก Just remove my files
9. กด Recover เพื่อเริ่มติดตั้งใหม่
Reset Surface ทำอย่างไร
ทำตามลิงค์นี้ https://support.microsoft.com/en-us/surface/drivers-firmware/reset-or-recover-your-surface
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 โดยอัตโนมัติ
-------------------------------------------------
Recent Attachments Function
Code
<?php ssi_recentAttachments(); ?>
Result
| File | Posted by | Downloads | Filesize |
|---|---|---|---|
| junjao | 12 | 119.17KB | |
| junjao | 13 | 216.29KB | |
| junjao | 122 | 256.07KB | |
| junjao | 121 | 253.19KB | |
| junjao | 121 | 194.55KB | |
| junjao | 123 | 279.82KB | |
| junjao | 120 | 196.56KB | |
| junjao | 132 | 58.03KB | |
| junjao | 133 | 70.12KB | |
| junjao | 146 | 181.21KB |
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>