Recent Topics

1 Feb 12, 2006 20:54    

In the footer of my posts I have the name of the author of the post and I have the messageform link.

I would like to get that all into just 1 icon (because my footerline is becoming to crowdy)

The ultimate thing that I want is this :

Show the icon with the messageformlink.
The alt text should show the preferred name of the author or if there is an assigned user to it, show the preferred name of the asigned user.

<?php 
$title = 'Send email to ' & $Item->Author->preferred_name();
$Item->msgform_link( $Blog->get('msgformurl'),' ',' ','#',$title ); 
?>

in extendis, it should be nice if the next code would always show something

<?php ?>
<a href="<?php echo url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='. $Item->assigned_User->ID) ?>" title="<?php echo T_('Browse all posts by this author') ?>"><?php $Item->assigned_to(); ?></a>
<?php ?>


If there is no assigned user, that function should response with the real author (because in that case the real author is the assigned one, isn't that so ?)

2 Feb 13, 2006 20:55

Mine was cheating because I used a static link (suitable I thought since I'm the only author on my site), but here's what I used to combine author's preferred name and the msgformurl link:

<?php
	echo '<a href="../../news.php?disp=msgform&amp;recipient_id=1" title="Send an e-mail to ';
	$Item->Author->preferred_name();
	echo '">';
	$Item->Author->preferred_name();
	echo '</a>';
?>

As you can see, recipient_id doesn't change, so this isn't suitable if there are multiple authors. And obviously you would have to change it around to add the appropriate <img> code if you want your text to be the alt attribute of an image (similar to what I did for the "title" attribute for my link).

Sorry if this doesn't help out at all!

3 Feb 14, 2006 11:01

#2

echo '<a href="'.url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='.( $Item->assigned_user-ID ? $Item->assigned_user_ID : $Item->Author->ID )  ).'" title="'.T_('Browse all posts by this author').'">';
( $Item->assigned_user-ID ? $Item->assigned_to() : $Item->Author->prefered_name() );
echo '</a>';

¥


Form is loading...