thank you ,but i have some problems
i used these codes but does not worked
<?php
/**
* Modify Custom Client Fields on Profile Page
* @author brian!
*/
function modify_custom_client_fields_hook($vars) {
if ($vars['templatefile'] == "clientareadetails") {
$oldkey = array(">");
$newkey = array(" readonly >");
$ccfids = array(51);
foreach ($vars['customfields'] as $ccf => $value) {
if (in_array($value['id'],$ccfids)) {
$vars['customfields'][$ccf]['input'] = str_replace($oldkey,$newkey,$value['input']);
}
}
return array("customfields" => $vars['customfields']);
}
}
add_hook("ClientAreaPage",1,"modify_custom_client_fields_hook");
and i used that changes too but Had no effect
as you say, you could untick the "admin only" checkbox and then in clientareadetails.tpl, change...
{if $customfields}
{foreach from=$customfields key=num item=customfield}
<div class="form-group">
<label class="control-label" for="customfield{$customfield.id}">{$customfield.name}</label>
<div class="control">
{$customfield.input} {$customfield.description}
</div>
</div>
{/foreach}
{/if}
to...
{if $customfields}
{foreach from=$customfields key=num item=customfield}
<div class="form-group">
<label class="control-label" for="customfield{$customfield.id}">{$customfield.name}</label>
<div class="control">
{$customfield.value} {$customfield.description}
</div>
</div>
{/foreach}
{/if}
basically, you're just changing $customfield.input to $customfield.value - and that, as the code suggests, just displays the current content of the customfields and doesn't provide the user with an option to edit them.... though you may need to adjust the layout to suit the output
please help me 😞