Recent Topics

1 Jan 28, 2012 14:05    

Hi!
I need that blogs are shown inside my site. I tried to use stubs:

include("a_stub.php");


But it just redirect to the blog.
I've found this topic
http://forums.b2evolution.net/viewtopic.php?t=22179&highlight=integration
This is the same problem, but I don't understand what is ob_start() function.
Also,I tried to use a_noskin.php instead of a_stub.php but it still redirects to blog instead of "embedding" it into my site.
Could you please give me some ideas how can I fix it?

2 Jan 28, 2012 23:56

Don't just include the a_noskin.php file.

You need to edit that file just like if it was a part of your website, e.g. edit CSS, header, footer etc.

3 Feb 07, 2012 22:21

Thank you for the reply. It was what I want. Now I have two questions.
Can I make output of list of public blogs(that is on the top by default) in 2 columns for example?
Now I just made html table but I wonder if there is possibility to do it in more right way.
The second question is about using database classes and functions. I need 2 simple pages that will insert into my table and select from it. Making the connection to database manually is npt big problem, but again. Is it not too complicated way to use already written functions in b2evo for using mysql DB?

4 Feb 07, 2012 23:21

Try this to display a 2-column table

echo '<table>';

$nb_cols = 2;
$count = 0;
$prev_ID = 0;
foreach( $blog_array as $l_blog )
{
	if( $count % $nb_cols == 0 )
	{
		echo "\n<tr>";
	}
	if( $l_blog != $prev_ID )
	{
		$prev_ID = $l_blog;
		$count++;
	}
	
	echo "\n\t".'<td valign="top">';
	$l_Blog = & $BlogCache->get_by_ID( $l_blog );
	echo '<a hre="'.$l_Blog->gen_blogurl().'">'.$l_Blog->shortname.'</a>';
	echo '</td>';
	if( $count % $nb_cols == 0 )
	{
		echo '</tr>';
	}
}

if( $count && ( $count % $nb_cols != 0 ) )
{
	echo '</tr>';
}
echo '</table>';

Your tables need to in the same database with b2evolution

$DB->query('-- Your insert query goes here --');

if( $rows = $DB->get_results('SELECT * FROM "mytable"') )
{
    var_export($rows);
}


Form is loading...