22 พฤษภาคม 2555, 15:12:36
ยินดีต้อนรับผู้เยี่ยมชม
  • noavata
  • ยินดีต้อนรับคุณ, ผู้เยี่ยมชม กรุณา เข้าสู่ระบบ หรือ ลงทะเบียน
    เข้าสู่ระบบด้วยชื่อผู้ใช้ รหัสผ่าน และระยะเวลาในเซสชั่น
Page Rank

ทำเว็บไซต์ | แต่งบอร์ด | ออกแบบ | SMF | Joomla | Drupal | WordPress | JQuery | CMS | ECommerce | Tel. +668-08577477

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: ทำ SMF 2.0 ให้แสดงเวลาเป็นวินาทีและแสดงปีเป็น 25xx  (อ่าน 1528 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!NeverDie

United States Minor Outlying Islands   หญิง ผู้เริ่มต้นกระทู้นี้ ออฟไลน์ เว็บไซต์
  • ชื่อ : Conversion time
  • ผู้เขียน: Crazy™
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: New Feature
  • รองรับ: SMF 2.0.xx
  • ปรับปรุงล่าสุด: 23 มิถุนายน 2553
  • ต้นฉบับ: Conversion time

รายละเอียด
      แก้ไขเวลาให้เป็น นาที, วินาที ใน SMF 2.0.xx

แก้ไขไฟล์:

file Sources/Subs.php

ค้นหา -->>
โค๊ด: [Select]
// Format a time to make it look purdy.
function timeformat($log_time, $show_today = true, $offset_type = false)
{
global $context, $user_info, $txt, $modSettings, $smcFunc;

// Offset the time.
if (!$offset_type)
$time = $log_time + ($user_info['time_offset'] + $modSettings['time_offset']) * 3600;
// Just the forum offset?
elseif ($offset_type == 'forum')
$time = $log_time + $modSettings['time_offset'] * 3600;
else
$time = $log_time;

// We can't have a negative date (on Windows, at least.)
if ($log_time < 0)
$log_time = 0;

// Today and Yesterday?
if ($modSettings['todayMod'] >= 1 && $show_today === true)
{
// Get the current time.
$nowtime = forum_time();

$then = @getdate($time);
$now = @getdate($nowtime);

// Try to make something of a time format string...
$s = strpos($user_info['time_format'], '%S') === false ? '' : ':%S';
if (strpos($user_info['time_format'], '%H') === false && strpos($user_info['time_format'], '%T') === false)
{
$h = strpos($user_info['time_format'], '%l') === false ? '%I' : '%l';
$today_fmt = $h . ':%M' . $s . ' %p';
}
else
$today_fmt = '%H:%M' . $s;

// Same day of the year, same year.... Today!
if ($then['yday'] == $now['yday'] && $then['year'] == $now['year'])
return $txt['today'] . timeformat($log_time, $today_fmt, $offset_type);

// Day-of-year is one less and same year, or it's the first of the year and that's the last of the year...
if ($modSettings['todayMod'] == '2' && (($then['yday'] == $now['yday'] - 1 && $then['year'] == $now['year']) || ($now['yday'] == 0 && $then['year'] == $now['year'] - 1) && $then['mon'] == 12 && $then['mday'] == 31))
return $txt['yesterday'] . timeformat($log_time, $today_fmt, $offset_type);
}

$str = !is_bool($show_today) ? $show_today : $user_info['time_format'];

if (setlocale(LC_TIME, $txt['lang_locale']))
{
foreach (array('%a', '%A', '%b', '%B') as $token)
if (strpos($str, $token) !== false)
$str = str_replace($token, !empty($txt['lang_capitalize_dates']) ? $smcFunc['ucwords'](strftime($token, $time)) : strftime($token, $time), $str);
}
else
{
// Do-it-yourself time localization.  Fun.
foreach (array('%a' => 'days_short', '%A' => 'days', '%b' => 'months_short', '%B' => 'months') as $token => $text_label)
if (strpos($str, $token) !== false)
$str = str_replace($token, $txt[$text_label][(int) strftime($token === '%a' || $token === '%A' ? '%w' : '%m', $time)], $str);
if (strpos($str, '%p'))
$str = str_replace('%p', (strftime('%H', $time) < 12 ? 'am' : 'pm'), $str);
}

// Windows doesn't support %e; on some versions, strftime fails altogether if used, so let's prevent that.
if ($context['server']['is_windows'] && strpos($str, '%e') !== false)
$str = str_replace('%e', ltrim(strftime('%d', $time), '0'), $str);

// Format any other characters..
return strftime($str, $time);
}

แก้เป็น -->>
ขออภัย! ท่านไม่สามารถเข้าถึงข้อมูลส่วนนี้ได้ กรุณาอ่าน เงื่อนไขการใช้งาน DexMore.Com

file languages/index.thai-utf8.php

เพิ่ม -->>
โค๊ด: [Select]
$txt['second'] = 'วินาทีที่ผ่านมา';
$txt['minute'] ='นาทีที่ผ่านมา';
$txt['hour'] ='ชั่วโมงที่ผ่านมา';

การตั้งค่า
ผู้ดูแล --> Features and Options --> Default time format : %e %B %Y, %H:%M:%S
*หมายเหตุ: หากเป็น $windows Server แก้ %e เป็น %d

ผลที่ได้




ลิงค์หัวข้อ: http://dexmore.com/topic/1539
Windows XP    Firefox 3.6.3   see ip บันทึกการเข้า
ดูรายการสิ่งของบัตรผ่านห้องเกมส์ใช้ได้ 30 วัน  

-:-DexMore.Com แหล่งมั่วสุมทางปัญญา-:-
*
*


!Personal

Germany   ชาย ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 1 เมื่อ: 12 พฤษภาคม 2553, 19:30:10
ลองแล้วครับ smf 2.0 ได้ทุกเวอร์ครับ..

ลิงค์หัวข้อ: http://dexmore.com/topic/1539
Windows XP    Firefox 3.6.3   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 2 เมื่อ: 24 มกราคม 2554, 23:11:52
เพิ่งสมัคร เพราะอยากจะเปลี่ยนเวลาอังกฤษ เป็นไทย (ส่วนพ.ศ. ทำได้แล้ว)  ไม่ทราบว่าต้องสะสม chips 500 money..เพื่อจะแลกซื้อ เหรียญเงิน... เพื่อดูโค้ด ต้องทำไง

ลิงค์หัวข้อ: http://dexmore.com/topic/1539
« แก้ไขครั้งสุดท้าย: 24 มกราคม 2554, 23:14:52 โดย mano » Windows NT 6.1    Firefox 3.6.13   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*
*


!Personal

Germany   ชาย ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 3 เมื่อ: 24 มกราคม 2554, 23:26:23
ภาษาไทยที่ใหนหรือครับ?

ลิงค์หัวข้อ: http://dexmore.com/topic/1539
Windows XP    Firefox 3.5.16   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 4 เมื่อ: 25 มกราคม 2554, 08:45:28
เวลาตรงกระทู้เร็ว ๆ นี้ และที่โพสต์โดย... ดูตามรูป



ลิงค์หัวข้อ: http://dexmore.com/topic/1539
Windows NT 6.1    Firefox 3.6.13   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 5 เมื่อ: 25 มกราคม 2554, 10:50:43
เพิ่งจะทดสอบใช้ substr และ strpos ช่วย

   $str = substr($str, 0, strpos($str, ',')). ', '. strftime('%H.%M', $time);

 ..ดังรูป




ลิงค์หัวข้อ: http://dexmore.com/topic/1539
Windows NT 6.1    Firefox 3.6.13   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*
*


!Personal

Germany   ชาย ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 6 เมื่อ: 25 มกราคม 2554, 11:07:23
การตั้งค่าเขาก็บอกอยู่นะครับ ล่างๆ กระทู้ เนื้อหาก็ไม่ได้ซ่อน.. hmmm hmmm hmmm

ลิงค์หัวข้อ: http://dexmore.com/topic/1539
Windows XP    Firefox 3.5.16   see ip บันทึกการเข้า
ดูรายการสิ่งของสำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  สำหรับติดหมุดกระทู้ของคุณ!  เพิ่มเวลาที่อยู่ในระบบอีก 12 ชั่วโมง  น้องหมี..เอาไว้กอดนอนแทนกิ๊ก  สำหรับบอกรักใครสักคน ก็ส่งไปให้เขาเลย!  
*



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 7 เมื่อ: 25 มกราคม 2554, 11:51:39
โทษที ดูไม่ละเอียด พอดีไปเห็นคำว่า
แก้เป็น -->>
ขออภัย!  ...  (ก็เลยนึกว่า จะดูโค้ดได้ ต้องสะสม Chips 500 Mony ไปแลก "ดาวเงิน")

พอเห็นบอกดูล่าง ๆ จึงสังเกตอีกที  ขอบคุณมาก  
คำสั่งที่ว่าแก้ขัด ก็ยังมีบักอยู่ เพราะถ้าเกิด "วันนี้" แสดงผลผิดพลาด

ต้องขอขอบคุณอีกที (time format) ...

การตั้งค่า
ผู้ดูแล --> Features and Options --> Default time format
: %e %B %Y, %H:%M:%S
*หมายเหตุ: หากเป็น $windows Server แก้ %e เป็น %d

ลิงค์หัวข้อ: http://dexmore.com/topic/1539
« แก้ไขครั้งสุดท้าย: 25 มกราคม 2554, 12:03:11 โดย mano » Windows NT 6.1    Firefox 3.6.13   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
ส่งหัวข้อนี้พิมพ์ หน้า: 1 
กระโดดไป:  

Creative Commons License

SMF Thai Translation Powered by SMF © 2006–2012, Simple Machines LLC

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : 19 พฤษภาคม 2555, 20:01:20

jQuery Plugin Copyright © 2551-2555 Themes Design & Hosting by DexMoreGroup

Sitemap | Thai Simple Machines Forum support SMF Thai

Web Begining | SMF Modifications | SMF Thai Translation Web Begining

Drupal | WordPress | CMS Joomla | jQuery Plugin | Web Graphics CMS Joomla