« New b2evo out: Digg itMoving 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

  1. Download this file: _sideblog.plugin.txt.
  2. Replace the .txt in the filename with .php and upload it to your b2evolution plugins folder.
  3. 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?


Scott [Visitor]  http://www.scottsforum.com07/15/06 @ 14:41
dan [Member] • http://www.brendoman.com/07/16/06 @ 13:13

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?


Kit [Visitor]  07/26/06 @ 03:19

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


Kit [Visitor]  07/26/06 @ 03:36

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?


Zsolt Andrasi [Visitor]  http://www.azso.hu09/03/06 @ 03:34

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.


khumbulani [Visitor]  09/05/06 @ 07:14

Nice plugin…thanks for your work.

I try to use for one categorie (add ‘cat’ => 1,), but don?t work.

Its possible?


Highlander [Visitor]  http://www.highlanderbr.com/site/09/27/06 @ 17:17

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".


Highlander [Visitor]  http://www.highlanderbr.com/site/09/27/06 @ 19:34
dan [Member] • http://www.brendoman.com/09/28/06 @ 07:33

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?


Highlander [Visitor]  http://www.highlanderbr.com/site/09/28/06 @ 15:42

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…


wines [Visitor]  http://officialwinery.com/wineryarticles10/04/06 @ 12:09
dan [Member] • http://www.brendoman.com/10/04/06 @ 12:27

dan,

I use 1.8.2

The plugin works great here, just this modification don?t.


Highlander [Visitor]  http://www.highlanderbr.com/site/10/04/06 @ 18:29

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?


dan [Member] • http://www.brendoman.com/10/06/06 @ 07:11

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?


Francesco [Visitor]  http://www.fralenuvol.com10/22/06 @ 12:24

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


Francesco [Visitor]  http://www.fralenuvol.com10/23/06 @ 17:56

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


Charles LePage [Visitor]  http://www.comiclist.com12/13/06 @ 22:18
dan [Member] • http://www.brendoman.com/12/14/06 @ 07:59

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


Charles LePage [Visitor]  http://www.comiclist.com12/15/06 @ 18:54
dan [Member] • http://www.brendoman.com/12/16/06 @ 10:13

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

Thanks Broc.


Broc Lee [Visitor]  http://www.broclee.com01/14/07 @ 01:32

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 ‘permanent_url();
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
Broc Lee [Visitor]  http://www.broclee.com01/14/07 @ 14:57

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


Broc Lee [Visitor]  http://www.broclee.com01/14/07 @ 21:06

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,


Khalid [Visitor]  http://www.alkhater.net/en_blog01/18/07 @ 23:13

You can always edit the plugin source to make it display just how you want.

This is great. Thanks for sharing.


Anwalt Strafrecht [Visitor]  http://www.anwaltskanzlei-strafrecht.com04/19/07 @ 07:55

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


Sue Kendrick [Visitor]  http://www.writelink.co.uk/blog/blogs//05/14/07 @ 05:41
dan [Member] • http://www.brendoman.com/05/14/07 @ 09:27

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.


Sue Kendrick [Visitor]  http://www.writelink.co.uk/blog/blogs//05/15/07 @ 04:05

dan

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


simon [Visitor]  http://www.yeepage.com05/18/07 @ 23:17

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


Sean [Visitor]  05/22/07 @ 00:32
dan [Member] • http://www.brendoman.com/05/22/07 @ 06:52

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


Jo Young [Visitor]  http://www.myshinjuku.com07/09/07 @ 13:56

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.


mike. g. [Visitor]  http://sideblog plugin07/09/07 @ 15:32

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?


yours truly [Visitor] • http://blog.thedarksighed.com07/11/07 @ 20:24

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


yours truly [Visitor] • http://blog.thedarksighed.com07/12/07 @ 16:27

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.


Damien [Visitor]  http://dhodgkin.elementfx.com09/20/07 @ 15:20

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!
:)


IsabelleGusse [Visitor]  10/21/07 @ 11:46

Will this work with 2.3?


Henry Imler [Visitor]  http://hundiejo.com01/16/08 @ 22:07

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


locksmyth [Visitor] • http://locksmyth.alchemyx.com02/05/08 @ 09:03

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


locksmyth [Visitor] • http://locksmyth.alchemyx.com02/05/08 @ 09:23

Comments are closed for this post.