SMF SSI.php Functions
Current Version: 2.1.1
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
สอบถาม ได้ที่ jun_jao2000@hotmail.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
จำนวนตอบกระทู้ทั้งหมด: 1,522
จำนวนหัวข้อทั้งหมด: 1,497
จำนวนหมวดหมู่ทั้งหมด: 5
จำนวนบอร์ดทั้งหมด: 23
News Function
Shows random forum news.
Code
<?php ssi_news(); ?>
Result
https://www.exness.com/boarding/sign-up/a/73208?lng=th
1. เลือกประเทศ ไทย
2. อีเมล์จริงของคุณ
3. รหัสผ่าน
* รหัสผ่านต้องมีความยาว 8-15 ตัว
* ใช้ทั้งอักษรตัวพิมพ์ใหญ่และตัวพิมพ์เล็ก
* ใช้ทั้งตัวเลขและตัวอักษรภาษาอังกฤษ
* ห้ามใช้อักขระพิเศษ (!@#$%^&*., และอื่นๆ)
4. ใส่รหัสพาร์ทเนอร์ 73208
Board News Function
Shows the latest posts from read only boards, or a specific board.
Code
<?php ssi_boardNews(); ?>
Result
ลบคุกกี้ ใน chrome ทำอย่างไร
1. **เปิด Google Chrome** บนคอมพิวเตอร์หรืออุปกรณ์ของคุณ
2. **ไปที่การตั้งค่า**:
- คลิกที่ไอคอนสามจุด (⁝) มุมขวาบนของเบราว์เซอร์
- เลือก **การตั้งค่า** (Settings)
3. **ไปที่ส่วนความเป็นส่วนตัวและความปลอดภัย**:
- เลื่อนลงมาหรือเลือก **ความเป็นส่วนตัวและความปลอดภัย** (Privacy and security) จากเมนูด้านซ้าย
4. **เลือก "ล้างข้อมูลการท่องเว็บ"**:
- คลิกที่ **ล้างข้อมูลการท่องเว็บ** (Clear browsing data)
5. **เลือกข้อมูลที่ต้องการลบ**:
- ในแท็บ **พื้นฐาน** (Basic) หรือ **ขั้นสูง** (Advanced):
- ติ๊กช่อง **คุกกี้และข้อมูลไซต์อื่น ๆ** (Cookies and other site data)
- คุณสามารถเลือกช่วงเวลาได้ เช่น "ชั่วโมงที่ผ่านมา" หรือ "ตลอดเวลา" (All time) เพื่อลบทั้งหมด
- (ถ้าต้องการลบอย่างอื่น เช่น แคชหรือประวัติการท่องเว็บ ให้ติ๊กเพิ่ม)
6. **กดปุ่ม "ล้างข้อมูล"**:
- คลิก **ล้างข้อมูล** (Clear data) เพื่อยืนยันการลบ
**หมายเหตุ**:
- การลบคุกกี้จะทำให้คุณออกจากระบบเว็บไซต์ที่เคยล็อกอินไว้ และอาจรีเซ็ตการตั้งค่าส่วนตัวบางอย่างบนเว็บ
- ถ้าใช้ Chrome บนมือถือ ขั้นตอนจะคล้ายกัน แต่เข้าเมนูผ่านไอคอนสามจุด > การตั้งค่า > ความเป็นส่วนตัว > ล้างข้อมูลการท่องเว็บ
เข้าเว็บแล้วขึ้น This connection is not private แก้ไขเว็บอย่างไร
---
## 🔍 **1. ตรวจสอบ SSL Certificate**
- ใช้บริการเช่น [SSL Labs](https://www.ssllabs.com/ssltest/) เพื่อตรวจสอบว่าใบรับรอง (SSL Certificate) ถูกต้องหรือไม่
- ตรวจสอบว่า SSL Certificate หมดอายุหรือยัง (**Expired Certificate**)
- หากหมดอายุ ให้ต่ออายุหรือขอใบรับรองใหม่จากผู้ให้บริการ (เช่น Let's Encrypt, Cloudflare, DigiCert)
---
## 🛠 **2. ตรวจสอบการตั้งค่าเซิร์ฟเวอร์**
### **🔹 Apache** (ตรวจสอบไฟล์ `httpd.conf` หรือ `ssl.conf`)
- ตรวจสอบว่ามีการตั้งค่า SSL และ VirtualHost ถูกต้องหรือไม่
- ใช้คำสั่งนี้เพื่อตรวจสอบการตั้งค่า Apache
```bash
apachectl configtest
```
- รีสตาร์ทเซิร์ฟเวอร์หลังจากแก้ไข
```bash
systemctl restart apache2
```
### **🔹 Nginx** (ตรวจสอบไฟล์ `nginx.conf` หรือ `sites-enabled/default`)
- ตรวจสอบว่าใบรับรองถูกต้องและไฟล์ `ssl_certificate` ถูกต้องหรือไม่
- ตัวอย่างการตั้งค่า SSL ที่ถูกต้องใน Nginx:
```nginx
server {
listen 443 ssl;
server_name yourdomain.com;
ssl_certificate /etc/letsencrypt/live/yourdomain.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/yourdomain.com/privkey.pem;
}
```
- ทดสอบการตั้งค่า
```bash
nginx -t
```
- รีสตาร์ทเซิร์ฟเวอร์
```bash
systemctl restart nginx
```
---
## 🌍 **3. เช็คการ Redirect HTTP -> HTTPS**
- ตรวจสอบว่าเซิร์ฟเวอร์มีการบังคับ Redirect จาก `http://` ไป `https://` ถูกต้องหรือไม่
- ถ้าการ Redirect ผิดพลาด อาจทำให้เว็บโหลดไม่ได้
**ตัวอย่างการ Redirect ที่ถูกต้อง (Apache)**
```apache
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
```
**ตัวอย่างการ Redirect ที่ถูกต้อง (Nginx)**
```nginx
server {
listen 80;
server_name yourdomain.com;
return 301 https://$host$request_uri;
}
```
---
## 🔄 **4. ล้างแคช DNS และ Browser**
- ลองเข้าผ่าน **Incognito Mode**
- ล้างแคช DNS บนเครื่องด้วยคำสั่ง
```bash
sudo systemd-resolve --flush-caches
```
- ล้างแคชเบราว์เซอร์ เช่น **Chrome**: `chrome://settings/clearBrowserData`
---
## 🌐 **5. ใช้ Cloudflare หรือไม่?**
หากใช้ **Cloudflare** และเกิดปัญหา SSL อาจเป็นเพราะตั้งค่า SSL Mode ผิด ให้ลองเข้าไปที่ **Cloudflare Dashboard**
- ไปที่ **SSL/TLS** และเลือกโหมด **"Full" หรือ "Full (Strict)"**
- ถ้ายังไม่หาย ลองปิด Cloudflare Proxy (Orange Cloud) ชั่วคราว
---
## 📌 **6. ตรวจสอบ Mixed Content (http/https)**
หากหน้าเว็บโหลดไฟล์บางอย่างผ่าน `http://` ในขณะที่เว็บใช้ `https://` อาจเกิดปัญหา Mixed Content
- ใช้ Developer Tools (`F12 > Console`) ดูว่ามีการโหลดไฟล์ที่ไม่ปลอดภัยหรือไม่
- แก้ไขให้ทุกลิงก์เป็น `https://`
---
## ✅ **สรุป**
1. ตรวจสอบว่า SSL Certificate ถูกต้อง และยังไม่หมดอายุ
2. ตรวจสอบการตั้งค่าเซิร์ฟเวอร์ (Apache/Nginx)
3. เช็คว่า Redirect HTTPS ถูกต้องหรือไม่
4. ล้างแคช DNS และ Browser
5. ถ้าใช้ Cloudflare ให้ตั้งค่า SSL ให้เหมาะสม
6. ตรวจสอบ Mixed Content และแก้ไขให้เป็น HTTPS
หากลองทุกวิธีแล้วยังไม่หาย บอกข้อมูลเพิ่มเติมมาได้นะ เช่น **เซิร์ฟเวอร์ใช้ Apache หรือ Nginx** หรือ **โฮสต์เว็บไว้ที่ไหน** 😊
คำสั่ง แก้ไขความเสียหายไฟล์ของ Windows
1. เปิด **Command Prompt (CMD)** ในโหมดผู้ดูแล (Administrator):
- คลิกขวาที่ปุ่ม **Start** หรือกดปุ่ม **Windows + X**.
- เลือก **Command Prompt (Admin)** หรือ **Windows PowerShell (Admin)**.
2. ในหน้าต่าง Command Prompt ให้พิมพ์คำสั่งต่อไปนี้แล้วกด Enter:
```
sfc /scannow
```
3. ระบบจะเริ่มทำการสแกนและตรวจสอบไฟล์ระบบ หากพบไฟล์ที่เสียหายมันจะทำการซ่อมแซมโดยอัตโนมัติ.
4. รอจนกระทั่งการสแกนเสร็จสิ้น ซึ่งอาจใช้เวลานานขึ้นอยู่กับขนาดของไฟล์ระบบ.
5. เมื่อเสร็จแล้วให้รีสตาร์ทเครื่องคอมพิวเตอร์ของคุณ.
หากวิธีนี้ไม่สามารถแก้ไขปัญหาได้ ลองใช้คำสั่ง **DISM** เพื่อซ่อมแซมไฟล์ระบบเพิ่มเติม:
1. เปิด Command Prompt (Admin) ตามขั้นตอนข้างต้น.
2. พิมพ์คำสั่งนี้แล้วกด Enter:
```
DISM /Online /Cleanup-Image /RestoreHealth
```
3. รอให้ระบบทำงานเสร็จสิ้น จากนั้นลองรันคำสั่ง `sfc /scannow` อีกครั้ง.
ทำตามขั้นตอนนี้จะช่วยให้ไฟล์ระบบของ Windows ถูกซ่อมแซมและกลับมาทำงานได้ปกติค่ะ.
two-factor authentication คืออะไร
1. **รหัสที่ส่งไปยังโทรศัพท์มือถือ** (ข้อความ SMS หรือแอปพลิเคชันตัวสร้างรหัส)
2. **การยืนยันตัวตนผ่านแอปพลิเคชัน** (เช่น Google Authenticator หรือ Authy)
3. **การใช้การยืนยันตัวตนผ่านลายนิ้วมือ หรือสแกนใบหน้า** (biometric authentication)
โดยการใช้ระบบ 2FA จะช่วยเพิ่มความปลอดภัยให้กับบัญชีผู้ใช้ เนื่องจากแม้ว่าผู้ไม่หวังดีจะทราบรหัสผ่านของเรา ก็ยังไม่สามารถเข้าถึงบัญชีได้ถ้าพวกเขาไม่มีการยืนยันตัวตนในขั้นตอนที่สอง.
Plesk แก้ไข SPF Record ทำอย่างไร
### ขั้นตอนการแก้ไข SPF Record ผ่าน Plesk:
1. **ล็อกอินเข้าสู่ Plesk**:
- เข้าไปที่ URL ของ Plesk (เช่น `https://your-server-ip:8443` หรือ `https://yourdomain.com:8443`)
- กรอกชื่อผู้ใช้และรหัสผ่านเพื่อเข้าสู่ระบบ Plesk
2. **เลือกโดเมนที่ต้องการแก้ไข**:
- หลังจากล็อกอินเข้าไปแล้ว คุณจะเห็นรายชื่อโดเมนทั้งหมดใน Plesk
- คลิกที่โดเมนที่คุณต้องการแก้ไข SPF Record
3. **ไปที่การตั้งค่า DNS**:
- ในหน้าจอของโดเมนที่เลือก ให้คลิกที่ **"Websites & Domains"** (เว็บไซต์และโดเมน)
- แล้วเลือก **"DNS Settings"** (การตั้งค่า DNS)
4. **ค้นหาและแก้ไข SPF Record**:
- ในหน้า DNS Settings คุณจะเห็นรายการ DNS Record ทั้งหมดของโดเมน
- ค้นหา **TXT Record** ที่มีการตั้งค่า SPF อยู่ในนั้น (อาจจะเป็นข้อความที่ขึ้นต้นด้วย `v=spf1`)
- ถ้าคุณยังไม่เห็น SPF Record ให้คลิกที่ **"Add Record"** (เพิ่มบันทึก) และเลือก **"TXT"**
- ใส่ค่า SPF Record ที่ต้องการแก้ไขหรือเพิ่ม เช่น:
```
v=spf1 ip4:192.168.1.1 include:_spf.google.com -all
```
ในที่นี้จะอนุญาตให้ IP 192.168.1.1 และเซิร์ฟเวอร์ที่ระบุใน `_spf.google.com` ส่งอีเมลจากโดเมนนี้
5. **บันทึกการเปลี่ยนแปลง**:
- หลังจากแก้ไข SPF Record เสร็จแล้ว ให้คลิกที่ **"OK"** หรือ **"Apply"** เพื่อบันทึกการเปลี่ยนแปลง
- ระบบจะทำการอัปเดต DNS และเปลี่ยนแปลงค่าของ SPF Record ตามที่คุณกำหนด
6. **ตรวจสอบการตั้งค่า SPF**:
- คุณสามารถใช้เครื่องมือออนไลน์เช่น [MXToolbox](https://mxtoolbox.com/spf.aspx) เพื่อเช็คว่า SPF Record ของคุณถูกตั้งค่าถูกต้องหรือไม่
- เพียงกรอกโดเมนของคุณลงไปแล้วคลิก **"SPF Record Lookup"**
Recent Attachments Function
Code
<?php ssi_recentAttachments(); ?>
Result
ไฟล์ | ข้อความโดย | Downloads | Filesize |
---|---|---|---|
![]() |
junjao | 18 | 565.86kB |
![]() |
junjao | 32 | 30.65kB |
![]() |
junjao | 34 | 606.07kB |
![]() |
junjao | 27 | 198.98kB |
![]() |
junjao | 26 | 42.66kB |
![]() |
junjao | 30 | 231.05kB |
![]() |
junjao | 25 | 220.6kB |
![]() |
junjao | 30 | 61.29kB |
![]() |
junjao | 35 | 125.69kB |
![]() |
junjao | 26 | 101.79kB |
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>