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]   Go Down

Author Topic: Making registration fields mandatory  (Read 8426 times)

0 Members and 1 Guest are viewing this topic.

colinmann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Making registration fields mandatory
« on: July 11, 2006, 02:39:43 pm »

Hi,

Is it possible to make registration fields mandatory? For example - the "Profile 1" entry?

Thanks, Colin
« Last Edit: July 11, 2006, 05:17:14 pm by TranzNDance »
Logged

Sami

  • VIP
  • Coppermine addict
  • ***
  • Offline Offline
  • Gender: Male
  • Posts: 3686
  • BMossavari
    • My Project
Re: Making registration fields mandatory
« Reply #1 on: July 11, 2006, 02:50:26 pm »

find these lines(222~227) on your register.php
Code: [Select]
        $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']);
let's see if you want to make profile1 mandatory
add a
Code: [Select]
if (!$profile1) $error .= "<li>it's mandatory to fill in your xxxx";
after
Code: [Select]
$profile1 = addslashes($_POST['user_profile1']);
now your code should be look like this
Code: [Select]
        $profile1 = addslashes($_POST['user_profile1']);
        if (!$profile1) $error .= "<li>it's mandatry to fill in your xxxx";
        $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']);
Logged
‍I don't answer to PM with support question
Please post your issue to related board

colinmann

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 29
Re: Making registration fields mandatory
« Reply #2 on: July 11, 2006, 02:59:50 pm »

Great, thanks very much!
Logged

wuschel_lux

  • Translator
  • Coppermine regular visitor
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 93
    • volleyball.lu - photo gallery & shop
Re: Making registration fields mandatory
« Reply #3 on: February 14, 2007, 08:30:40 am »

Thanks Sami for this post. It works fine but I have a small design problem.

The line 'Optional information' ist still above the aditional fields, but the first four are now mandatory. How can I move this line?

http://www.volleyball.lu/fotogallery/register.php

Thanks
Logged

sinfin

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: Making registration fields mandatory
« Reply #4 on: January 17, 2008, 01:11:29 am »

Perfect, just what I was looking for!!!
Thank you!!
Logged

DawL

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 2
  • The Slave of a Tortured Muse
    • My CoH Fan Fiction Site (for Gallery see link in left Nav menu)
Re: Making registration fields mandatory
« Reply #5 on: January 20, 2008, 12:29:06 am »

Thanks Sami for this post. It works fine but I have a small design problem.

The line 'Optional information' ist still above the aditional fields, but the first four are now mandatory. How can I move this line?

http://www.volleyball.lu/fotogallery/register.php

Thanks


I realize this is old, but since it went unanswered, I thought I'd share this. This is how I changed mine. (Coppermine Photo Gallery 1.4.14 (stable))


In the same file (register.php) find this section:

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)

Simply move the option profle lines you have made to be required ABOVE the line that says "array('label', $lang_register_php['optional_info'])," like this:

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),
        array('input', 'user_profile2', $CONFIG['user_profile2_name'], 255),
        array('label', $lang_register_php['optional_info']),
                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)

For mine, I required the first two fields (profile1 and profile2) to both be filled in, so I moved both of them. It displayed correctly in IE6 and FF2.0.0.11.
My Galleries reside at:

http://coh.iswiz.com/gallery
(related to an online MMORPG I play)
and
http://dee.iswiz.com/gallery
(My private gallery)


Logged

DawL

  • Coppermine newbie
  • Offline Offline
  • Gender: Female
  • Posts: 2
  • The Slave of a Tortured Muse
    • My CoH Fan Fiction Site (for Gallery see link in left Nav menu)
Re: Making registration fields mandatory
« Reply #6 on: January 20, 2008, 12:37:58 am »

....snipped....

My Galleries reside at:

http://coh.iswiz.com/gallery
(related to an online MMORPG I play)
and
http://dee.iswiz.com/gallery
(My private gallery)


As an added note: the PRIVATE gallery contains some artistic nudes. The CoH gallery does not. I thought I'd better add that warning. The CoH gallery is the one with all the field edits.
Logged
Pages: [1]   Go Up
 

Page created in 0.028 seconds with 20 queries.