« New b2evo out: Digg it | Moving on » |
Sideblog Plugin for b2evolution
Purpose
The Sideblog plugin allows you to insert another blog in the sidebar of your skin with simple plugin call. A sidebar blog can be used for brief posts, links, photos or any other list you want arranged chronologically.
Installation
Requires b2evolution 1.8 or later
- Download this file: _sideblog.plugin.txt.
- Replace the .txt in the filename with .php and upload it to your b2evolution plugins folder.
- In the backoffice, go to Settings > Plugins and find Sideblog in the list. Click "install".
Usage
To use the plugin, just add this code to the skin where you want the sidebar blog to appear:
<?php
// MostComments plugin:
$Plugins->call_by_code( 'sideblog', array(
'limit' => 5,
'blog' => 3,
) );
// Add parameters in the array.
?>
Limit is the number of posts you want to show. Blog is the blog you want to display there. Refer to the plugin source for other parameters you can adjust.

42 comments

Nice plugin! I’m using it to display short descriptions of the latest technical changes I’ve made to my site.
One request, though: is there something I can add to the code so that it also displays the publish date of the entries on the referenced blog, maybe next to the post title?

Seems like a nice plugin, but I must be doing something wrong because I can´t get it to work! =(
I installed the plugin and put the code into (among the sidebar-items) the _main.php file of the custom-skin. Nothing appears.. What am I doing wrong?

eh, sorry.. my mistake. I accidently installed the SideBAR-plugin instead of your SideBLOG. Hehehe! =)

I’ve installed and activated the plugin, and pasted the code into the template, but nothing appears.
What’s the deal?

Hi! Nice plugin and respect for your great job with b2evo.
Just a simple question. I would insert with the help of sideblog plugin static info about contact, bio and site description.
How should I do this to see only the title on the sidebar? It is possible? I am interesting any possibility.
Thanks in advance!
Bonus question: This nice and clean skin (used on this page) available somewhere to b2evo 1.8.1?

am afraid I have the same problem as well, cant get the plugin to work, is it a separate blog entry or is it a category? I’m not sure.

Nice plugin…thanks for your work.
I try to use for one categorie (add ‘cat’ => 1,), but don´t work.
Its possible?

OK, I find in source. It´s ‘catarray’
New question :)
Have a way to limit the numbers of characters of the post to show? If you have a long post, limit to 100 characters to show and one link to “more".

Hi dan, thanks for your help.
I try this, but dont work. I change the code, upload the file, uninstall and reinstall the plugin. The code is:
if ($params[’showauthor’]) {
echo ‘ by ‘;
$Item->author();
}
if ($params[’showpostcontent’]) substr($Item->content( 1, false ), 0, 100);
echo $params[’line_end’];
In _main.php, I try:
’showpostcontent’ => 1,
’showpostcontent’ => 100,
’showpostcontent’ => false,
and without ’showpostcontent’
Have any other change in the source?

Yes, I installed it and it doesn’t show up either… I am using the following:
// MostComments plugin:
$Plugins->call_by_code( ’sideblog’, array(
‘limit’ => 5,
‘blog’ => 1,
’showpostcontent’ => false
) );
// Add parameters in the array.
Nothing shows up and I don’t know what to do…

dan,
I use 1.8.2
The plugin works great here, just this modification don´t.

I’ve corrected the problem. I was playing with the wrong _main.php.
Thanks for the help and the plugin!
One question: can the limit be set for # of posts, not # of days?

Hi, I tried to install your pluginwith b2evo 1.8.2, and in frontend it works fine.
But when I click on Plugins tab in Admin, or when I try to modify a user, I get the following error:
Warning: Cannot modify header information - headers already sent by (output started at _sideblog.plugin.php in _menutop.php on line 38.
Have you any hint?

Well… not a bug in your plugin :-)
It happens if the sideblog is installed twice!
Sorry.

Now that I’ve upgraded to 1.9.1, I get the following errors using the Sideblog plugin:
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: timestamp_max in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 136
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: timestamp_min in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 136
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: unit in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 136
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: orderby in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 136
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: author in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 136
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: w in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 136
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: m in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 136
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: show_statuses in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 136
[Wed Dec 13 22:11:29 2006] [error] PHP Notice: Undefined variable: blog in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 114

