coding -just getting started coding -just getting started
 

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]

Main Menu

coding -just getting started

Started by louis_chypher, March 20, 2007, 08:56:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

louis_chypher

Probablly the wrong forum but go to start somewhere.

Adding a new text box to the registration page -> 



...array('input', 'email', $lang_register_php['email'], 255),   

Made the following change to register.php added after line 74:

//age lock mod --Louis_Chypher@gmail.com *BEGIN
array('input', 'b_day', $lang_register_php['b_day'], 255),
//age lock mod --Louis_Chypher@gmail.com-- *END      

Input box is not being displayed. I know I'm missing something somewhere. Any hints as to why I'm not getting an Input box to display on the registration page?

Also, was wondering if a forum for coppermine coding questions could be added? A forum were those with coppermine experience could help out those who are just starting out.

Thanks!

Nibbler

Probably because you did not actually make an $lang_register_php['b_day'] in the language file. If you want it to appear in different languages then add it into each lang file. If not then just hardcode it like this:

array('input', 'b_day', 'xxx', 255),

Quote from: louis_chypher on March 20, 2007, 08:56:23 PM
Also, was wondering if a forum for coppermine coding questions could be added? A forum were those with coppermine experience could help out those who are just starting out.

We have one, but it's not open to everyone.

louis_chypher

Quote from: Nibbler on March 20, 2007, 10:17:52 PM
Probably because you did not actually make an $lang_register_php['b_day'] in the language file. If you want it to appear in different languages then add it into each lang file. If not then just hardcode it like this:

array('input', 'b_day', 'xxx', 255),


Thank you very much! I will more then likely have a few more questions whiles I get familier with the programs structure.

Quote from: Nibbler on March 20, 2007, 10:17:52 PM

We have one, but it's not open to everyone.

And what does one do to gain access to such a forum?


Joachim Müller

Quote from: louis_chypher on March 21, 2007, 04:43:21 AM
And what does one do to gain access to such a forum?
The coding discussion forum is open for privileged membergroups, i.e. contributors, translators, developers. Bottom line: if you want access there, you'll have to contribute first.
Not needed though to post questions like yours - they are fine on the regular support board.

The coding discussion board is suppossed to be a place where advanced coding questions go into. It is limited to contributors to avoid it from being cluttered with newbie requests like "I need code that does XXX. Code it for me".

louis_chypher

I ran the querry:

INSERT INTO `cpg1410_config` ( `name` , `value` )
VALUES ('bday_required', '1');

which worked fine

In english.php  (around line1509) I inserted below 'email' => 'Email',

'b_day' => 'Birth date mm/dd/yyyy',
'err_b_day_incorrect_format' => 'You must enter a correctly formatted date for access to this site.',

which works fine


In register.php (~line 250)

if ($password != $password_again) $error .= '<li>' . lang_register_php['err_password_mismatch'];

I inserted (below):

//agelock - begin
    if ($CONFIG['allow_duplicate_emails_addr'])
   {   
      list($month, $day, $year) = split('[/]', $b_day);
      if (!(checkdate($month,$day,$year)))
      {
         $error .= '<li>' . $lang_register_php['err_b_day_incorrect_format'];
      }
   }
//agelock - end

I get an input box displayed on the screen, I get some entered data verfication, I get error messages, and I can change the config setting bday_required to enable and disable the checking of the entered field.


In english.php (

  array('Browsable batch-add interface', 'browse_batch_add', 1, 'f=index.htm&amp;as=admin_general_browsable_batch_add&amp;ae=admin_general_browsable_batch_add_end'),
//cpg1.4
)
below line 644 (see above)

I added:

//agelock - begin
array('Enable category age locking', 'enable_age_lock', 1, 'f=index.htm&amp;as=admin_general_agelock_add&amp;ae=admin_general_agelock_add_end'),
//agelock - end

I get on the admin config screen the text and two option buttons (yes,no)

Im trying to figure out how to get the dB setting bday_required displayed as the default value in the admin config?

Ideas, hints and even a direct pointer would be greatly apprecieted!


louis_chypher

I think I got it.

After I posted the previous post it came to Me that perhaps I should have entered:

//agelock - begin
array('Enable category age locking', 'bday_required', 1, 'f=index.htm&amp;as=admin_general_agelock_add&amp;ae=admin_general_agelock_add_end'),
//agelock - end

to match the name of the entered value in the cpg1410_config table


louis_chypher

looking for where/when $USER_DATA gets populated.