1 vanbeast Jan 28, 2012 14:05
3 vanbeast 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 sam2kb 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);
}
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.