ติดต่อลงโฆษณา [email protected]

แสดงกระทู้

ส่วนนี้จะช่วยให้คุณสามารถดูกระทู้ทั้งหมดสมาชิกนี้ โปรดทราบว่าคุณสามารถเห็นเฉพาะกระทู้ในพื้นที่ที่คุณเข้าถึงในขณะนี้


ข้อความ - montree

หน้า: [1] 2
2
ในเวบนี้มีครับ...เคยเอามาโพสต์ไว้อยู่ ลองหาดูครับ..เจอแน่ๆ

3
นำเวบธรรมะดีๆ มาฝากครับ....ศึกษาธรรมะ ใจสงบ คิดวิธีแก้ไข theme smf ออกได้อย่างง่ายดาย  :o

http://www.luangpee.net/forum

4
อ้างถึง
ติดตั้งเป็น utf-8 ครับ...แก้ไขไฟล์ setting.php ต้องทำยังไงบ้างครับ...รบกวนด้วยนะครับ
ร่วมด้วยช่วยกันครับ

ผมดู encode แล้วบอร์ดท่านเป็น tis620 นะครับ เพื่อความแน่ใจให้ไปดูที่ฐานข้อมูลครับ...ว่าเป็นภาษาไทยหรือเปล่า ตรง table smf_messeges เพราะบางที...แสดงผ่านหน้าบราวเซอร์เป็นภาษาไทยอยู่ แต่ฐานข้อมูลกลับเป็นภาษาต่างด้าว จะมีปัญหาตรง backup ข้อมูล

5
ไม่แน่ใจว่าท่านไปลบ ผู้ออกแบบ  เขาหรือเปล่าครับ ควรจะให้ credit เขานะครับ

 Powered by SMF 1.1.7 | SMF © 2006-2007, Simple Machines LLC | Thai language by ThaiSMF

ไฟล์ settings.php
เพิ่มโค้ดนี้ $db_character_set = 'tis620'; #ก่อนเครื่องหมาย ?>

6
Fixed or Bogus Bugs / Re: จะแก้พิมพ์ไทยค่ะ
« เมื่อ: 12/11/08, 13:10:58 »
ต้องดาวน์โหลดภาษาไทยนะครับ.....ติดตั้งเป็น utf-8 และเชตฐานข้อมูลเป็ฯ utf-8 ด้วยครับ

7
ติดตั้งเป็น tis620 หรือ utf-8 ครับ ให้แก้ไขที่ไฟล์ settings.php หรือลองเปลี่ยน theme อะครับ
เพราะมันเป็น western european(iso)

8
ดูที่ฐานข้อมูลหรือยังครับว่าเป็นภาษาไทยแบบไหน tis620 หรือ utf-8
แล้วโหลด smf มาเป็นภาษาไทยแบบ tis620 หรือ utf-8 เวลาติดตั้งให้เชตให้ตรงนะครับ

9
<?php

$list = "10"; // ต้องการให้โชว์กี่กระทู้ล่ะ ใส่เข้าไปได้เลย

$sboard = "1"; // ใส่ 0 ถ้าต้องการกระทู้จากบอร์ดทุกบอร์ด  หรือใส่ 1 ถ้าต้องการเจาะจงบอร์ด
if (empty($board)) {
$board = "1.0"; // เปลี่ยนตรงนี้ถ้าอยากให้บอร์ดไหนเป็นค่า default
}
// ถ้าใส่ 1 อย่าลืมระบุ id ของบอร์ดด้วยเช่น
// http://www.xxx.com/forum/lasttopic.php?board= อย่างนี้ เช่น http://www.xxx.com/forum/lasttopic.php?board=3.0

// ถ้าไม่ได้ใส่ ?board=.. ก็ให้มันแสดงตาม id ของบอร์ด ตามข้างล่าง

/*
if (empty($board)) {
$board = "2"; // เปลี่ยนตรงนี้ถ้าอยากให้บอร์ดไหนเป็นค่า default
}
*/

?>
<?
include("forum/Settings.php"); #ใส่ path ให้ถูกนะครับ

