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
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
Dell Latitude 3400 เสียงไม่ออก ลง Windows11 รวม Driver Pack
https://www.dell.com/support/kbdoc/en-th/000199372/latitude-3400-windows-11-driver-pack
แก้ไข driver sound ให้เหมือนเดิมตลอด ทำอย่างไร คอมจะเปลี่ยนเองตลอดเวลา
ถ้าต้องการให้ **Sound Driver คงที่ ไม่เปลี่ยนเอง** แนะนำทำตามลำดับนี้ครับ
### 1. ตรวจสอบก่อนว่า Windows กำลังสลับ Driver ตัวไหน
กด **Win + X → Device Manager**
ไปที่
**Sound, video and game controllers**
ดูว่ามีตัวไหน เช่น
* Realtek(R) Audio
* High Definition Audio Device
* Intel(R) Display Audio
* NVIDIA/AMD High Definition Audio
ถ้าเครื่องมีทั้ง **Realtek + High Definition Audio Device** และ Windows เปลี่ยนไปมา อาจเป็นสาเหตุหลัก
---
### 2. ถอน Driver ที่ Windows ลงผิด แล้วติดตั้ง Driver ของเครื่องใหม่
ใน Device Manager:
1. คลิกขวา Sound Device
2. เลือก **Uninstall device**
3. ติ๊ก **Attempt to remove the driver for this device** ถ้ามี
4. Restart เครื่อง
5. ติดตั้ง **Sound Driver จากเว็บไซต์ผู้ผลิต Mainboard/Notebook โดยตรง**
**ไม่แนะนำให้ใช้ Driver Booster หรือโปรแกรมค้นหา Driver อัตโนมัติ** เพราะอาจทำให้ Windows เปลี่ยน Driver กลับไปมา
---
### 3. ป้องกัน Windows Update ไม่ให้เปลี่ยน Driver
กด
**Win + R**
พิมพ์
`sysdm.cpl`
ไปที่
**Hardware → Device Installation Settings**
เลือก
**No (your device might not work as expected)**
แล้วกด Save Changes
จากนั้น Restart
---
### 4. ถ้าเป็น Windows 11 Pro ให้ปิด Driver Update ผ่าน Group Policy
กด **Win + R** แล้วพิมพ์
`gpedit.msc`
ไปที่:
**Computer Configuration → Administrative Templates → Windows Components → Windows Update → Manage updates offered from Windows Update**
เปิด
**Do not include drivers with Windows Updates**
เลือก
**Enabled**
กด Apply → OK → Restart
วิธีนี้เหมาะมากถ้า Windows 11 ชอบเอา Driver Sound รุ่นใหม่มาทับ Driver เดิม
---
### 5. ถ้าปัญหาคือ "เสียงออกผิดอุปกรณ์" ไม่ใช่ Driver เปลี่ยน
เช่น ทุกครั้งที่เปิดเครื่อง Windows เปลี่ยนจาก
**Speakers (Realtek Audio)**
ไปเป็น
**Intel Display Audio / HDMI / NVIDIA Audio**
ให้เข้า:
**Settings → System → Sound**
แล้วเลือก **Output** เป็นลำโพงที่ต้องการ
จากนั้นไปที่
**More sound settings → Playback**
คลิกขวาอุปกรณ์ที่ต้องการ → **Set as Default Device**
---
-------------------------------------------------------
Windows 11 ขึ้น error Preparing Automatic Repair แก้ไขอย่างไร
* ไฟดับหรือเครื่องปิดกะทันหัน
* ไฟล์ระบบ Windows เสียหาย
* SSD/HDD มีปัญหา
* Windows Update ผิดพลาด
* Driver หรือ Boot Configuration เสีย
ให้ลองแก้ไขตามลำดับจากง่ายไปยาก ดังนี้
---
## วิธีที่ 1 ตรวจสอบอุปกรณ์ภายนอก
ถอดอุปกรณ์ทั้งหมดออก เช่น
* USB Flash Drive
* External HDD
* Printer
* Card Reader
จากนั้น Restart เครื่องอีกครั้ง
---
## วิธีที่ 2 เข้า Windows Recovery (WinRE)
ถ้าเข้าไม่ได้
1. เปิดเครื่อง
2. เมื่อเห็นโลโก้ Windows กดปุ่ม Power ค้างจนดับ
3. ทำซ้ำ 3 ครั้ง
Windows จะขึ้น
```
Preparing Automatic Repair
```
แล้วเข้าสู่
```
Choose an option
```
เลือก
```
Troubleshoot
→ Advanced options
```
---
## วิธีที่ 3 Startup Repair
เลือก
```
Startup Repair
```
ให้ Windows ซ่อมตัวเอง
หากสำเร็จเครื่องจะบูตได้ทันที
---
## วิธีที่ 4 System Restore
ถ้ามี Restore Point
```
Troubleshoot
→ Advanced options
→ System Restore
```
ย้อนกลับก่อนเกิดปัญหา
---
## วิธีที่ 5 ถอน Windows Update
หากเพิ่งอัปเดต
```
Advanced options
→ Uninstall Updates
```
เลือก
```
Uninstall latest quality update
```
ถ้าไม่ได้
เลือก
```
Uninstall latest feature update
```
---
# วิธีที่ 6 ใช้ Command Prompt ซ่อมระบบ
เลือก
```
Advanced options
→ Command Prompt
```
### ตรวจสอบไดรฟ์ Windows
พิมพ์
```cmd
diskpart
list volume
exit
```
ดูว่า Windows อยู่ไดรฟ์อะไร
เช่น
```
C:
```
หรือ
```
D:
```
---
### ตรวจสอบดิสก์
สมมุติ Windows อยู่ C:
```cmd
chkdsk C: /f /r
```
รอจนเสร็จ
---
### ตรวจสอบไฟล์ระบบ
```cmd
sfc /scannow /offbootdir=C:\ /offwindir=C:\Windows
```
---
### ซ่อม Boot
```cmd
bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd
```
---
หาก
```
bootrec /fixboot
Access is denied
```
ให้ใช้
```cmd
bootsect /nt60 sys
```
แล้วรัน
```cmd
bootrec /fixboot
```
อีกครั้ง
---
## วิธีที่ 7 ตรวจสอบ BCD
รัน
```cmd
bcdedit
```
หาก Error
```
The boot configuration data store could not be opened
```
ให้สร้างใหม่
```cmd
bcdboot C:\Windows
```
---
## วิธีที่ 8 ใช้ Safe Mode
```
Startup Settings
```
กด
```
4
```
หรือ
```
F4
```
เข้า Safe Mode
แล้วถอน Driver หรือโปรแกรมที่เพิ่งติดตั้ง
---
## วิธีที่ 9 ใช้ USB Windows 11 Repair
สร้าง USB Windows 11
บูตจาก USB
เลือก
```
Repair your computer
```
ไม่ต้องเลือก Install
แล้วทำตามข้อด้านบน
---
## วิธีที่ 10 Reset this PC
หากข้อมูลยังอยู่
เลือก
```
Reset this PC
```
แล้วเลือก
```
Keep my files
```
Windows จะติดตั้งใหม่แต่เก็บไฟล์ส่วนตัวไว้ (แอปที่ติดตั้งจะถูกลบ)
---
# วิธีที่ 11 ตรวจสอบ SSD
หาก
* ซ่อมไม่ผ่านทุกวิธี
* CHKDSK มี Bad Sector
* บูตวนตลอด
มีโอกาส SSD เริ่มเสีย
แนะนำ
* เช็ก SMART ของ SSD
* สำรองข้อมูล
* เปลี่ยน SSD
---
# หากเป็นเครื่องของคุณ
จากประวัติที่คุยกันก่อนหน้านี้ คุณเพิ่งพบปัญหาเกี่ยวกับ Windows 11 หลายครั้ง ดังนั้นมีโอกาสว่าไฟล์ระบบหรือ SSD อาจเริ่มมีปัญหา หากหลังจากรัน `chkdsk` และ `sfc` แล้วยังบูตไม่ได้ ควรตรวจสุขภาพ SSD ก่อนตัดสินใจติดตั้ง Windows ใหม่ เพราะหาก SSD เสีย การลง Windows ใหม่อาจไม่แก้ปัญหาในระยะยาว
-----------------------------------------------------------
ghost ssd ทำอย่างไร
### วิธีที่ 1: Clone Disk (แนะนำ)
ง่ายที่สุด ไม่ต้องลง Windows ใหม่
**โปรแกรมยอดนิยม**
* [Macrium Reflect](https://www.macrium.com/reflectfree?utm_source=chatgpt.com)
* [AOMEI Backupper](https://www.aomeitech.com/aomei-backupper.html?utm_source=chatgpt.com)
* [EaseUS Disk Copy](https://www.easeus.com/disk-copy/?utm_source=chatgpt.com)
**ขั้นตอน**
1. ต่อ SSD ลูกใหม่เข้าคอมพิวเตอร์
2. ติดตั้งโปรแกรม Clone Disk
3. เลือก SSD/HDD เดิมเป็น Source
4. เลือก SSD ใหม่เป็น Destination
5. เริ่ม Clone
6. ปิดเครื่อง
7. ถอดไดรฟ์เดิม หรือเปลี่ยนลำดับ Boot ให้ SSD ใหม่เป็นตัวแรก
8. เปิดเครื่องและทดสอบการทำงาน
---
### วิธีที่ 2: สร้าง Image แล้ว Restore
เหมาะสำหรับเก็บ Backup ไว้ก่อน
1. สร้างไฟล์ Image ของไดรฟ์เดิม
2. บันทึกลง External HDD
3. เปลี่ยนเป็น SSD ใหม่
4. Restore Image กลับลง SSD
---
### ข้อควรระวัง
* ความจุ SSD ใหม่ควรมากกว่าหรือเท่ากับข้อมูลที่ใช้งานจริง
* ถ้า SSD ใหม่เล็กกว่า HDD เดิม ต้องให้ข้อมูลรวมไม่เกินความจุ SSD
* หลัง Clone เสร็จควรตรวจสอบว่า Windows เปิดใช้ TRIM แล้ว
เปิด Command Prompt (Admin) แล้วพิมพ์
```cmd
fsutil behavior query DisableDeleteNotify
```
ถ้าผลลัพธ์เป็น
```cmd
DisableDeleteNotify = 0
```
แสดงว่า TRIM ทำงานปกติ
หากแจ้งรุ่น SSD และ Windows ที่ใช้อยู่ (Windows 10 หรือ 11) ผมสามารถแนะนำวิธี Clone แบบละเอียดทีละขั้นตอนได้ครับ।
------------------------------------------------------------
การสมัคร Facebook เริ่มต้นทำอย่างไร
## สิ่งที่ต้องเตรียม
* เบอร์โทรศัพท์มือถือ หรืออีเมลที่ใช้งานได้
* ชื่อ-นามสกุลจริง
* วันเดือนปีเกิด
* รหัสผ่านที่ปลอดภัย
## สมัครผ่านเว็บไซต์
1. เข้าไปที่ [Facebook]
2. คลิก **"สร้างบัญชีใหม่"**
3. กรอกข้อมูล
* ชื่อ
* นามสกุล
* วันเกิด
* เพศ
* เบอร์โทรศัพท์หรืออีเมล
* รหัสผ่าน
4. กด **"สมัคร"**
5. Facebook จะส่งรหัสยืนยัน (OTP) ไปยังเบอร์โทรศัพท์หรืออีเมล
6. กรอกรหัสยืนยัน
7. สมัครสำเร็จและเริ่มใช้งานได้ทันที
## สมัครผ่านมือถือ
1. ดาวน์โหลดแอป [Facebook App]
2. เปิดแอปแล้วกด **"สร้างบัญชี Facebook ใหม่"**
3. กรอกข้อมูลตามขั้นตอน
4. ยืนยันเบอร์โทรศัพท์หรืออีเมล
5. ตั้งรูปโปรไฟล์และข้อมูลส่วนตัว
## หลังสมัครเสร็จ ควรทำทันที
1. เพิ่มรูปโปรไฟล์
2. เพิ่มรูปหน้าปก
3. เปิดใช้งานการยืนยันตัวตนแบบ 2 ขั้นตอน (Two-Factor Authentication)
4. เพิ่มเพื่อนที่รู้จัก
5. กดติดตามเพจที่สนใจ
## หากต้องการใช้ Facebook เพื่อหาลูกค้า
แนะนำให้สร้างทั้ง
* บัญชีส่วนตัว Facebook
* เพจ Facebook (Facebook Page)
* Facebook Reels
เพราะทั้ง 3 ส่วนทำงานร่วมกันได้ดีในการสร้างผู้ติดตามและหาลูกค้าใหม่
------------------------------------------
Recent Attachments Function
Code
<?php ssi_recentAttachments(); ?>
Result
| File | Posted by | Downloads | Filesize |
|---|---|---|---|
| junjao | 8 | 543.65KB | |
| junjao | 8 | 1190.07KB | |
| junjao | 8 | 344.19KB | |
| junjao | 27 | 55.23KB | |
| junjao | 49 | 47.28KB | |
| junjao | 42 | 64.53KB | |
| junjao | 45 | 65.42KB | |
| junjao | 42 | 50.28KB | |
| junjao | 55 | 80.96KB | |
| junjao | 389 | 69.92KB |
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>