Wednesday, February 16, 2011

add user fields to joomla 1.5 for frontend editing - revised

HACK WARNING

backup jos_users using phpmyadmin or similar

add fields to jos_users i.e. address1, state etc

open components>com_user>views>user>tmpl>form.php

copy and change existing form fields

open components>com_user>controller.php
duplicate existing entries and change names

i.e. $post['username'] = JRequest::getVar('username', '', 'post', 'username');
$post['address1'] = JRequest::getVar('address1', '', 'post', 'address1');
$post['state'] = JRequest::getVar('state', '', 'post', 'state');

open>libraries>joomla>database>table>user.phpduplicate existing entries and change names

i.e. var $email = null;
var $address1 = null;
var $state = null;

No comments: