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

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

ส่งหัวข้อนี้พิมพ์ หน้า: 1 
icon message ผู้เขียน หัวข้อ: กำหนดเพศ และอายุให้ใช้งานบางบอร์ดของ SMF  (อ่าน 1054 ครั้ง)
0 สมาชิก และ 2 ผู้เยี่ยมชม กำลังดูหัวข้อนี้
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
  • ชื่อ: Age & Gender Board Filter Mod
  • ผู้เขียน: Eliana Tamerin
  • นำเสนอโดย: DexMoreGroup
  • ประเภท: Feature Enhancement
  • รองรับ: SMF 1.1.xx
  • ปรับปรุงล่าสุด: 23 กรกฎาคม 2551
  • ต้นฉบับ: Age & Gender Board Filter Mod

รายละเอียด
      กำหนดเพศและอายุสมาชิกเพื่อให้ใช้งานบอร์ดได้บางบอร์ด

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


แก้ไขไฟล์:

file sourcedir/Subs-Boards.php
ค้นหา-->>
โค๊ด: [Select]
b.permission_mode, c.ID_CAT, c.name AS cName, c.catOrder, c.canCollapse

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, b.MinAge, b.gender_sel

ค้นหา-->>
โค๊ด: [Select]
'prev_board' => $prevBoard

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
,
'min_age' => $row['MinAge'],
'gender_sel' => $row['gender_sel'],

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

file sourcedir/Load.php

ค้นหา-->>
โค๊ด: [Select]
b.ID_THEME, b.override_theme, b.permission_mode, b.countPosts

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
, b.MinAge, b.gender_sel

ค้นหา-->>
โค๊ด: [Select]
'posts_count' => empty($row['countPosts']),

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'min_age' => $row['MinAge'],
'gender_sel' => $row['gender_sel'],

ค้นหา-->>
โค๊ด: [Select]
$user_info['query_see_board'] = '(FIND_IN_SET(' . implode(', b.memberGroups) OR FIND_IN_SET(', $user_info['groups']) . ', b.memberGroups))';

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

file sourcedir/ManageBoards.php

ค้นหา-->>
โค๊ด: [Select]
'permission_mode' => 'normal',

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
'min_age' => '0',
'gender_sel' => '-1',

ค้นหา-->>
โค๊ด: [Select]
$boardOptions['access_groups'] = array();

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
$_POST['min_age'] = empty($_POST['min_age']) ? 0 : (int) $_POST['min_age'];
$boardOptions['min_age'] = $_POST['min_age'] > 80 ? 80 : ( $_POST['min_age'] < 0 ? 0 : $_POST['min_age'] );
$boardOptions['gender_sel'] = (int) isset($_POST['gender_sel']) ? $_POST['gender_sel'] : '-1';

file themedir/Profile.template.php

ค้นหา-->>
โค๊ด: [Select]
<td width="40%">
<b>', $txt[563], ':</b>
<div class="smalltext">', $txt[566], ' - ', $txt[564], ' - ', $txt[565], '</div>
</td>
<td class="smalltext">
<input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" /> -
<input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" /> -
<input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" />
</td>

แก้เป็น -->>
โค๊ด: [Select]
<td width="40%">
<b>', $txt[563], ':</b>
<div class="smalltext">', $txt[566], ' - ', $txt[564], ' - ', $txt[565], '</div>
</td>
<td class="smalltext">';
if($context['user']['is_admin'] || !isset($context['member']['birth_date']))
{
echo '
<input type="text" name="bday3" size="4" maxlength="4" value="', $context['member']['birth_date']['year'], '" /> -
<input type="text" name="bday1" size="2" maxlength="2" value="', $context['member']['birth_date']['month'], '" /> -
<input type="text" name="bday2" size="2" maxlength="2" value="', $context['member']['birth_date']['day'], '" />';
}
else
{
// Show age only
echo implode('-', $context['member']['birth_date']);
}
echo '
</td>

ค้นหา-->>
โค๊ด: [Select]
<tr>
<td width="40%"><b>', $txt[231], ': </b></td>
<td>
<select name="gender" size="1">
<option value="0"></option>
<option value="1"', ($context['member']['gender']['name'] == 'm' ? ' selected="selected"' : ''), '>', $txt[238], '</option>
<option value="2"', ($context['member']['gender']['name'] == 'f' ? ' selected="selected"' : ''), '>', $txt[239], '</option>
</select>
</td>
</tr><tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>';

