Trying to find Mr. / Mrs. options and country list for registration .... Trying to find Mr. / Mrs. options and country list for registration ....
 

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

Trying to find Mr. / Mrs. options and country list for registration ....

Started by PhilD_UK, January 03, 2014, 11:21:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PhilD_UK

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?

gmc

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...

//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:

    //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.)

    //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:

    //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.
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

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

gmc

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...
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money