I get the following errors with the latest version:
[Fri Dec 15 18:52:19 2006] [error] PHP Notice: Undefined variable: blog in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 114
[Fri Dec 15 18:52:19 2006] [error] PHP Notice: Undefined variable: blog in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 114
[Fri Dec 15 18:52:18 2006] [error] PHP Notice: Undefined variable: blog in /home/comlist/public_html/plugins/_sideblog.plugin.php on line 114

Is there a way to limit the results of the blog body to 3-4 lines?
Thanks Broc.

Here is a little mod to this, Hope it’s ok to post this… But I wanted to show only a little of the post in the side bar… with a link to the full post…
Here is the code…
function wordCut($text, $limit, $msg){
if (strlen($text) > $limit){
$txt1 = wordwrap($text, $limit, ‘[cut]’);
$txt2 = explode(’[cut]’, $txt1);
$ourTxt = $txt2[0];
$finalTxt = $ourTxt.$msg;
}else{
$finalTxt = $text;
}
return $finalTxt;
}
if ($params[’showpostcontent’]) #$Item->content( 1, false);
echo ‘
‘;
echo wordCut($Item->content, 550);
echo ‘
‘;
echo ‘’;
echo ‘… read more’;
‘‘;
to replace this….
if ($params[’showpostcontent’]) $Item->content( 1, false );
A sample can be seen here:
http://www.broclee.com/blog/index.php
Please feel free to make this available if you would like Dan. Thanks for the great add on. :)
Enjoy.
Broc

sorry, worked great with only 1 post in the blog, but not with more :( I will keep working on it.

Is it possible to add URL to multiple blogs and how? while at it how do get the above Check spelling on your Leave comment?
Thanks,

You can always edit the plugin source to make it display just how you want.
This is great. Thanks for sharing.

Does this work for the nifty corners skin? I can’t get it to display.

Yes. Ideally I’d like to display the side blog on the left side of nifty corners, but I couldn’t get it to display on the right side either.

dan
can teach my how to put the friends list into your side bar… i want to add to mine.

IS there a way to change how the blog titles are displayed? As in, something other than the bullets on each line. Thanks!

I am not sure how to edit my sidebar, can anyone teach me on this, thanks.

Hey dr. f,
thanks for the plugin, it might be the first one i tried to use that just worked right away. The only thing is it doesn’t go directly to external links. it goes to the actual blog post on my site (which is just a link) and then you have to click on the title again to follow through. is there any way to bypass this? and go through the external link?
thanks a bunch.
mike. g.

If I have several blogs on my system, each using a different skin, and I want to call different categories in the sideblog for each skin within a single installation of the sideblog plugin, can I restrict the categories within the code that gets inserted in the skin itself, or can this only be done in the _sideblog.plugin.php file itself?
In other words, in the code that gets inserted in the skin, can I do something like:
‘limit’ => 5,
‘blog’ => 3,
‘catarray’ => 70,71,array(),
in one skin, and then
‘limit’ => 5,
‘blog’ => 4,
‘catarray’ => 75,78,array(),
in another skin, or do I need to install two separate instance of the sideblog plugin, and call each of them by a different code (i.e. sideblog1 and sideblog2) ? If it can be done as I described above, is my syntax correct?

Actually, in my last comment, it would be:
‘blog’ => 3,
for both skins, but is the syntax of the ‘catarray’ correct?

Is there a way to get get the plugin to randomly display a different post daily?
That would be awesome for the purpose I am using it for, as I have a poetry blog I have setup in the SideBlog plugin.

I’m using version 2.0 of B2evolution
After copying and installing the plugin, I put
$Plugins->call_by_code( ’sideblog’, array(
‘limit’ => 5,
‘blog’ => 1,
) );
in _sidebar.inc.php of my skin
but received the following error:
Fatal error: Call to undefined function Blog_get_by_ID() in /nobel/raoul978/b2evolution/blogs/plugins/_sideblog.plugin.php on line 117
Since i’m a beginner in php, I would really appreciate your help with this!
:)

Will this work with 2.3?

I get the error Blog_get_by_ID() is undeclared as well.
I’m running 2.4.0.

Never mind I had a bad version of the plugin, it’s working great now.
Recent comments