Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: 1 [2]   Go Down

Author Topic: field required at registration  (Read 16060 times)

0 Members and 1 Guest are viewing this topic.

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: field required at registration
« Reply #20 on: July 28, 2008, 10:02:34 pm »

You should know my reply already: post a link to the page you're refering to. I've told you so often that it hurts. When will you learn to post your questions properly?
Logged

digof

  • Coppermine newbie
  • Offline Offline
  • Posts: 10
Re: field required at registration
« Reply #21 on: October 19, 2008, 05:20:59 am »

How Can I make the custom field: "GENDER" that I made, SELECTABLE? So people can only choose one: male/female or man/woman? Not write one of them in the field?
I already made custom fields nr 1, 2 and 3 mandatory as for your instruction:
In admin. mode I created the fields Birthday, Gender and State

In register.php


this Code:
Code:
Code: [Select]
    $form_data = array(
        array('label', $lang_register_php['required_info']),
        array('input', 'username', $lang_register_php['username'], 25),
        array('password', 'password', $lang_register_php['password'], 25),
        array('password', 'password_verification', $lang_register_php['password_again'], 25),
        array('input', 'email', $lang_register_php['email'], 255),
array('label', $lang_register_php['optional_info']),
                array('input', 'user_profile1', $CONFIG['user_profile1_name'], 255),
                array('input', 'user_profile2', $CONFIG['user_profile2_name'], 255),
                array('input', 'user_profile3', $CONFIG['user_profile3_name'], 255),
                array('input', 'user_profile4', $CONFIG['user_profile4_name'], 255),
                array('input', 'user_profile5', $CONFIG['user_profile5_name'], 255),
               array('textarea', 'user_profile6', $CONFIG['user_profile6_name'], 255)
        );

I Replaced it with:
Code:
Code: [Select]
    $form_data = array(
        array('label', $lang_register_php['required_info']),
        array('input', 'username', $lang_register_php['username'], 25),
        array('password', 'password', $lang_register_php['password'], 25),
        array('password', 'password_verification', $lang_register_php['password_again'], 25),
        array('input', 'email', $lang_register_php['email'], 255),
        array('input', 'user_profile1', $CONFIG['user_profile1_name'], 255),// Added for fullname mandatory Mod
        array('input', 'user_profile2', $CONFIG['user_profile2_name'], 255),// Added for fullname mandatory Mod
        array('input', 'user_profile3', $CONFIG['user_profile3_name'], 255),// Added for fullname mandatory Mod
array('label', $lang_register_php['optional_info']),
//              array('input', 'user_profile1', $CONFIG['user_profile1_name'], 255), // Commented for fullname mandatory Mod
//              array('input', 'user_profile2', $CONFIG['user_profile2_name'], 255), // Commented for fullname mandatory Mod
//              array('input', 'user_profile3', $CONFIG['user_profile3_name'], 255), // Commented for fullname mandatory Mod
                array('input', 'user_profile4', $CONFIG['user_profile4_name'], 255),
                array('input', 'user_profile5', $CONFIG['user_profile5_name'], 255),
               array('textarea', 'user_profile6', $CONFIG['user_profile6_name'], 255)
        );

this code:
Code:
Code: [Select]
    $email = trim(get_post_var('email'));
        $profile1 = addslashes($_POST['user_profile1']);
        $profile2 = addslashes($_POST['user_profile2']);
        $profile3 = addslashes($_POST['user_profile3']);
        $profile4 = addslashes($_POST['user_profile4']);
        $profile5 = addslashes($_POST['user_profile5']);
$profile6 = addslashes($_POST['user_profile6']);

replaced with:
Code:
   
Code: [Select]
$email = trim(get_post_var('email'));
    $profile1 = trim(get_post_var('user_profile1')); // Added for fullname mandatory Mod
    $profile2 = trim(get_post_var('user_profile2')); // Added for fullname mandatory Mod
    $profile3 = trim(get_post_var('user_profile3')); // Added for fullname mandatory Mod
//      $profile1 = addslashes($_POST['user_profile1']); // Commented for fullname mandatory Mod
//      $profile2 = addslashes($_POST['user_profile2']); // Commented for fullname mandatory Mod
//      $profile3 = addslashes($_POST['user_profile3']); // Commented for fullname mandatory Mod
        $profile4 = addslashes($_POST['user_profile4']);
        $profile5 = addslashes($_POST['user_profile5']);
$profile6 = addslashes($_POST['user_profile6']);

after this Code:
Code:
Code: [Select]
    if ($password != $password_again) $error .= '<li>' . $lang_register_php['err_password_mismatch'];
I ADDED this code:

Code:
Code: [Select]
    if (utf_strlen($profile1) < 8 || !eregi("^([0-9]{2})+/+([0-9]{2})+/+[0-9]{4}$",$profile1)) $error .= '<li>' . "Birthday must

be like this-16/09/2000 "; // Added for fullname mandatory Mod
    if (utf_strlen($profile2) < 2) $error .= '<li>' . "Gender"; // Added for fullname mandatory Mod
    if (utf_strlen($profile3) < 2) $error .= '<li>' . "Parents"; // Added for fullname mandatory Mod

replaced this code (second appearance of this code):
Code:
Code: [Select]
                                                        $template_vars = array(
                                                                        '{SITE_NAME}' => $CONFIG['gallery_name'],
                                                                        '{USER_NAME}' => $user_name,
                                                                        '{ACT_LINK}' => $act_link,
        );
with this code:
Code:
Code: [Select]
                                                        $template_vars = array(
                                                                        '{SITE_NAME}' => $CONFIG['gallery_name'],
                                                                        '{USER_NAME}' => $user_name,
                                                                        '{ACT_LINK}' => $act_link,
        '{USER_MAIL}' => $email, // Added for Fullname mandatory Mod
        '{Birthday}' => $profile1, // Added for Fullname mandatory Mod
        '{Gender}' => $profile2, // Added for Fullname mandatory Mod
        '{State}' => $profile3, // Added for Fullname mandatory Mod
                                                        );
And in Lang/english.php

this code:
Code:
Code: [Select]
$lang_register_approve_email = <<<EOT
A new user with the username "{USER_NAME}" has registered in your gallery.

In order to activate the account, you need to click on the link below or copy and paste it in your web browser.

<a href="{ACT_LINK}">{ACT_LINK}</a>

EOT;

Replaced with this
Code:
Code: [Select]
$lang_register_approve_email = <<<EOT
A new user with

the username: {USER_NAME}
E-mail Address {USER_MAIL}
Birthday: {Birthday}
Gender: {Gender}
State: {State}

has registered in your gallery.

In order to activate the account, you need to click on the link below or copy and paste it in your web browser.

<a href="{ACT_LINK}">{ACT_LINK}</a>

EOT;

Everything is working fine but I want people to click on MALE OR FEMALE, instead of writing
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: field required at registration
« Reply #22 on: October 19, 2008, 02:47:48 pm »

Logged
Pages: 1 [2]   Go Up
 

Page created in 0.022 seconds with 20 queries.