forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Installation & Setup => Topic started by: rybosom on January 07, 2005, 10:09:50 am

Title: change "input" in register
Post by: rybosom on January 07, 2005, 10:09:50 am
where can I change <input type="text"> in register for <input type="radio"> ?

Title: Re: change "input" in register
Post by: Joachim Müller on January 07, 2005, 12:26:32 pm
in register.php (but this won't help you very much - you'll have to specify what excatly you want changed).

Joachim
Title: Re: change "input" in register
Post by: rybosom on January 07, 2005, 09:02:55 pm
so, I want to change this

Code: [Select]
<input type="text" style="width: 100%" name="occupation" maxlength="255" value="" class="textinput">
               

to this:

Code: [Select]
Podaj swoja plec:
<input type="radio" name="plec" value="kobieta"> kobieta
<input type="radio" name="plec" value="mezczyzna"> mezczyzna


 



Title: Re: change "input" in register
Post by: Joachim Müller on January 08, 2005, 04:18:45 am
Edit register.php, find
Code: [Select]
array('input', 'occupation', $lang_register_php['occupation'], 255),and replace with
Code: [Select]
array('radio', 'occupation', $lang_register_php['occupation'], 'kobieta','mezczyzna'),
Find
Code: [Select]
        case 'input' :
            if (isset($HTTP_POST_VARS[$element[1]])) {
                $value = $HTTP_POST_VARS[$element[1]];
            } else {
                $value = '';
            }
            echo <<<EOT
        <tr>
            <td width="40%" class="tableb"  height="25">
                        {$element[2]}
        </td>
        <td width="60%" class="tableb" valign="top">
                <input type="text" style="width: 100%" name="{$element[1]}" maxlength="{$element[3]}" value="$value" class="textinput">
                </td>
        </tr>

EOT;
            break;
and add after it (in a new line)
Code: [Select]
        case 'radio' :
            if (isset($_POST[$element[1]])) {
                $value = $_POST[$element[1]];
            } else {
                $value = '';
            }
            if ($element[2]) echo <<<EOT
        <tr>
            <td width="40%" class="tableb"  height="25">
                        {$element[2]}
        </td>
        <td width="60%" class="tableb" valign="top">
                <input type="radio" name="{$element[1]}" id="{$element[1]}1" value="{$element[3]}" class="radio" /><label for="{$element[1]}1" class="clickable_option">{$element[3]}</label>
                <input type="radio" name="{$element[1]}" id="{$element[1]}2" value="{$element[4]}" class="radio" /><label for="{$element[1]}2" class="clickable_option">{$element[4]}</label>
                </td>
        </tr>

EOT;
            break;
Please note that this will only have an impact on your registration form. You will have to modify profile.php and usermgr.php as well to make this consistent.

Joachim
Title: Re: change "input" in register
Post by: rybosom on January 08, 2005, 07:29:44 pm
it's work! thanks! You're great!!!  ;D