SMF SSI.php Functions
Current Version: 2.1.6
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
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
การแก้ไข smf error Fatal error: Call to undefined function idna_maps_not_std3().
แก้ไขอย่างไร
ข้อผิดพลาดนี้ใน **SMF (Simple Machines Forum)**
```
Fatal error: Uncaught Error: Call to undefined function idna_maps_not_std3()
```
หมายความว่า PHP ของเซิร์ฟเวอร์คุณ **ไม่มีฟังก์ชัน `idna_maps_not_std3()`** ซึ่งมาจาก **PHP extension ชื่อ intl (Internationalization extension)** — โดยเฉพาะ **ฟังก์ชันที่ใช้กับ IDN (Internationalized Domain Names)**
---
### 🔧 วิธีแก้ไขหลัก (แนะนำ)
ให้เปิดใช้งานหรือเปิดติดตั้ง **PHP intl extension**
#### ✅ ถ้าใช้ Windows Server (Plesk / IIS)
1. เข้าหน้า **Plesk** → ไปที่
**Tools & Settings → PHP Settings → PHP Extensions**
2. มองหา **intl** แล้วติ๊ก ✅ เปิดใช้งาน
3. หรือถ้าจัดการไฟล์ `php.ini` เอง ให้แก้ไฟล์:
```
extension=intl
```
(เอาเครื่องหมาย `;` ออกจากหน้า extension ถ้ามี)
4. จากนั้น **restart IIS หรือ Apache / PHP-FPM**
---
### 🧩 วิธีตรวจสอบว่าติดตั้งสำเร็จหรือไม่
สร้างไฟล์ชื่อ `phpinfo.php` ไว้ในโฟลเดอร์เว็บ (เช่น `httpdocs/board/phpinfo.php`)
ใส่โค้ด:
```php
<?php phpinfo(); ?>
```
เปิดในเว็บเบราว์เซอร์ เช่น
`https://www.junjao.com/board/phpinfo.php`
แล้วดูว่ามีส่วนหัว **intl** แสดงอยู่หรือไม่
ถ้ามี = ใช้งานได้แล้ว ✅
ถ้าไม่มี = extension ยังไม่เปิดใช้งาน ❌
---
### ⚙️ ทางแก้ชั่วคราว (ถ้ายังเปิด intl ไม่ได้)
บางเวอร์ชันของ SMF 2.1.x สามารถแก้ได้โดย **ปิดการใช้ IDN (Punycode)** ชั่วคราว:
1. เปิดไฟล์:
```
Sources/Subs-Compat.php
```
2. หาโค้ดที่มี `idn_to_ascii(` แล้วใส่เงื่อนไขครอบไว้แบบนี้:
```php
if (function_exists('idn_to_ascii'))
$domain = idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46);
else
$domain = $domain; // fallback ป้องกัน error
```
แต่วิธีนี้เป็นการ "ข้าม" การแปลงชื่อโดเมนสากลเท่านั้น ควรใช้ชั่วคราวเท่านั้น ⚠️
---
### 💡 สรุปสั้น ๆ
| สาเหตุ | วิธีแก้หลัก | วิธีชั่วคราว |
| -------------------------------------- | ---------------------------------- | ---------------------------------------------------- |
| PHP ไม่มีฟังก์ชัน idna_maps_not_std3() | เปิดหรือเพิ่ม PHP extension `intl` | แก้ไฟล์ Subs-Compat.php ให้ตรวจสอบ function_exists() |
---
ถ้าคุณบอกผมได้ว่า
* ใช้ **PHP version** อะไร (ดูจาก Plesk หรือ phpinfo)
* ใช้ **SMF version** อะไร (เช่น 2.1.3 หรือ 2.1.4)
----------------------------------
smf ขึ้น error ว่า Call to undefined function idna_maps_not_std3() แก้ไขอย่างไร
```
Call to undefined function idna_maps_not_std3()
```
ใน **SMF (Simple Machines Forum)** มักเกิดจากปัญหา **เวอร์ชันของ PHP ที่ไม่รองรับฟังก์ชัน IDN ที่ SMF ใช้** หรือจาก **ไฟล์ IDNA / Subs-Charset.php / Subs.php** ที่เสียหายหรือไม่สมบูรณ์
---
## 🔍 สาเหตุที่พบบ่อย
1. **SMF รุ่นเก่า (เช่น 2.0.x)** ไม่เข้ากับ PHP 8.x
→ ฟังก์ชัน `idna_maps_not_std3()` อยู่ในไฟล์ `Subs-Charset.php` ซึ่ง SMF รุ่นเก่าบางตัวไม่มีหรือถูกเปลี่ยนชื่อ
2. **ไฟล์ของระบบ SMF หาย / ไม่ครบ**
→ โดยเฉพาะไฟล์ในโฟลเดอร์ `/Sources/` ที่มีฟังก์ชันเกี่ยวกับ IDNA
3. **อัปเกรด PHP แล้วไม่ได้อัปเดต SMF**
→ เช่น จาก PHP 7.4 → PHP 8.2 จะทำให้บางฟังก์ชันเก่าหายไป
---
## 🧩 วิธีตรวจสอบเบื้องต้น
1. เปิดไฟล์
```
Sources/Subs-Charset.php
```
แล้วค้นหาคำว่า
```
function idna_maps_not_std3(
```
ถ้าไม่มี แปลว่า SMF รุ่นนี้ไม่รองรับฟังก์ชันนี้
2. ตรวจสอบเวอร์ชัน PHP
```bash
php -v
```
ถ้าเป็น PHP 8.1+ และ SMF เป็นรุ่น 2.0.x → ต้องอัปเดต
---
## ✅ วิธีแก้ไข
### วิธีที่ 1: อัปเกรด SMF
อัปเกรดเป็น **SMF 2.1.x** (เช่น 2.1.4 หรือใหม่กว่า)
เพราะรุ่นนี้รองรับ PHP 8.x และแก้ปัญหานี้แล้ว
ลิงก์ดาวน์โหลดจากเว็บทางการ:
👉 [https://www.simplemachines.org/download/](https://www.simplemachines.org/download/)
> ก่อนอัปเกรด ให้สำรองไฟล์และฐานข้อมูลทั้งหมดก่อนทุกครั้ง
---
### วิธีที่ 2: แก้ไฟล์ชั่วคราว (ถ้ายังไม่อัปเกรดได้)
> ⚠️ วิธีนี้เป็น "วิธีแก้ชั่วคราว" สำหรับผู้ที่ต้องการให้เว็บกลับมาใช้งานได้ก่อน
เปิดไฟล์ `Sources/Idna.php` หรือ `Subs-Charset.php` แล้วเพิ่มฟังก์ชันเปล่าไว้ก่อน
```php
if (!function_exists('idna_maps_not_std3')) {
function idna_maps_not_std3($codepoint) {
// ฟังก์ชันนี้ใช้ในกระบวนการแปลงโดเมน IDN
// หากไม่ใช้โดเมนต่างประเทศ ปล่อยว่างไว้ได้
return false;
}
}
```
บันทึกแล้วรีเฟรชหน้าเว็บใหม่
---
### วิธีที่ 3: กลับไปใช้ PHP รุ่นเก่าชั่วคราว
หากเว็บโฮสต์อนุญาต ให้ตั้ง PHP เป็น **7.4** หรือ **7.3**
(ใช้ได้ดีกับ SMF 2.0.x เดิม)
ตัวอย่างบน Plesk:
* ไปที่ **Websites & Domains → PHP Settings**
* เปลี่ยน **PHP version** → 7.4
* บันทึกและรีโหลดหน้าเว็บ
---
## 🧠 สรุป
| ปัญหา | สาเหตุ | วิธีแก้แนะนำ |
| ------------------------------------------------- | ----------------------- | ------------------------------------- |
| `Call to undefined function idna_maps_not_std3()` | SMF รุ่นเก่า + PHP ใหม่ | ✅ อัปเกรด SMF เป็น 2.1.x |
| | ไฟล์ระบบหาย | ✅ อัปโหลดไฟล์ `Subs-Charset.php` ใหม่ |
| | ต้องการแก้เฉพาะหน้า | ⚙️ เพิ่มฟังก์ชันเปล่าชั่วคราวในไฟล์ |
----------------------------
junjao.com จดโดเมนเนมใหม่ โฮสติ้ง 1 GB ลง Wordpress 6.8.3 ราคา 3,000 บาทต่อปี
ลง Wordpress 6.8.3 เว็บสำเร็จรูปให้ , PHP 8.4.14 ราคา 3,000 บาทต่อปี
พร้อม let's encrypt SSL certificate , Plesk 18 หน้าจัดการเว็บ
รับ 10 โดเมนเนม ถึงสิ้นปี 2568 สนใจ Index มาครับ
สนใจติดต่อ
สรพล 081-446-5311
line : junjaocom
MariaDB 10.11 server กับ MariaDB 10.6 server อันไหนดีกว่า
ถ้าพูดสั้น ๆ — **MariaDB 10.11 ดีกว่า MariaDB 10.6** ในแทบทุกด้าน
เพราะเป็น **LTS (Long Term Support)** รุ่นใหม่กว่า ที่มี **ประสิทธิภาพดีขึ้น ความปลอดภัยสูงขึ้น และฟีเจอร์มากกว่า**
แต่มีรายละเอียดที่ควรรู้ก่อนเลือก ดังนี้ 👇
---
## ⚙️ เปรียบเทียบ MariaDB 10.6 vs 10.11
| รายการเปรียบเทียบ | **MariaDB 10.6 (LTS)** | **MariaDB 10.11 (LTS)** |
| --------------------- | -------------------------- | --------------------------------------------------------------------------- |
| 🗓� วันที่ออก | มิถุนายน 2021 | กุมภาพันธ์ 2023 |
| 🔒 การซัพพอร์ต (LTS) | ถึง ก.ค. 2026 | ถึง ก.พ. 2028 |
| ⚡ ความเร็ว | ดี | ดีกว่า (ปรับปรุง query optimizer และ cache) |
| 🧩 ฟีเจอร์ใหม่ | เสถียร, เน้นความเข้ากันได้ | มีฟีเจอร์ใหม่ เช่น dynamic privileges, improved JSON, storage engine update |
| 💾 Storage Engine | InnoDB, MyRocks, Aria | InnoDB ปรับปรุง I/O, MyRocks เสถียรขึ้น |
| 🔍 Query Optimizer | ปกติ | เร็วกว่ามาก โดยเฉพาะ query ซับซ้อน |
| 🔁 Compatibility | เข้ากันได้สูง | เข้ากันได้กับ 10.6 แต่เพิ่มฟีเจอร์ใหม่บางอย่าง |
| 🛡� Security | มาตรฐาน | เพิ่มการเข้ารหัสและระบบสิทธิ์ (Privilege System) ที่ละเอียดขึ้น |
| 💬 JSON / GIS | รองรับพื้นฐาน | รองรับ JSON path และ Spatial functions มากขึ้น |
| 🧰 การทำงานร่วมกับแอป | เสถียร | เสถียร + ฟีเจอร์ใหม่ (เหมาะกับเว็บ/ระบบใหญ่) |
---
## ✅ สรุปการเลือกใช้งาน
| สถานการณ์ | แนะนำ |
| ---------------------------------------------------------- | ------------------------------------------------------------ |
| 👨�💻 ระบบเก่าที่ต้องการเสถียรและเข้ากันได้ 100% | ใช้ **MariaDB 10.6 LTS** |
| 🚀 ระบบใหม่ / ต้องการความเร็ว / รองรับฟีเจอร์ล่าสุด | ใช้ **MariaDB 10.11 LTS** |
| 🧱 ต้องการระยะซัพพอร์ตยาว (มากกว่า 3 ปี) | **10.11 LTS** ดีกว่า |
| ⚠️ ระบบที่ใช้กับ PHP รุ่นใหม่ / Laravel / WordPress ล่าสุด | แนะนำ **10.11** เพราะรองรับการเชื่อมต่อและฟีเจอร์ใหม่ครบกว่า |
---
## 💡 ข้อแนะนำเพิ่มเติม
* ถ้าคุณกำลัง **ติดตั้งใหม่** → ใช้ **MariaDB 10.11** ไปเลยครับ
* ถ้าคุณมีระบบ **เก่า (เช่น 10.3–10.5)** และจะอัปเกรด → อัปเป็น **10.11 โดยตรง** ได้ (มี Migration Guide)
* ถ้าคุณใช้ **Ubuntu 22.04 / Debian 12 / Rocky 9 / Alma 9** → MariaDB 10.11 เป็นค่าเริ่มต้นของ repo อยู่แล้ว
--------------------------------------
การมีเว็บไซด์ ข้อดีและข้อเสีย มีอะไรบ้าง
ต่อไปนี้คือสรุปที่เข้าใจง่าย 👇
---
## 🌟 **ข้อดีของการมีเว็บไซต์**
### 1. **เพิ่มความน่าเชื่อถือ**
* เว็บไซต์เปรียบเหมือน "หน้าร้านออนไลน์" ที่ลูกค้าสามารถเข้ามาดูข้อมูลได้ตลอดเวลา
* ทำให้ธุรกิจดูเป็นมืออาชีพและเชื่อถือได้มากกว่ามีแค่เพจ Facebook หรือ Line OA
### 2. **เข้าถึงลูกค้าได้ทั่วโลก**
* อินเทอร์เน็ตไม่มีข้อจำกัดด้านสถานที่
* ลูกค้าสามารถเข้าถึงข้อมูลสินค้า/บริการของคุณได้ตลอด 24 ชั่วโมง
### 3. **ประชาสัมพันธ์ได้ตลอดเวลา**
* เว็บไซต์ทำงานแทนคุณได้อัตโนมัติ
* ลูกค้าสามารถดูข้อมูล ราคา รีวิว หรือสั่งซื้อได้แม้ในเวลาที่คุณไม่ออนไลน์
### 4. **วัดผลและวิเคราะห์ข้อมูลได้**
* สามารถใช้เครื่องมืออย่าง **Google Analytics** เพื่อดูจำนวนผู้เข้าชม, แหล่งที่มาของทราฟฟิก, พฤติกรรมของผู้ใช้ ฯลฯ
### 5. **ปรับแต่งแบรนด์ได้อิสระ**
* เว็บไซต์สามารถออกแบบให้ตรงกับภาพลักษณ์ของแบรนด์ได้อย่างเต็มที่ (สี โลโก้ โทน ภาษา)
### 6. **เป็นฐานข้อมูลถาวร**
* ข้อมูล ข่าวสาร บทความ หรือผลงานต่าง ๆ สามารถเก็บไว้และค้นหาได้ง่ายในระยะยาว
### 7. **รองรับการทำ SEO**
* หากทำ SEO (Search Engine Optimization) ดี ๆ เว็บไซต์ของคุณจะติดอันดับ Google ทำให้ลูกค้าเจอง่ายโดยไม่ต้องเสียค่าโฆษณา
---
## ⚠️ **ข้อเสียของการมีเว็บไซต์**
### 1. **มีค่าใช้จ่าย**
* ต้องมีค่า **โดเมน (Domain)**, **โฮสติ้ง (Hosting)** และอาจมีค่าออกแบบ/พัฒนาเว็บไซต์
* หากจ้างบริษัททำ ราคาจะตั้งแต่หลักพันถึงหลักแสนบาท
### 2. **ต้องดูแลและอัปเดต**
* เว็บไซต์ต้องมีการอัปเดตข้อมูล ข่าวสาร หรือระบบอย่างสม่ำเสมอ
* หากละเลย อาจทำให้ข้อมูลล้าสมัยหรือระบบมีปัญหา
### 3. **มีความเสี่ยงด้านความปลอดภัย**
* ถ้าไม่ดูแลหรืออัปเดตระบบ WordPress/ปลั๊กอิน/ฐานข้อมูล อาจโดนแฮ็กได้
### 4. **ต้องใช้เวลาในการสร้างฐานผู้ชม**
* แม้มีเว็บไซต์ แต่ถ้าไม่มีการโปรโมต เช่น ผ่านโซเชียลหรือโฆษณา Google Ads ก็อาจไม่มีคนเข้า
### 5. **ต้องมีความรู้หรือจ้างผู้เชี่ยวชาญ**
* หากทำเองต้องเรียนรู้เรื่องการออกแบบ เว็บเซิร์ฟเวอร์ และ SEO
* หากจ้างก็ต้องเสียค่าใช้จ่ายเพิ่ม
---
## ✅ **สรุป**
| ด้าน | ข้อดี | ข้อเสีย |
| -------------------- | -------------------------- | ------------------------------------ |
| **ต้นทุน** | ลงทุนครั้งเดียวใช้ได้นาน | ต้องมีค่าโดเมน โฮสติ้ง และบำรุงรักษา |
| **ภาพลักษณ์** | ดูเป็นมืออาชีพ น่าเชื่อถือ | ถ้าออกแบบไม่ดี อาจทำให้ภาพลักษณ์เสีย |
| **การเข้าถึงลูกค้า** | เข้าถึงได้ทั่วโลก 24 ชม. | ต้องโปรโมตให้มีคนเข้าชม |
| **การจัดการข้อมูล** | เก็บและนำเสนอข้อมูลได้ดี | ต้องอัปเดตและดูแลต่อเนื่อง |
-------------------------------------------------
Recent Attachments Function
Code
<?php ssi_recentAttachments(); ?>
Result
| File | Posted by | Downloads | Filesize |
|---|---|---|---|
| junjao | 13 | 176.44KB | |
| junjao | 12 | 322.45KB | |
| junjao | 12 | 280.58KB | |
| junjao | 45 | 123KB | |
| junjao | 27 | 69.76KB | |
| junjao | 61 | 33.14KB | |
| junjao | 72 | 556.27KB | |
| junjao | 65 | 153.72KB | |
| junjao | 200 | 129.37KB | |
| junjao | 205 | 1710.13KB |
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>