archives in external site

archives in external site

Postby zaanen on Fri Aug 13, 2010 3:38 pm

Hi All,

I am intergrading my blog into a new site.
It will be 2 catogories on different pages.
I want to intergrated the archives to but on category.

I could not find this in the api documentation so i was wondering if this is manageble.

i intergrated this code so it only takes category 13 on this page.
Code: Select all

   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
   $articles = new Articles();
   $blogArticles = $articles->getBlogArticles(
         $blogId,                 // our blog id
         -1,                     // date, we don't care
         10,                      // amount of posts to fetch, increase this if needed
         13,                       // 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

Does it already take the archives only from this channel ?
I dont want to refer to the blog itself but gonna load it into a div.
Can somebody telle me how t intergrated the archives ?
Posts: 21
Joined: Thu Jun 07, 2007 8:15 am

Re: archives in external site

Postby jondaley on Thu Aug 19, 2010 12:43 pm

I'm afraid I don't understand your question. The code you have looks reasonable. Maybe you are asking what do with the $articles object once you have it?
Lifetype Expert
Posts: 6169
Joined: Thu May 20, 2004 6:19 pm
Location: Pittsburgh, PA, USA
LifeType Version: 1.2.11 devel branch

Re: archives in external site

Postby zaanen on Thu Aug 19, 2010 12:54 pm

I already fixed it by using my own sql statement on the blog database.

i wanted to have june 2010, may 2010, april 2010.
But also categorisation on that point so category news is different from category sport.

But as i said i already used a query to get this part done.
Posts: 21
Joined: Thu Jun 07, 2007 8:15 am

Return to Other Problems