$host = $db_server;
$user = $db_user;
$pass = $db_passwd;
$database = $db_name;
$prefix = $db_prefix."topics";
$prefix2 = $db_prefix."messages";

@mysql_connect($host,$user,$pass) or die("ขออภัย ขณะนี้ไม่สามารถติดต่อฐานข้อมูลได้ กรุณาเข้าชมใหม่ภายหลัง");
$charset ="SET NAMES 'tis620'";mysql_query($charset) #ถ้าเป็น utf-8 ก็เปลี่ยน tis620 เป็น utf-8
or die('Invalid query: ' . mysql_error());
if ($sboard=="0") {
$Sql = "SELECT * FROM $prefix order by ID_TOPIC DESC limit 0,$list ";
} elseif ($sboard=="1") {
$Sql = "SELECT * FROM $prefix where ID_BOARD='$board' order by ID_TOPIC DESC limit 0,$list ";
}
$result = mysql_db_query($database,$Sql);
$nrow = mysql_num_rows($result);
while ($num = mysql_fetch_array($result)) {

$tid = $num["ID_TOPIC"];
$bid = $num["ID_BOARD"];
$fid = $num["ID_FIRST_MSG"];
$view = $num["numViews"];
$reply = $num["numReplies"];

$msql = "select * from $prefix2 where ID_MSG='$fid'";
$mresult = mysql_db_query($database,$msql);
$marr = mysql_fetch_array($mresult);
$title = $marr["subject"];
$poster = $marr["posterName"];
$today = date("d M Y");
$time = date("d M Y", $marr["posterTime"]);
if ($today==$time) {
$time = date("<font color='#FF0000'>วันนี้ .</font>", $marr["posterTime"]);
} else {
$time = date("M d,Y", $marr["posterTime"]);
}

echo "<span class='font'>\n";
echo "<img src=images/icon_dot.gif border=0 alt='Topic $tid'>&nbsp;\n"; # icon หน้ากระทู้
echo "<a href='forum/index.php?board=$bid;action=display;threadid=$tid' target='_blank'>$title[/url]&nbsp;<font color='#C3C3C3'>( $poster) </font></span>
\n";
}

?>

ปรับแต่งได้ตามสบายนะครับ ว่างๆ ก็แวะมาศึกษาธรรมะก็ดีครับ http://www.luangpee.net

10
แสดงกระทู้หน้าเวบไซต์ แบ่งเป็นหมวดหมู่

<?php require("SSI.php"); ?> #อยู่ในโฟเดอไหนก็ใส่ path ให้ถูกนะครับ เช่น ("forum/SSI.php") ใส่ครั้งเดียวบนสุดของ page

<?php  $array = ssi_boardNews(8.0,10 , null ,null , 'array'); # 8.0 หมายถึง บอร์ดที่ต้องการให้แสดง 10 หมายถึงจำนวนกระทู้ที่ต้องการให้แสดง
       foreach ( $array as $my_news_mix )
   {
      echo '<li style="list-style-image: url(images/foot_1.gif);"><a href="', $my_news_mix['href' ],  '"target="_blank">', $my_news_mix['subject'], '[/url]...</li>'; #ตรง (images/foot_1.gif) หมายถึง รูป icon หน้ากระทู้ครับ ถ้าเป็นชื่ออื่น ในโฟเดอร์อื่น ก็ใส่ path ให้ถูก
   }

?>

11
จะติดตั้งเป็นภาษาไทยหรือเปล่าครับ ถ้าติดตั้งภาษาไทย ให้ดาวน์โหลด v.thai (utf-8) เพื่อทำการติดตั้งเป็นภาษาไทย

12
ไม่แน่ใจว่าตั้งชื่อบอร์ดเว้นวรรคหรือป่าวครับ smf brod น่าจะแก้เป็น board หรือ forum พอคลิกแล้ว แสดงว่ามันติดต่อฐานข้อมูลไม่ได้ Connection Problems
Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

13
ขอ url เวบของท่านด้วยครับ จะได้ตรวจสอบให้

