Tuesday, February 12, 2008

add user fields to joomla 1.5 for frontend editing

HACK WARINING

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>models>user.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.php
duplicate existing entries and change names

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



No comments: