ผู้เขียน หัวข้อ: เพิ่มเพศ(gender)ในฟอรั่ม  (อ่าน 879 ครั้ง)

0 สมาชิก และ 1 บุคคลทั่วไป กำลังดูหัวข้อนี้

ออฟไลน์ smf

  • [color=green][i]"ถ้าคุณไม่สามารถอธิบายอย่างง่ายๆ ให้คนอื่นเข้าใจได้แล้วล่ะก็ แสดงว่าคุณยังเข้าใจมันไม่ดีพอ"[/i][/color]
  • Administrator
  • Hero Member
  • *****
  • กระทู้: 1,368
  • พอยท์: 5
    • ดูรายละเอียด
    • pordoo.com
    • อีเมล์
เพิ่มเพศ(gender)ในฟอรั่ม
« เมื่อ: 12 พฤศจิกายน 2015, 12:38:01 »
Mod Name:More Genders
http://custom.simplemachines.org/mods/index.php?mod=2152





File Edits
./Sources/Load.php
Find: [Select]


   $gendertxt = $profile['gender'] == 2 ? $txt['female'] : ($profile['gender'] == 1 ? $txt['male'] : '');

Replace With: [Select]


   switch($profile['gender']) {
            case 5:
                $gendertxt = $txt['intersexed'];
                $genderimg = 'intersexed.gif';
                break;
            case 4:
                $gendertxt = $txt['transf2m'];
                $genderimg = 'transexual.gif';
                break;
            case 3:
                $gendertxt = $txt['transm2f'];
                $genderimg = 'transexual.gif';
                break;
            case 2:
                $gendertxt = $txt['female'];
                $genderimg = 'Female.gif';
                break;
            case 1:
                $gendertxt = $txt['male'];
                $genderimg = 'Male.gif';
                break;
            default:
                $gendertxt = '';
                break;
        }


Find: [Select]


         'image' => !empty($profile['gender']) ? '<img class="gender" src="' . $settings['images_url'] . '/' . ($profile['gender'] == 1 ? 'Male' : 'Female') . '.gif" alt="' . $gendertxt . '" />' : ''

Replace With: [Select]


         
'image' => !empty($profile['gender']) ? '<img class="gender" src="' . $settings['images_url'] . '/' . $genderimg . '" alt="' . $gendertxt . '" />' : ''


./Sources/ManageMembers.php
Find: [Select]


            'values' => array('0', '1', '2'),

Replace With: [Select]


            'values' => array('0', '1', '2', '3', '4', '5'),


./Sources/Profile-Modify.php

Find: [Select]


         'options' => 'return array(0 => \'\', 1 => $txt[\'male\'], 2 => $txt[\'female\']);',

Replace With: [Select]


         'options' => 'return array(
                            0 => \'\',
                            1 => $txt[\'male\'],
                            2 => $txt[\'female\'],
                            3 => $txt[\'transm2f\'],
                            4 => $txt[\'transf2m\'],
                            5 => $txt[\'intersexed\'],
                            );',


./Themes/default/ManageMembers.template.php
Find: [Select]


                        <label for="gender-2"><input type="checkbox" name="gender[]" value="2" id="gender-2" checked="checked" class="input_check" /> ', $txt['female'], '</label>

Add After: [Select]


                        <label for="gender-3"><input type="checkbox" name="gender[]" value="3" id="gender-3" checked="checked" class="input_check" /> ', $txt['transm2f'], '</label>
                        <label for="gender-4"><input type="checkbox" name="gender[]" value="4" id="gender-4" checked="checked" class="input_check" /> ', $txt['transf2m'], '</label>
                        <label for="gender-5"><input type="checkbox" name="gender[]" value="5" id="gender-5" checked="checked" class="input_check" /> ', $txt['intersexed'], '</label>


./Themes/default/languages/Modifications.english.php
Find (at the end of the file): [Select]

?>

Add Before: [Select]


//More Genders
$txt['transm2f'] = 'Transgendered Female';
$txt['transf2m'] = 'Transgendered Male';
$txt['intersexed'] = 'Intersexed';


./Themes/default/languages/Modifications.english-utf8.php
Find (at the end of the file): [Select]

?>

Add Before: [Select]


//More Genders
$txt['transm2f'] = 'Transgendered Female';
$txt['transf2m'] = 'Transgendered Male';
$txt['intersexed'] = 'Intersexed';

This operation isn't vital to the installation of this mod.


File Operations
Move the included file "files/transexual.gif" to "./Themes/default/images".
Move the included file "files/intersexed.gif" to "./Themes/default/images".