by prettyscripts on 2010-03-09 11:47:00
in the skin, the function call to show author of a post is $Item->author(). by default it links to user page. i wanted to link to user's website. there aren't much information on how to use this function and the doc is outdated.
source code is always the best documentation. the function is defined in inc/items/models/_item.class.php. it seems these are new array parameters introduced in V3.
one of which is link_to. the default is userpage. another available option is userurl - this is what you want.
depends on the skins, locate any files that calls $Item->author() and add 'link_to':
PHP:
$Item->author(array( | |
..... // whatever the current skin uses | |
'link_to' => 'userurl', // add this | |
)); |
the author text now links to website, if defined in user setting in backoffice.
just for references, the default parameters and values:
PHP:
array( | |
'before' => ' ', | |
'after' => ' ', | |
'format' => 'htmlbody', | |
'link_to' => 'userpage', | |
'link_text' => 'preferredname', | |
'link_rel' => '', // eg nofollow | |
'link_class' => '', | |
'thumb_size' => 'crop-32x32', | |
'thumb_class' => '', | |
); |
create _user.disp.php in the skin and edit accordingly.