我能夠利用Griiettner的解決方案爲Joomla 3.我想不會允許用戶編輯他們的電子郵件地址在前端的配置文件編輯屏幕上。我只修改了它稍微,複製這個文件:
components/com_users/models/forms/profile.xml
到:
/templates/YOUR_TEMPLATE/html/com_users/profile/forms/profile.xml
也複製此文件:
components/com_users/views/profile/tmpl/edit.php
到:
/templates/YOUR_TEMPLATE/html/com_users/profile/edit.php
,並把這個代碼在edit.php文件的頂部右後:
defined('_JEXEC') or die;
我離開了$this->form->reset(true); // to reset the form xml loaded by the view
,只有用這個:
// JOOMLA 3 if(!defined('DS')) define('DS', DIRECTORY_SEPARATOR); $this->form->loadFile(dirname(__FILE__) . DS . "forms" . DS . "profile.xml");
這使我可以保持在編輯表單中填充用戶配置文件信息。然後我編輯profile.xml配置文件,並補充說:
readonly="true"
到EMAIL1和EMAIL2領域。這可以防止用戶進行編輯。
嗨,謝謝你的回覆。我已經嘗試了template/templatename/html/com_users/models/login.xml以及其他變體,如template/templatename/html/com_users/models/forms/login.xml或template/templatename/html/com_users/forms/login.xml等... – theoth 2012-03-24 19:43:12