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

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

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: Todays Birthday : มาทำวันเกิดสมาชิกกัน  (อ่าน 879 ครั้ง)
0 สมาชิก และ 1 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*



Thailand   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์
icon message
general เมื่อ: 31 มกราคม 2553, 11:14:33
  • ชื่อ: TodaysBirthday
  • ผู้เขียน: Bulakbol
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: Feature Enhancement
  • รองรับ: SMF 1.1.xx, 2.0.xx
  • ปรับปรุงล่าสุด: 2 มิถุนายน 2552
  • ต้นฉบับ: TodaysBirthday

รายละเอียด
      ดูตัวอย่างของ MOD ตัวนี้ได้ที่หน้าแรกบอร์ด ด้านล่างศูนย์กลางข้อมูลนะครับ ตั้งค่าในปฏิทิน ให้แสดงวันเกิดล่วงหน้ากี่วัน ที่สำคัญจะต้องมีสมาชิกที่มีวันเกิดในช่วงเวลาที่กำหนด ถ้าให้แสดงวันเกิดวันนี้ก็ต้องมีสมาชิกที่เกิดวันนี้

ตัวอย่าง


แก้ไขไฟล์:

file Sources/BoardIndex.php

ค้นหา -->>
โค๊ด: [Select]
$context['calendar_holidays'] = array();
for ($i = $now; $i < $now + $days_for_index; $i += 86400)
{
if (isset($holidays[strftime('%Y-%m-%d', $i)]))
$context['calendar_holidays'] = array_merge($context['calendar_holidays'], $holidays[strftime('%Y-%m-%d', $i)]);
}

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

ค้นหา -->>
โค๊ด: [Select]
for ($i = 0, $n = count($context['calendar_birthdays']); $i < $n; $i++)
$context['calendar_birthdays'][$i]['is_last'] = !isset($context['calendar_birthdays'][$i + 1]);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// separate todays from upcoming birthdays
if (!empty($context['calendar_birthdays']))
{
$context['bdays'] = array(
'today' => array(),
'soon' => array(),
);
foreach ($context['calendar_birthdays'] as $member)
{
if ($member['is_today'])
$context['bdays']['today'][] = '<a href="'. $scripturl. '?action=profile;u='. $member['id']. '">'.
(!empty($member['color']) ? '<span style="color: '. $member['color']. ';">' : '') . '<b>' .$member['name'] . '</b>' .
(isset($member['age']) ? '(' . $member['age'] . ')' : '') . (!empty($member['color']) ? '</span>' : '') . '</a>';
else
$context['bdays']['soon'][] = '<a href="'. $scripturl. '?action=profile;u='. $member['id']. '">' .
(!empty($member['color']) ? '<span style="color: '. $member['color']. ';">' : ''). $member['name'] .
(isset($member['age']) ? '(' . $member['age'] . ')' : '') . (!empty($member['color']) ? '</span>' : '') . '</a>';
}
}

ค้นหา -->>
โค๊ด: [Select]
for ($i = 0, $n = count($context['calendar_events']); $i < $n; $i++)
$context['calendar_events'][$i]['is_last'] = !isset($context['calendar_events'][$i + 1]);

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
// separate Todays from upcoming events
if (!empty($context['calendar_events']))
{
$context['events'] = array(
'today' => array(),
'soon' => array(),
);

foreach ($context['calendar_events'] as $event)
{
if ($event['is_today'])
$context['events']['today'][] = ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '').
($event['href'] == '' ? '' : '<a href="' . $event['href'] . '">') . '<strong>' . $event['title'] . '</strong>' . ($event['href'] == '' ? '' : '</a>');
else
$context['events']['soon'][] = ($event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '').
($event['href'] == '' ? '' : '<a href="' . $event['href'] . '">') . $event['title'] . ($event['href'] == '' ? '' : '</a>');
}
}


file Themes/default/BoardIndex.template.php

ค้นหา -->>
โค๊ด: [Select]
<td class="windowbg2" width="100%">
<span class="smalltext">';

// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['calendar_holidays']))
echo '
<span style="color: #', $modSettings['cal_holidaycolor'], ';">', $txt['calendar5'], ' ', implode(', ', $context['calendar_holidays']), '</span><br />';

// People's birthdays. Like mine. And yours, I guess. Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '
<span style="color: #', $modSettings['cal_bdaycolor'], ';">', $context['calendar_only_today'] ? $txt['calendar3'] : $txt['calendar3b'], '</span> ';
/* Each member in calendar_birthdays has:
id, name (person), age (if they have one set?), is_last. (last in list?), and is_today (birthday is today?) */

