Recent Topics

1 Sep 11, 2006 13:08    

For a while I've been using highly customised skins and I'm editing them to work with the new release, not by converting the old skins but by taking "Custom" and converting it back to the skins we use. It's going quite nicely.

There was a bit of code I lifted from a skin by Topanga that showed all the posts by a particular author. I really liked that function which looked like this

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

I thought I had it cracked when I got it going without any errors but it doesn't do what it's sposed to - i.e. pull up all the posts by a particular author.

Can anyone spot the obvious :lol: mistake in my conversion:

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

It "almost" works -- testing here http://www.tvcm.co.uk/b2/dev/index.php/a

3 Sep 11, 2006 16:43

Topanga - that link is dead at the moment

I figured this out whilst driving home. Since i was getting almost what I wanted ie ?author= in teh URL I figured what was missing - I missed this out ->Author->ID

The following works

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

4 Sep 11, 2006 17:43

<?php  
  $Item->get_creator_User(); 
  if( $Item->assigned_user_ID ) 
    { 
    $the_author = $UserCache->get_by_ID( $Item->assigned_user_ID ); 
    } 
    else 
    { 
    $the_author = $Item->Author; 
    } 
    echo '<a href="'.url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='.$the_author->ID).'" title="Browse all articles from '.$the_author->get_preferred_name().'"><img src="rsc/icon_16_author.gif" border="0"></a>'; 
?> 

5 Sep 11, 2006 19:16

well that works but why call up an icon?

echo '<a href="'.url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='.$the_author->ID).'" title="Browse all articles from '.$the_author->get_preferred_name().'"><img src="rsc/icon_16_author.gif" border="0"></a>'; 

I'd rather display the authors name than an icon. I'm trying to do this now without much success, I'll keep trying but a nudge in the right direction would be welcome

6 Sep 11, 2006 23:02

<?php $Item->get_creator_User();
					if( $Item->assigned_user_ID ) 
						{ $the_author = $UserCache->get_by_ID( $Item->assigned_user_ID ); } 
					else 
						{ $the_author = $Item->Author; } 
				echo 'Written by <a href="'.url_add_param( $Blog->get( 'blogurl', 'htmlattr' ), 'author='.$the_author->ID).'" title="Browse all articles from '.$the_author->get_preferred_name().'">'.$the_author->get_preferred_name().'</a>'; 
				$the_author->msgform_link( $Blog->get('msgformurl'),' ',' ','#','Send an email to '.$the_author->get_preferred_name().', the author of this article','' );?> 

7 Sep 12, 2006 12:19

thanks that works. I've hacked it about a little to do what I want.
http://www.tvcm.co.uk/b2/dev/index.php/a

only thing bugging me now is - what's putting those icons on permalink and teh edit link. I can't see why they are there or what is causing it. I hesitate to start a new topic for this.

The link to teh manual works for me today. That's cool a wiki manaual. I've signed up for an account and I'll contribute what I can


Form is loading...