[turba] Ideas on how to make a contact's website URL linkable.

eculp at encontacto.net eculp at encontacto.net
Wed May 26 06:39:01 PDT 2004


Quoting Mike Bydalek <mbydalek at compunetconsulting.com>:

> Quoting eculp at encontacto.net:
>
>> Quoting Chuck Hagenbuch <chuck at horde.org>:
>>
>>> Quoting eculp at encontacto.net:
>>>
>>>> Has anyone made contact's website URL's linkable from the results
>>>> of a turba search? How about where and possibly how to add it
>>>> in a portable way where it will work with sql/ldap etc.
>>>
>>> Text::linkUrls() on the field value before displaying it.
>>
>> it to work, probably an issue with logic. I'll try again in
>
> Near line 62 of the contactrow.inc, where it has the if == "email", just add
> another if statement:
>
> if ($GLOBALS['attributes'][$column]['type'] == 'website') {
> $show[$column] = Text::linkUrls($show[$column], $ob); //Or whatever the
> correct call to linkUrls() is...
> }
>
> That should do it.
>

Mike, I agree. I put the following:

foreach ($GLOBALS['columns'] as $column) {
if ($ob->hasValue($column)) {
$show[$column] = htmlspecialchars($ob->getValue($column));
if ($GLOBALS['attributes'][$column]['type'] == 'email') {
$show[$column] = Turba::formatEmailAddresses($show[$column],
$ob);
}
// Added the following 3 lines to create a link.
if ($GLOBALS['attributes'][$column]['type'] == 'website') {
$show[$column] = Text::linkUrls($show[$column], $ob);
}
} else {
$show[$column] = '&nbsp;';
}
}

It doesn't seem to have any effect.

I've looked at framework/Text/Text.php and I don't see a reason
for it not to work.

Thanks again,

ed



More information about the turba mailing list