แก้เป็น -->>
โค๊ด: [Select]
<td class="windowbg2" width="100%">';

echo '
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="smalltext">';

// Holidays like "Christmas", "Chanukah", and "We Love [Unknown] Day" :P.
if (!empty($context['holidays']))
{
if (!empty($context['holidays']['today']))
echo count($context['holidays']['today']) == 1 ? $txt['todays_holiday'] : $txt['todays_holidays'], ' <span style="color: #', $modSettings['cal_holidaycolor'], ';"><strong>', implode(', ', $context['holidays']['today']), '</strong></span><br />';
// upcoming holiday
if (!empty($context['holidays']['soon']))
echo count($context['holidays']['soon']) == 1 ? $txt['upcoming_holiday'] : $txt['upcoming_holidays'], ' <span style="color: #', $modSettings['cal_holidaycolor'], ';">', implode(', ', $context['holidays']['soon']), '</span><br />';
}

// People's birthdays.  Like mine.  And yours, I guess.  Kidding.
if (!empty($context['calendar_birthdays']))
{
echo '<span class="smalltext" style="color: #', $modSettings['cal_bdaycolor'], ';">';
if (!empty($context['bdays']['today']))
echo count($context['bdays']['today']) == 1 ? $txt['todays_birthday'] : $txt['todays_birthdays'], ' ', implode(', ', $context['bdays']['today']), '<br />';
// upcoming birthdays
if (!empty($context['bdays']['soon']))
echo count($context['bdays']['soon']) == 1 ? $txt['upcoming_birthday'] : $txt['upcoming_birthdays'], ' ', implode(', ', $context['bdays']['soon']), '<br />';
echo '</span>';
}

// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '<span class="smalltext" style="color: #', $modSettings['cal_eventcolor'], ';">';
if (!empty($context['events']['today']))
echo count($context['events']['today']) == 1 ? $txt['todays_event'] : $txt['todays_events'], ' ', '<b>', implode(', ', $context['events']['today']), '</b><br />';
// upcoming events
if (!empty($context['events']['soon']))
echo count($context['events']['soon']) == 1 ? $txt['upcoming_event'] : $txt['upcoming_events'], ' ', implode(', ', $context['events']['soon']), '<br />';
// Show a little help text to help them along ;).
if ($context['calendar_can_edit'])
echo '(<a href="', $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
echo '</span>';
}
echo '
</td>
</tr>
</table>
</td>
</tr>';
}

ค้นหา -->>
โค๊ด: [Select]
foreach ($context['calendar_birthdays'] as $member)
echo '

แก้เป็น -->>
โค๊ด: [Select]
/* please do not delete

ค้นหา -->>
โค๊ด: [Select]
}
// Events like community get-togethers.
if (!empty($context['calendar_events']))
{
echo '
<span style="color: #', $modSettings['cal_eventcolor'], ';">', $context['calendar_only_today'] ? $txt['calendar4'] : $txt['calendar4b'], '</span> ';
/* Each event in calendar_events should have:
title, href, is_last, can_edit (are they allowed?), modify_href, and is_today. */
foreach ($context['calendar_events'] as $event)
echo '
', $event['can_edit'] ? '<a href="' . $event['modify_href'] . '" style="color: #FF0000;">*</a> ' : '', $event['href'] == '' ? '' : '<a href="' . $event['href'] . '">', $event['is_today'] ? '<b>' . $event['title'] . '</b>' : $event['title'], $event['href'] == '' ? '' : '</a>', $event['is_last'] ? '<br />' : ', ';

// Show a little help text to help them along ;).
if ($context['calendar_can_edit'])
echo '
(<a href="', $scripturl, '?action=helpadmin;help=calendar_how_edit" onclick="return reqWin(this.href);">', $txt['calendar_how_edit'], '</a>)';
}
echo '
</span>
</td>
</tr>';
}

แก้เป็น -->>
โค๊ด: [Select]
TodaysBirthday mod ends */


file Themes/default/languages/index.thai-utf8.php

ค้นหา -->>
โค๊ด: [Select]
$txt['calendar4'] = 'กิจกรรม:';

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

ลิงค์หัวข้อ: http://dexmore.com/topic/278
Windows XP    Firefox 3.5.7   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
ส่งหัวข้อนี้พิมพ์ หน้า: 1 
กระโดดไป:  

Creative Commons License

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

WordPress Google เข้าเยี่ยมชมหน้านี้ล่าสุดเมื่อ : 5 ชั่วโมงที่ผ่านมา

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