ให้กระทู้ในบอร์ด SMF เรียงตามวันที่ตั้งกระทู้ เฉพาะบางห้องครับ

เริ่มโดย pigdoll, 06 ตุลาคม 2013, 15:41:33

หัวข้อก่อนหน้า - หัวข้อถัดไป

0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้

pigdoll

จากกระทู้ http://www.thaiseoboard.com/index.php?topic=40499.0

จะเรียงตามวันที่ตั้งกระทู้ ถ้าอยากให้เรียงแบบนี้เฉพาะบางห้องสามารถทำได้รึป่าวครับ ที่ลองปรับดูจะเรียงแบบวันที่ทุกห้อง

แต่ให้ห้องอื่นๆมีคนตอบกระทู้ก็เลื่อนขึ้นมาเหมือนเดิม

ขอบคุณครับ  :wanwan017:




pigdoll


pigdoll


nut_anek

ใช้ได้กับ บอร์ดที่มี URL รูปแบบนี้ w ww.xxxxxx.com/index.php?board=1.0

?board=1.0
ID บอร์ด คือ 1

เปิดไฟล์ Sources/MessageIndex.php

หา
// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'last_post';
$_REQUEST['sort'] = 'ID_LAST_MSG';
$ascending = isset($_REQUEST['asc']);
}


แทนที่ด้วย
// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$id = $_GET[board];
$context['sort_by'] = 'last_post';
if($id==1 || $id==2 || $id==3)
$_REQUEST['sort'] = 'ID_TOPIC';
else
$_REQUEST['sort'] = 'ID_LAST_MSG';
$ascending = isset($_REQUEST['asc']);
}



อยากให้บอร์ดไหนเรียงตามวันที่ตั้งก็ให้แก้
$id==1 || $id==2 || $id==3

ตาม ID บอร์ด
[direct=https://www.indytheme.com/themes/smart-variety][/direct][direct=https://www.indytheme.com/themes/indymall][/direct]
[direct=https://www.indytheme.com]ธีม wordpress สวย ถูก และมีคุณภาพ[/direct]
[direct=https://www.indytheme.com/themes/smart-variety]ส่วนลด 10% บาท เพียงกรอกโค้ด THAISEO10 สำหรับชาว ThaiSeo เท่านั้น[/direct]

iLhay

มี mod นี่ฮะ ?

sort board อะไรซักอย่าง ลองหาคำว่า sort ไปที่เว็ป mod smf เอาเลยครับ
[direct=https://bangmod.cloud/wordpress-hosting/]Wordpress Hosting

[/direct]
[direct=https://bangmod.cloud/wordpress-hosting/]Wordpress Hosting[/direct] เริ่มต้นปีละ 790 บาท NVMe SSD เร็ว 9000MB/s เร็วกว่านี้ไม่มีอีกแล้ว
[direct=https://bangmod.cloud/cloud-server]Cloud Server[/direct] เริ่มต้นเพียงเดือนละ 159 บาท พร้อมใช้ภายใน 1 นาที ผ่านระบบอัตโนมัติมีทั้ง Linux / Windows / DirectAdmin
สอบถามข้อมูลและแจ้งปัญหา 02-105-4417 ตลอด 24 ชั่วโมง

pigdoll

อ้างถึงจาก: nut_anek ใน 18 ตุลาคม 2013, 19:51:45
ใช้ได้กับ บอร์ดที่มี URL รูปแบบนี้ w ww.xxxxxx.com/index.php?board=1.0

?board=1.0
ID บอร์ด คือ 1

เปิดไฟล์ Sources/MessageIndex.php

หา
// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$context['sort_by'] = 'last_post';
$_REQUEST['sort'] = 'ID_LAST_MSG';
$ascending = isset($_REQUEST['asc']);
}


แทนที่ด้วย
// They didn't pick one, default to by last post descending.
if (!isset($_REQUEST['sort']) || !isset($sort_methods[$_REQUEST['sort']]))
{
$id = $_GET[board];
$context['sort_by'] = 'last_post';
if($id==1 || $id==2 || $id==3)
$_REQUEST['sort'] = 'ID_TOPIC';
else
$_REQUEST['sort'] = 'ID_LAST_MSG';
$ascending = isset($_REQUEST['asc']);
}



อยากให้บอร์ดไหนเรียงตามวันที่ตั้งก็ให้แก้
$id==1 || $id==2 || $id==3

ตาม ID บอร์ด

ขอบคุณครับ +1

rainam_i