Displaying Author Images

Discussion in 'XML & RSS' started by mikebrad0927, Jun 21, 2006.

  1. #1
    I have an RSS feed from my blog (using Wordpress) that I publish on the homepage of my site. I'd like to be able to display the author's image along with the post.

    The tag for the author is <dc:creator> and I have successfully been able to publish the author's name using this code:

    echo "\t<div class=\"post\"><h1><a href=\"$item[link]\">".$item['title']."</a> 
    <font size=-1>by [B]".$item['dc:creator']."[/B]</font></h1>
    </div>".$item['content:encoded']."<hr>\n"; 
    
    
    Code (markup):
    The author's image is located in the root directory and is 'dc:creator'.jpg

    I'm using LastRSS to parse the feed, any ideas?
     
    mikebrad0927, Jun 21, 2006 IP
  2. weppos

    weppos Well-Known Member

    Messages:
    99
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    125
    #2
    What about

    echo "\t<div class=\"post\">" .
    "<h1><a href=\"$item[link]\">".$item['title']."</a> " .
    "<font size=-1>by ".$item['dc:creator']."</font></h1>" .
    "<img src=\"/" . $item['dc:creator'] . ".jpg\" alt=\"" . $item['dc:creator'] . "\" />" .
    "</div>". $item['content:encoded']."<hr>\n"; 
    
    PHP:
     
    weppos, Jun 30, 2006 IP
  3. scottj

    scottj Peon

    Messages:
    168
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    That's about exactly what I was going to suggest. Did it work out for you, mikebrad0927?
     
    scottj, Jul 1, 2006 IP
  4. mikebrad0927

    mikebrad0927 Peon

    Messages:
    266
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    weppos, Thank you very much! That did it!
     
    mikebrad0927, Jul 8, 2006 IP