Customizing registration Customizing 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

Customizing registration

Started by loverboy, August 13, 2004, 02:18:41 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

loverboy

Hi there,

I'm wondering if it's possible to customize the registration fields. For example, I don't need certain fields (eg occupation) but want to replace them with someone else (eg nickname, experience, etc.).

Hope there's a way to do this.

Thanks!
V

mstralka

#1
There's an easy way and a hard way.
The easy way is to just use the fields that already exist in the database, but relabel them on the Registration page.
Open register.php
Look for:
array('input', 'occupation', $lang_register_php['occupation'], 255),
Change it to
array('input', 'occupation', $lang_register_php['nickname'], 255),

Then, open /lang/english.php
Find:
$lang_register_php = array(
and look for
'occupation' => 'Occupation',
Change this to:
'nickname' => 'Nickname',

Repeat this for each field you want to relabel.  If you want to add new fields, you'll have to do a bit more work.
GO IRISH

loverboy

HI thanks this is very helpful and it seems to work to make the form look right.

I also followed some instructions so htat instead of the registration form being a verification email, it is sent instead to the admin to verify.

However, what seems to happen is that only the username and passwords are sent.

I went into english.php and found the text sent in the email.  the username and password fields seem to be in {}.   I am not sure if this is just default stuff set by coppermine ,but I'd liek to be able to have hte email send out the person's 'occupation', 'location', 'interests' fields.

Would this be possible?

Thanks!

Nibbler

In register.php, find:

        $template_vars = array('{SITE_NAME}' => $CONFIG['gallery_name'],
            '{USER_NAME}' => $user_name,
            '{PASSWORD}' => $password,
            '{ACT_LINK}' => $act_link
            );


and add the stuff you want:


        $template_vars = array('{SITE_NAME}' => $CONFIG['gallery_name'],
            '{USER_NAME}' => $user_name,
            '{PASSWORD}' => $password,
            '{ACT_LINK}' => $act_link,
            '{LOCATION}' => $location,
            '{INTERESTS}' => $interests,
            '{OCCUPATION}' => $occupation
            );


And in the email, you set how you want them to display:

Your username is : "{USER_NAME}"
Your password is : "{PASSWORD}"
Location : "{LOCATION}"
Interests : "{INTERESTS}"
Occupation : "{OCCUPATION}"

Casper

Full insructions for how to edit the fields, or add extra fields, so they show on all relevent pages, such as profile etc., are on this thread in the mods board, http://forum.coppermine-gallery.net/index.php?topic=7827.0
It has been a long time now since I did my little bit here, and have done no coding or any other such stuff since. I'm back to being a noob here

loverboy

This is all very helpful!! Thanks guys.

I have the registration now customized as I want them and will tweak it all a bit later to make the fields al lrequired (as at the moment some are sitll optional).

I also have it setup so that it emails me the info, instead of emailing the person registering so I can approve them.

One thing I still can't figure out - is it possible to set it up so that when I verify the person by clicking the link, the person will automaitcally get an email saying that his /her account has been activated?

Thank you!
V

skybax

You should be able to setup a script that is called when you activate their account to email them. I haven't looked in depth into the process, but that would be the simpliest way to email a "second" registration notice. Shouldn't be that hard to code - just recalling a modified version of the registration email...
(https://coppermine-gallery.com/forum/proxy.php?request=http%3A%2F%2Fwww.skybax.com%2FhotImage%2Fpost_footer.gif&hash=338b65c57a59f0b06311094e697c87794e43d945)
Don't contact me for support over PM or email unless I requested you to do so. Instead: post on the proper board.

loverboy

That sounds awesome... i'm quite clueless with PHP myself (except knowing to follow upload and edit instructions).  If such a script is around, I would love to get hold of it.. anyone?

Thanks!!
V