I used the wiki page to get a code for external non blog site. That part is working perfect for me.
Now i added a few extra fields that i want to load on that page to.
I added the fields albumimage and albumlink.
This is the code i already have in use.
- Code: Select all
<?php
if (!defined( "PLOG_CLASS_PATH" )) {
define( "PLOG_CLASS_PATH", "../blog2/" );
}
// necessary classes
require_once( PLOG_CLASS_PATH."class/bootstrap.php" );
lt_include( PLOG_CLASS_PATH."class/dao/blogs.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/articles.class.php" );
//
// id of your blog, you need to know this one before starting and can easily
// be found out in the admin interface
//
$blogId = 1;
// Load the blog articles. This method call returns an array of Article objects
// or an empty array if there is none
// See http://lifetype.net/api/class_articles.php#aee20e131c51a6fdbd4f0d24e16e3c76
$articles = new Articles();
$blogArticles = $articles->getBlogArticles(
$blogId, // our blog id
$date, // date, we don't care
$aantal, // amount of posts to fetch, increase this if needed
$categoryId, // category id, but we don't care
POST_STATUS_PUBLISHED // only the ones that are published
// this method can take more parameters but we don't need them
);
if( count( $blogArticles ) == 0 ) {
print("Sorry, there are no posts to display" );
}
else {
// loop through the posts and show them
foreach( $blogArticles as $article ) {
// See http://lifetype.net/api/class_article.php for more information regarding the Article class
$blog = $article->getBlogInfo();
// This returns an object of type BaseRequestGenerator
$url = $blog->getBlogRequestGenerator();
// This returns an object of type UserInfo
$user = $article->getUserInfo();
// This returns an array of ArticleCategory objects
// $categories = $article->getCategories();
// And this returns the blog locale of type Locale
$locale = $blog->getLocale();
// Date when this was posted, of type Timestamp
$date = $article->getDateObject();
?>
<div id="<?php echo $article->getTopic()."title"; ?>">
<p>
<h2><?php echo $article->getTopic(); ?></h2>
<br/>
<?php echo $article->getIntroText();
if($article->hasExtendedText() =='TRUE'){?><a id="<?php echo $article->getTopic(); ?>" href="javascript:toggle2('<?php echo $article->getTopic().'extra'; ?>','<?php echo $article->getTopic(); ?>');" >meer</a> <div id="<?php echo $article->getTopic().'extra'; ?>" style="display: none"> <?php echo $article->getExtendedText().' </div> '; } ?><br/>
Posted by: <?php echo $user->getUsername(); ?> on the <?php echo $locale->formatDate($date); ?>
What do i have to add to see to see albumlink and albumimage to ?
