I'm looking to modify the registration form to include full contact information to be used for our arts council's artists registry database. I'm a total newbie at this, but I think the gallery format is the best way to approach the online artists registry. Any suggestions?
Posts: 271
this would take some detailed work within and with the creation of new varibles.
Posts: 39
Hi penny
I recently did something similar at http://www.moopics.com (well if I understand what you're saying it's similar)
Depending on how experienced you are with php it shouldn't take that long to do. At the moment I dont have a mod for it.
If you can let me know if it is what you're looking for I'll try and put some notes together so that you could do it
Aaron Brockhurst
Covenant Solutions
Posts: 2
Yes, this is what I'm looking for. If you wouldn't mind, I'd really appreciate any help you can give.
Posts: 39
Hi Penny
It'll take a couple of days to put together, hopefully I'll be able to complete it by the weekend but may run till after easter.
Aaron
Posts: 39
Hi Penny
Apologies for the delay
OK, from memory (and forgive me if I miss something) but there are 3 files that you need to change.
1) in the directory html you need to make the following changes to the userData.inc file:
At the line:
if (!isset($uname)) { $uname=""; }
if (!isset($old_password)) { $old_password=""; }
if (!isset($new_password1)) { $new_password1=""; }
if (!isset($new_password2)) { $new_password2=""; }
add the following code for each field you want the person to complete
if (!isset($fieldname)) { $fieldname=""; }
Further down in the file you'll see the table and row entries for the form the user has to complete. Again add the following for each field you want them to add (you'll need to change the variable "fieldname" to some suitable, eg address, tel, post code, etc)
<?php if ($allowChange["fieldname"] === true) { ?>
<tr>
<td class="adminPlain">
<?php echo _("fieldname") ?>
</td>
<td>
<input type=text name="fieldname" value="<?php echo $fieldname ?>">
</td>
</tr>
<?php echo errorRow("fieldname") ?>
<?php } ?>
2) in the directory classes you need to make the following alterations to the user.php file:
Add in the variables for the addittional fields after the following lines:
class Abstract_User {
var $username;
var $fieldname;
Further down add the following for each field after the similar entries:
function setFieldname($fieldname) {
$this->fieldname = $fieldname;
}
Add these before the entry
function isAdmin() {
return $this->isAdmin;
}
3) Lastly you need to edit the file register.php with the following
After the entries:
$allowChange['uname'] = true;
$allowChange['password'] = false;
$allowChange['old_password'] = false;
$allowChange['fullname'] = true;
Add the following for each fieldname that you have
$allowChange['fieldname'] = true;
Further down, add the following:
if (empty($fieldname) || !strcmp($fieldname, '')) {
$gErrors['fieldname'] = _("You must specify a valid fieldname.");
$errorCount++;
}
After the following entries:
$tmpUser->setUsername($uname);
$tmpUser->setPassword($password);
$tmpUser->setFullname($fullname);
Add the following for each fieldname
$tmpUser->setFieldname($fieldname);
I think I've got everything and I've tried to make it as straight forward as possible, but please let me know if I have missed anything. Dont forget to keep your fieldnames consitent otherwise it wont work
Let me know if you get stuck
Posts: 134
mr. brocaa
Is your solution valid for Gallery 2?
I yes, please tell me where I can find the UseruserData.inc file,directory classes ,register.php
Thanks in advance
vdd
Posts: 271
The code given by Mr. Broccaa is not G2 Valid in its current form which is why you cannot find the files you seek. G2 is a total rewrite, therefore very few, if any, mods for G1 will work as expected in G2 if at all.
Posts: 134
Khsjr
Thanks for the quick answer.
Posts: 2
is there any instruction for the galler 2???
Posts: 2
edit
nevermind
Posts: 18
This is the solution I'm looking for but I need it for G2. Is there a G2 hack to do this or will this work if I find the right code?