Skip to content

Instantly share code, notes, and snippets.

Created January 22, 2014 15:06
Show Gist options
  • Save anonymous/8560272 to your computer and use it in GitHub Desktop.
Save anonymous/8560272 to your computer and use it in GitHub Desktop.
<ul class="ortho-in-motion cf"><?php
$countPosts = 0;
foreach ($xml->channel->item as $entry){
//Use that namespace
$dc = $entry->children('http://purl.org/dc/elements/1.1/');
$physician = $entry->physician;
$imgURL = $entry->children("content", true);
$img = "<img src='" .$imgURL . "'/>";
/*if (strpos($physician, " ") === true) {
$physician = explode(" ", $physician);
}*/
$link = $entry->link;
//if we're interested in showing an excerpt, this will do it, just change the font-size from 0px
$author = $dc->creator;
similar_text($post_author, $author, $sim);
if ($countPosts < 1) {
if (strpos($physician, $post_author) !== false || $post_author == $physician || $sim >= 70) {
?> <li class="three-posts"><a href="<?php echo $link; ?>"><h5>
<?php echo $entry->title; ?>
</h5>
<?php echo $img; ?>
<?php
echo $dc->publisher; ?></a></li><?php
$countPosts++;
}
} else {
?> <li class="three-posts"><a href="<?php echo $link; ?>"><h5>
<?php echo $entry->title; ?>
</h5>
<?php echo $img; ?>
<?php
echo $dc->publisher; ?></a></li><?php
$countPosts++;
}
if ($countPosts == 2) {
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment