我将下面的代码用于我在网站上的 Facebook 提要。问题是它列出了应有的图像和新闻,但是对于我的生活,我无法弄清楚如何将图像放在它们的上面并将相关的文本很好地显示在它的右侧。有人可以帮忙吗。
这是代码:
<?php
//Get the contents of the Facebook page
$FBpage = file_get_contents('https://graph.facebook.com/135860723149188/feed? access_token=456215171075777|OcFg4Sf293Pg3NXeJkg1h3Bg8wE'
);
//Interpret data with JSON
$FBdata = json_decode($FBpage);
//Loop through data for each news item
foreach ($FBdata->data as $news ) {
//Explode News and Page ID's into 2 values
$StatusID = explode("_", $news->id);
echo '<li class="fbframe"; style="list-style:none;" >';
//Check for empty status (for example on shared link only)
if (!empty($news->picture)) {
printf ('<img src="%s" alt="Image from Facebook" />', $news->picture);
}
if (!empty($news->message)) { echo $news->message; }
echo '</li>';
} //end of fbframe
?>
提前感谢您提供的任何帮助。