Recent Topics

1 Jan 09, 2010 14:39    

My b2evolution Version: Not Entered

Hi,

I just downloaded the newest version, went though the documentation, installed the software and created a new blog.
Everything went perfect and my compliments to the creator of this blog software. Reading the documentation was most of the work!

However, I could not figure out how to setup something like this:
On a normal PHP page I would like to show a related blog article with it's comments. And the visitor should be able to add comments too.
To visualize what I want to achieve:
-------------------------------------------------------
------- normal PHP page (no blog) ----------------
-------------------------------------------------------
-------- TEXT on page ----------------
-------- TEXT on page ----------------
-------------------------------------------------------
--------- related blog article1 -----------------
--------------- blog comment1 -------------------
--------------- blog comment2 -------------------
-------------------------------------------------------

Any help is appreciated.

2 Jan 11, 2010 05:28

The best way to do is -- is to really create a skin that allows you to host the blog post... and then use the HTML widget to add HTML parts to the 'skin' (i.e. blog design).

We have the blog piece in the middle and then on the left and right, you have the html web parts... for the books on the left, those are basic html widgets (from b2evo) but then, I linked them to the "To check Edgar's progress, click here" which allows people to read the comments....

this skin is customized for me, but there are other 3 column skins in here you could leverage for your site.

Check out my home page. http://www.TheChristianAlert.org

if you want more help, b2evo version & web site will help the others in the forum..

3 Jan 11, 2010 19:42

On a normal PHP page I would like to show a related blog article

How do you determine a related article, b2evo compares tags? You can integrate b2evo in normal PHP page using the following code

----- Your PHP page above --------

// Load b2evo config
require_once dirname(__FILE__).'/conf/_config.php'; // edit the path
require_once $inc_path.'_main.inc.php';

$BlogCache = & get_Cache('BlogCache');
$Blog = & $BlogCache->get_by_ID( 7, false ); // edit blog ID

load_class( 'items/model/_itemlist.class.php', 'ItemList' );
$RelatedList = & new ItemList2( $Blog, NULL, NULL, 1 ); // load 1 item

$RelatedList->set_filters( array(
		'unit' => 'posts',
		'tags' => 'tag one, tag two, another_tag', // load posts with these tags (separate with a comma)
	), false );

// Run the query:
$RelatedList->query();

if( ! $RelatedList->result_num_rows )
{	// Nothing to display:
	return;
}

while( $Item = & $RelatedList->get_item() )
{ // Display contents of the Item. See skins/your_skin/index.main.php for details

    $Item->title();

    // item content
    skin_include( '_item_content.inc.php' );

    // item comments
    skin_include( '_item_feedback.inc.php' );

}

Not tested, free-typed :)


Form is loading...