14
ต้อง chmod ไฟล์เป็น 777 โดยใช้โปรแกรม ftp เพื่อให้ไฟล์สามารถเขียนทับได้ครับ...

15
ต้องแก้ไขไฟล์ setting.php ให้ตรงกับฐานข้อมูลที่สร้าง และ path ของ forum
เพราะถ้าอยู่ในเครื่องจะเป็น http://localhost/forum แต่ขึ้น server แล้วต้องแก้ไข
แล้วติดตรงไหนบ้างอะครับ

16
พอจำได้ไหมครับว่า ตอนติดตั้ง mod มันเขียนทับไฟล์ไหนบ้าง หรือถ้าไม่แน่ใจให้ไปที่เวบของ smf เลยและดูการติดตั้ง smf+mod นั้นๆ และเขาแก้ไฟล์ไหนบ้าง ให้เอาไฟล์ของเดิมที่เรา backup ก่อนติดตั้ง mod ไปทับไฟล์นั้นครับ

18
นำไอคอนที่ต้องการไปทับไอคอนเดิมครับ

19
สร้างฐานข้อมูลและรันไฟล์ติดตั้ง http://www.xxxx.com/forum/install.php

20
เป็นของฟรีครับ ไม่เสียค่าใช้จ่ายใดๆ ทั้งสิ้น...
ดาวน์โหลดที่ http://www.simplemachines.org/download/
ภาษาไทยดาวน์โหลดที่ http://www.simplemachines.org/download/index.php?languages;lang=thai

ถ้ามีอะไรพอจะช่วยได้ก็โพสต์ถามได้ที่เวบนี้นะครับ จะมีเพื่อนๆที่มีความรู้มาแนะนำ

22
ขอตอบเป็นขั้นตอนนะครับ
1. ให้ท่านเลือกว่าจะติดระบบภาษาไทยแบบไหนระหว่าง utf-8 กับ tis620 ถ้าท่านสร้างหน้าเวบแรกของท่านเป็น tis620 ให้ท่านติดตั้ง smf เป็น tis620 ถ้าหน้าเวบแรกของท่านเป็น utf-8 ให้ติดตั้ง smf เป็น utf-8 เพราะเมื่อท่านนำกระทู้ไปโชว์ที่หน้าเวบแรกจะไม่มีปัญหาเรื่องภาษา
2. เมื่อตัดสินใจได้แล้วว่าจะเลือกแบบไหน ระหว่าง utf-8 กับ tis620 ให้ท่านดาวน์โหลด smf ที่เป็น tis620 หรือ smf ที่เป็น utf-8 ตามที่ได้ตัดสินใจนั้น
3. แตกไฟล์แล้วอัปโหลดขึ้น server และทำการ cmd=777 เพื่อให้ไฟล์สามารถเขียนทับได้
4. สร้างฐานข้อมูลใน control panel ตอนสร้างให้เซต collation ด้วย ถ้าติดตั้งเป็น tis620 เชต เป็น tis620_thai_ci ถ้าติดตั้งเป็น utf-8 ให้เชต collation เป็น utf8_general_ci
5. เมื่อสร้างฐานข้อมูลและเซต collation เสร็จแล้ว กลับมาที่ หน้าเวบและรันไฟล์ติดตั้งได้เลย เช่น http://www.xxxx.com/forum/install.php
6. ดำเนินการจนเสร็จแล้ว ท่านจะมองเห็นหมวดหมู่แรกเป็นตัวเครื่องหมายคำถามอยู่ ให้ดาวน์โหลดไฟล์ setting.php และเปิดด้วย editplus หรือโปรแกรมอื่น แล้วเพิ่มคำสั่งนี้ลงไป $db_character_set = 'tis620'; ก่อนที่ถึงเครื่องหมาย ?> ถ้าเป็น utf-8 ก็เปลี่ยน tis620 เป็น utf-8  และอัปโหลดไฟล์ขึ้นไปทับของเดิมเลย
7. ให้ท่านแก้ไขหมวดหมู่ของบอร์ดแรกโดยเข้าไปแก้ไขในเมนู ผู้ดูแล และทำการแก้ไขบอร์ดฯ เพิ่มบอร์ดฯ(ตามความพอใจเลยครับ)
8. ให้ท่านลองโพสต์ข้อมูลดูและไปดูที่ฐานข้อมูลว่า เป็นภาษาไทยหรือไม่ตรง ฐาน smf_messages ถ้าเป็นภาษาไทยแสดงว่าใช้ได้แล้วครับ แต่ถ้ายังไม่เป็น อย่าเพิ่งเปิดใช้งานเพราะบางทีหน้าเวบเป็นภาษาไทยและฐานข้อมูลเป็นต่างดาวน จะมีปัญหาตอนที่ท่าน backup ฐานข้อมูล หรือย้าย host จะทำให้ภาษาวิบัติ

