1 baileyjs Jan 17, 2008 13:05
3 baileyjs Jan 17, 2008 14:34
So, in your example I would always have to assign the post to someone, even myself, correct?
I can do that, but my preference would be the if /else Topanga had in the original post.
4 yabba Jan 17, 2008 14:56
<?php
if( $Item->get_assigned_User() )
{ // we have an assigned user
$the_author = $Item->assigned_User;
}
else
{ // we don't have an assigned user
$Item->get_creator_user();
$the_author = $Item->creator_User;
}
echo 'before'.$the_author->get_preferred_name( 'htmlbody' ),'after';
?>
Completely untested ;)
¥
5 baileyjs Jan 17, 2008 15:38
To paraphrase Dr. Leonard McCoy, I feel safer about your guesses than most other people's facts.
Thank You.
inc/items/model/_item.class.php ( approx 451 )
So just replace $Item->author() with $Item->assigned_to( 'before', 'after' ) and all should be well with the world
¥