Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Trying to find Mr. / Mrs. options and country list for registration ....  (Read 6993 times)

0 Members and 1 Guest are viewing this topic.

PhilD_UK

  • Coppermine newbie
  • Offline Offline
  • Posts: 11

I am trying to add an option for "Ms." to the registration options for a new user .... (I am also using cpgShop as a plugin), and can't find where to change the code. I have added the option to the language files in cgpShop, but can't find the source code.
Also, I would like to shorten the "country" list as I only deal within europe .... again I can't find the source code.

Can anyone please point me in the right direction?
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery

These options are added to registration by the CPGShop plugin...

To adjust the choice of Titles:
Update language file in cpgshop/lang/english.php (as you said you did...)  (I just changed the value of 'mrs' from 'Mrs.' to to 'Ms.' but adding is certainly possible) Add whatever additional keys you want...
Code: [Select]
//profile, register
$lang_cs_profile = array(
  'mr'       => "Mr.",
  'mrs'       => "Mrs.",
  'ms'      ==> "Ms.",                 // line added as example
  'prefix'  => "(CPGShop)",
  'title'  => "Title",
Then update cpgshop/libs/cpgTool.class.php
Find:
Code: [Select]
    //here's the customers title
    function profile_title_array(){
        return array('mr','mrs');
    }
and update accordingly... These would be references to the keys (mr, mrs, ms) and not the values (Mr., Mrs., Ms.)
Code: [Select]
    //here's the customers title
    function profile_title_array(){
        return array('mr','mrs', 'ms');   // added 'ms' to returned array of titles as example
    }

The country list can also be adjusted in cpgshop/libs/cpgTool.class.php
Find:
Code: [Select]
    //create country array
    function countries()
    {
        $countries = array(
        "" => "",
        "af" => "Afghanistan",
        "al" => "Albania",
        "dz" => "Algeria",
...
and update as you wish...

I have noted (reported in March 2013 in thread http://forum.coppermine-gallery.net/index.php/topic,67506.0.html ) that these additional fields do NOT get saved when filled out during user registration - they have to be updated later...
The update doesn't show in the debug trace, but this plugin appears to use a different method for issuing SQL.
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

PhilD_UK

  • Coppermine newbie
  • Offline Offline
  • Posts: 11
Re: Trying to find Mr. / Mrs. options and country list for registration ....
« Reply #2 on: January 04, 2014, 01:46:42 am »

Thanks again for your help ....... works a treat (again).  :)

I have learnt more about coding in the last 12 hours than I did in the last three weeks.

Regards

Philip
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery

You're welcome...

RE: my comment:
Quote
I have noted (reported in March 2013 in thread http://forum.coppermine-gallery.net/index.php/topic,67506.0.html ) that these additional fields do NOT get saved when filled out during user registration - they have to be updated later...
The update doesn't show in the debug trace, but this plugin appears to use a different method for issuing SQL.
See the referenced thread for a simple code fix I just posted there...
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money
Pages: [1]   Go Up
 

Page created in 0.049 seconds with 20 queries.