23
ทับไม่ได้ครับ คนละอันกันนอกจากลบบอร์ดเดิมทิ้งแล้วลิงค์มาบอร์ด smf ใหม่ของท่าน

24
โหลด mod verification ให้ตรงกับเวอชั่นboardที่ท่านใช้ เพื่อมาติดตั้งครับ

25
เปิด index.template.php ของ theme ที่ท่านใช้เพื่อเปรียบเทียบกับ index.template.php ของ default theme
บริเวณแถวนี้
โค้ด: [เลือก]
// Show the [home] button.
echo ($current_action=='home' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'home' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '">' , $txt[103] , '</a>
</td>' , $current_action == 'home' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Show the [help] button.
echo ($current_action == 'help' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'help' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=help">' , $txt[119] , '</a>
</td>' , $current_action == 'help' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// How about the [search] button?
if ($context['allow_search'])
echo ($current_action == 'search' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'search' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=search">' , $txt[182] , '</a>
</td>' , $current_action == 'search' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Is the user allowed to administrate at all? ([admin])
if ($context['allow_admin'])
echo ($current_action == 'admin' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'admin' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=admin">' , $txt[2] , '</a>
</td>' , $current_action == 'admin' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Edit Profile... [profile]
if ($context['allow_edit_profile'])
echo ($current_action == 'profile' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'profile' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=profile">' , $txt[79] , '</a>
</td>' , $current_action == 'profile' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// Go to PM center... [pm]
if ($context['user']['is_logged'] && $context['allow_pm'])
echo ($current_action == 'pm' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'pm' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=pm">' , $txt['pm_short'] , ' ', $context['user']['unread_messages'] > 0 ? '[<strong>'. $context['user']['unread_messages'] . '</strong>]' : '' , '</a>
</td>' , $current_action == 'pm' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

// The [calendar]!
if ($context['allow_calendar'])
echo ($current_action == 'calendar' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'calendar' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=calendar">' , $txt['calendar24'] , '</a>
</td>' , $current_action == 'calendar' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';



// the [member] list button
if ($context['allow_memberlist'])
echo ($current_action == 'mlist' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'mlist' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=mlist">' , $txt[331] , '</a>
</td>' , $current_action == 'mlist' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, show [login] button.
if ($context['user']['is_guest'])
echo ($current_action == 'login' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'login' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=login">' , $txt[34] , '</a>
</td>' , $current_action == 'login' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// If the user is a guest, also show [register] button.
if ($context['user']['is_guest'])
echo ($current_action == 'register' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'register' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=register">' , $txt[97] , '</a>
</td>' , $current_action == 'register' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';


// Otherwise, they might want to [logout]...
if ($context['user']['is_logged'])
echo ($current_action == 'logout' || $context['browser']['is_ie4']) ? '<td class="maintab_active_' . $first . '">&nbsp;</td>' : '' , '
<td valign="top" class="maintab_' , $current_action == 'logout' ? 'active_back' : 'back' , '">
<a href="', $scripturl, '?action=logout;sesc=', $context['session_id'], '">' , $txt[108] , '</a>
</td>' , $current_action == 'logout' ? '<td class="maintab_active_' . $last . '">&nbsp;</td>' : '';

26
ลองเอาไฟล์ index.php ทับลงไปใหม่ครับ

27
http://www.xxxx.com/forum/ssi_examples.php
เลือกเอาเลยครับ
ไม่เข้าใจว่า หน้าแรกของเวบ หรือ หน้าแรกของ forum

28
chmod คือการเปลี่ยนไฟล์ให้สามารถเขียนได้ครับ ให้ใช้โปรแกรม ftp โดยคลิกขวาที่โฟล์เดอร์ของบอร์ดท่านแล้วเลือก permission คลิกเป็น 777 ทั้งหมด และทำการติดตั้งได้เลย

29
ให้ไปแก้ไขที่ฐานข้อมูล ตรง smf_theme นะครับ แล้วคลิกแก้ไข ตรง www ของแต่ theme ละครับ

30
ขอตอบเป็นขั้นตอนนะครับ
1. ให้ท่านเลือกว่าจะติดระบบภาษาไทยแบบไหนระหว่าง utf-8 กับ tis620 ถ้าท่านสร้างหน้าเวบแรกของท่านเป็น tis620 ให้ท่านติดตั้ง smf เป็น tis620 ถ้าหน้าเวบแรกของท่านเป็น utf-8 ให้ติดตั้ง smf เป็น utf-8 เพราะเมื่อท่านนำกระทู้ไปโชว์ที่หน้าเวบแรกจะไม่มีปัญหาเรื่องภาษา
2. เมื่อตัดสินใจได้แล้วว่าจะเลือกแบบไหน ระหว่าง utf-8 กับ tis620 ให้ท่านดาวน์โหลด smf ที่เป็น tis620 หรือ smf ที่เป็น utf-8 ตามที่ได้ตัดสินใจนั้น
3. แตกไฟล์แล้วอัปโหลดขึ้น server และทำการ cmd=777 เพื่อให้ไฟล์สามารถเขียนทับได้
4. สร้างฐานข้อมูลใน control panel ตอนสร้างให้เซต collation ด้วย ถ้าติดตั้งเป็น tis620 เชต เป็น tis620_thai_ci ถ้าติดตั้งเป็น utf-8 ให้เชต collation เป็น utf8_general_ci
5. เมื่อสร้างฐานข้อมูลและเซต collation เสร็จแล้ว กลับมาที่ หน้าเวบและรันไฟล์ติดตั้งได้เลย เช่น http://www.xxxx.com/forum/install.php
6. ดำเนินการจนเสร็จแล้ว ท่านจะมองเห็นหมวดหมู่แรกเป็นตัวเครื่องหมายคำถามอยู่ ให้ดาวน์โหลดไฟล์ setting.php และเปิดด้วย editplus หรือโปรแกรมอื่น แล้วเพิ่มคำสั่งนี้ลงไป $db_character_set = 'tis620'; ก่อนที่ถึงเครื่องหมาย ?> ถ้าเป็น utf-8 ก็เปลี่ยน tis620 เป็น utf-8  และอัปโหลดไฟล์ขึ้นไปทับของเดิมเลย
7. ให้ท่านแก้ไขหมวดหมู่ของบอร์ดแรกโดยเข้าไปแก้ไขในเมนู ผู้ดูแล และทำการแก้ไขบอร์ดฯ เพิ่มบอร์ดฯ(ตามความพอใจเลยครับ)
8. ให้ท่านลองโพสต์ข้อมูลดูและไปดูที่ฐานข้อมูลว่า เป็นภาษาไทยหรือไม่ตรง ฐาน smf_messages ถ้าเป็นภาษาไทยแสดงว่าใช้ได้แล้วครับ แต่ถ้ายังไม่เป็น อย่าเพิ่งเปิดใช้งานเพราะบางทีหน้าเวบเป็นภาษาไทยและฐานข้อมูลเป็นต่างดาวน จะมีปัญหาตอนที่ท่าน backup ฐานข้อมูล หรือย้าย host จะทำให้ภาษาวิบัติ

ถ้ามีปัญหาที่พอใจช่วยเหลือได้เมล์มาที่ [email protected] หรือ http://www.luangpee.net

หน้า: [1] 2