Created
January 22, 2014 15:06
-
-
Save anonymous/8560272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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