แก้เป็น -->>
โค๊ด: [Select]
<tr>';
// Show gender to admins and unknown gender only for editing
echo '
<td width="40%"><b>', $txt[231], ': </b></td>
<td>';
if($context['user']['is_admin'] || !isset($context['member']['gender']['name']))
{
echo '
<select name="gender" size="1">
<option value="0"></option>
<option value="1"', ($context['member']['gender']['name'] == 'm' ? ' selected="selected"' : ''), '>', $txt[238], '</option>
<option value="2"', ($context['member']['gender']['name'] == 'f' ? ' selected="selected"' : ''), '>', $txt[239], '</option>
</select>';
}
else
{
// Show gender only
if ($context['member']['gender']['name'] == 'm')
echo $txt[238];
else
echo $txt[239];
}
echo '
</td>
</tr>';
echo '
<tr>
<td colspan="2"><hr width="100%" size="1" class="hrcolor" /></td>
</tr>';

file themedir/ManageBoards.template.php

ค้นหา-->>
โค๊ด: [Select]
<td valign="top" align="right">
<textarea name="desc" rows="2" cols="29">', $context['board']['description'], '</textarea>
</td>
</tr>

เพิ่มไว้หลัง -->>
โค๊ด: [Select]
';
// Option for Age Restriction and Gender Restriction.
echo '
<tr>
<td valign="top">
<b>', $txt['min_age_title'], '</b><br />', $txt['min_age_desc'], '<br /><br />
</td>
<td align="right">
<input type="text" name="min_age" value="' . $context['board']['min_age'] . '" size="3" />
</td>
</tr>
<tr>
<td valign="top">
<b>', $txt['gender_title'], '</b><br />', $txt['gender_desc'], '<br /><br />
</td>
<td align="right">
<select name="gender_sel" size="1">
<option value="-1"', ($context['board']['gender_sel'] == "-1" ? ' selected="selected"' : ''), '>', $txt['gender_block_disabled'], '</option>
<option value="0"', ($context['board']['gender_sel'] == "0" ? ' selected="selected"' : ''), '>', $txt['gender_block_gender_set'], '</option>
<option value="1"', ($context['board']['gender_sel'] == "1" ? ' selected="selected"' : ''), '>', $txt['gender_block_girls'], '</option>
<option value="2"', ($context['board']['gender_sel'] == "2" ? ' selected="selected"' : ''), '>', $txt['gender_block_boys'], '</option>
<option value="3"', ($context['board']['gender_sel'] == "3" ? ' selected="selected"' : ''), '>', $txt['gender_block_gender_unset'], '</option>
</select>
</td>
</tr>

file languagedir/Modifications.thai-utf8.php
ค้นหา-->>
โค๊ด: [Select]
?>

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

Database changes
เพิ่มแถวในตาราง _boards
หลัง-->> override_theme
เพิ่ม-->>
`MinAge` tinyint(4) NOT NULL default '0',
`gender_sel` tinyint(4) NOT NULL default '-1',

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



Thailand   ชาย ออฟไลน์ เว็บไซต์
icon message
general ความคิดเห็นที่ 1 เมื่อ: 16 มีนาคม 2554, 05:45:18

พอดีผมเห็นของที่นี่เป็นแบบนี้อ่ะครับ พอจะขอแนวทางปรับแต่งได้มั๊ยครับ




อ่อ..ไม่ต้องเอาเหมือนแบบนี้ก็ได้ครับ เอาแค่แก้ให้เป็นปี พ.ศ. จากมอดตัวนี้อ่ะครับ  Grin

ลิงค์หัวข้อ: http://dexmore.com/topic/162
« แก้ไขครั้งสุดท้าย: 16 มีนาคม 2554, 06:31:14 โดย กฤษ » Windows XP    Firefox 3.6.9   see ip บันทึกการเข้า
โฮสต์ดีๆ บริการด้วยใจ
*
*


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 2 เมื่อ: 16 มีนาคม 2554, 09:42:58
ตรงใหนที่เป็น ค.ศ. แล้วต้องการให้เป็น พ.ศ. ก็ +543 เข้าไปครับ

หลักการนี้ใช้ได้ทุกที่

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



Thailand   ชาย ออฟไลน์
icon message
general ความคิดเห็นที่ 3 เมื่อ: 17 ธันวาคม 2554, 01:28:42
Age & Gender Board Filter Mod

คือเมื่อลงตัวนี้แล้ว พอเรากำหนด อายุการใช้งานบางบอร์ดเสร็จ มันเป็นแบบ all สมาชิกทั้งหมดหรือครับ หรือ ตั้งค่าได้เฉพาะบางคน

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


!Personal

Germany   ชาย ผู้เริ่มต้นกระทู้นี้ ออฟไลน์544566157 DexMore DexMore DexMore
เว็บไซต์
icon message
general ความคิดเห็นที่ 4 เมื่อ: 17 ธันวาคม 2554, 08:55:10
กำหนดเพศ กับอายุครับ

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

Creative Commons License

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

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

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