Topic: mbBlog - Blog system

I've just got my new site online which is running a plugin I wrote. I wanted to keep my blogs separate from the pages so went about making this blog plugin. It's really basic at the moment as it was also used as a tool for learning the Wolf API so there are some things missing but I do plan to maintain it and keep it up to date as much as possible.

Anyway it can be downloaded from my site at www.mikebarlow.co.uk

Any feedback is welcome.

2

Re: mbBlog - Blog system

Good work, Mike! I won't have time to try it out for a while hmm so a quick question: what kind of URL structure does mbBlog produce for new pages?

Using Wolf CMS professionally and for profit? Please consider supporting Wolf financially. Thanks!

3

Re: mbBlog - Blog system

Mike, I am now trying to implement my first webpage based on WolfCMS. At the moment I am working on  Freshmedia template for Wolf.

When I finish it I will test your plug-in and will post you my comments.
Thanx

--
Piotr

Re: mbBlog - Blog system

Well unless you use the "blog intro" section, which allows you to have an intro paragraph which then produces a read more link for the user to click through to read the rest of the post in the blog body, then all the posts just list in on one page. (With pagination if there are too many).
If any of that makes sense....

But using my site as an example which has the blog on the homepage, it currently will just display www.mikebarlow.co.uk/?bid=9

for pagination it will be www.mikebarlow.co.uk/?bpage=2

I do aim to use mod rewrite to get nice formatted urls but like i said i wanted to get the base functionality down first while learning wolf, so the urls will come. When it does it will no doubt be a formatted version of the blog title. (Unless people request otherwise)

Re: mbBlog - Blog system

@snsmurf - are you building this in top of Wolf 0.5.5 or the latest SVN version? If you're not using the SVN version... try it.

I've added support for frontend controllers in the SVN version and this will become available with the 0.6.0 release. This might make your plugin development life easier. wink

I didn't have time yet to write a tutorial on the wiki yet (and it would make little sense since 0.6.0 is not out yet) but Andy created a quite nice blog post on the subject.

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution or see our financial report first.

Re: mbBlog - Blog system

Thanks for the heads up, I've been using 0.5.5.
I may look into that actually, will probably develop it has 2.x series of mbBlog, while developing 1.x for 0.5.5, especially with 0.6 not being out yet.

Re: mbBlog - Blog system

Just a quick post to let anyone who is using mbBlog that there is an update available now from my site at www.mikebarlow.co.uk/

There's a post about the update on the homepage.

Let me know if anyone runs into any problems.

8

Re: mbBlog - Blog system

snsmurf wrote:

Just a quick post to let anyone who is using mbBlog that there is an update available now from my site at www.mikebarlow.co.uk/

I expect it's just a temporary thing, snsmurf, but the link provided is being reported as broken. Can you confirm? Thanks!

Using Wolf CMS professionally and for profit? Please consider supporting Wolf financially. Thanks!

Re: mbBlog - Blog system

D'oh, just found out our server's hard drive failed sad It's had 100% uptime so far then my mate who co-owns the server rebooted it cause he installed a new vps control panel and the hard drive went kaput!

In the process of being fixed now, will post an update when it's back online.

EDIT:: Should be back online now!

Last edited by snsmurf (2009-12-31 18:38)

Re: mbBlog - Blog system

Major update to this plugin!
I've done a complete rewrite for this plugin. Now uses dispatcher routes to help get clean urls / paging.

I'll release an "upgrader" in the next day or two, the database table has changed, so bear it in mind and check back in a couple of days if you are already running the original mbBlog.

IMPORTANT EDIT: To use mbBlog you'll have to run the two fixes I've posted on the following two google code issues:
http://code.google.com/p/wolfcms/issues/detail?id=165 and
http://code.google.com/p/wolfcms/issues/detail?id=169

www.mikebarlow.co.uk/wolf-cms.html#mbblog

Last edited by snsmurf (2010-05-12 23:56)

Re: mbBlog - Blog system

Maybe I'm missing something. I've installed the plugin and created a test post but I don't see where or how to display my post. Any insight?

Thumbs up

Re: mbBlog - Blog system

As default, the blog path is set to homepage, meaning the dispatcher routes will take over and redirect your homepage to load the blog posts.
This can be changed in the blog settings by changing the blog path. If you wanted your blog to appear at www.mydomain/my-blog you would type my-blog into the blog path box.

If your blog path is blank and the posts aren't showing on the homepage, are you getting any errors of any kind?
Also if they aren't working, could you provide details about which version of wolf you are using, along with server environment / any modifications you may have made to wolf.

Re: mbBlog - Blog system

It doesn't show anything and I followed your instructions. It also does not show any errors.

Thumbs up

Re: mbBlog - Blog system

Do you have debug turned on? And if not could you turn it on.

Need to set debug to true in the config.php of the Wolf Root. Hopefully should give some indication if anything is going wrong.

15

Re: mbBlog - Blog system

I have the same issue.

Installed the blog, works fine in admin.
Made a test blog.

so far so good, but when i want to see the blog on my testsite it's not showing.

I have put the debug on, but no extra info found.
ujust getting this information back:

Content Not Found (404)

The content you requested was not found. It may have been deleted or you may have entered an incorrect address.

Please return to the home page to view the main navigation.



i've named the blog "blog" in the admin so in my opinion it had to be: www.domain.com/blog.

hopefully there is a solution. thanks in advanged

Thumbs up

Re: mbBlog - Blog system

Hmmmm... Not sure what is going on here.
I shall have a look today during my dinner break and get back to you.

Thanks for giving me the heads up on this though, always difficult to catch everything when it's just yourself that tests it!

Re: mbBlog - Blog system

Right I've figured out what's going on.

A combination of having to modify some cores files to get it work (related to the google issue links above, fixed in the latest revisions though) and lack of extensive testing on my part seems to have caused some confusion for everyone! D'oh!

So first off here is a new index.php file for mbblog

<?php
/**
 * mbBlog
 * 
 * Simple blog plugin for WolfCMS.
 * Please keep this message intact when redistributing this plugin.
 * 
 * @author        Mike Barlow
 * @email        mike@mikebarlow.co.uk
 * 
 * @file        index.php
 * @date        07/04/2010
 * 
*/
// check for some constants
if(!defined("CMS_ROOT"))
{
    die("Invalid Action");
}

if(!defined("PLUGINS_ROOT")) // done to allow mbblog to run on 0.6.0
{
    define('PLUGINS_ROOT', CORE_ROOT.'/plugins');
}
if(!defined("MBBLOG"))
{
    define('MBBLOG', PLUGINS_ROOT.'/mbblog');
}

// setup the plugin info
Plugin::setInfos(array(
    'id'          => 'mbblog',
    'title'       => 'mbBlog', 
    'description' => 'Simple and easy to use Blog System.', 
    'version'     => '2.0.0',
    'require_wolf_version' => '0.6',
    'type' => 'both',
    'author'       => 'Mike Barlow',
    'website'     => 'http://www.mikebarlow.co.uk',
    'update_url'  => 'http://www.mikebarlow.co.uk/mbplugins_version.xml'
    )
);
 
// Add the controller and tab for admin
Plugin::addController('mbblog', 'Blog');

// setup the routes - get the settings first though for url location of blog.
$blogpath = Plugin::getSetting('blogpath', 'mbblog');

// add the routes

Dispatcher::addRoute(array( 
    '/'.$blogpath => '/plugin/mbblog/index/', 
    '/'.$blogpath.':num' => '/plugin/mbblog/index/$1',    
    '/'.$blogpath.'view/:any' => '/plugin/mbblog/view/$1'
)); 

Then if you are trying to get it to show the blog on your homepage follow these steps (if not skip down).

- If you are running 0.6.0a  then make sure you fix the bugs I posted links to in post #7,
- if you are running revision 211 or over then ignore the first step.
- Next the blog path in the mbbog settings needs to be left empty.
- That get it online.

If you are trying to run mbblog in a subsection (/blog/) for example.
- Set the blog path to your subsection then forward slash ( / ). It's important the trailing slash is there otherwise it won't pick up the custom routes properly.

That should now be ready to go.

Let me know if you have anymore issues. I'll update the actually zip package later tonight.

18

Re: mbBlog - Blog system

snsmurf: thanks alot, it works.

However a new issue arrived smile

First of all: it's taking the wolf theme as a layout.
I checked with the mbcontact topic and found the solution

line 60            $this->setLayout('wolf');

Changed wolf into my theme (using) and problem solved.
just a note here: can this be changed in automatic theme? So it discovers the current theme and adapts?

Then the bigger issue, and saying that php is still at the very beginnings for me to learn, but will search later, maybe i can find the issue, is that the blog post isn't showing.

I made a post, but the URL is different then the blog.

for instance: www.domain.com/blog/ (current root to blog)
blogpost: www.domain.com/view/blogpost-name/
result: 404

Looks like the blog system is automaticly turning on the view/topic on. Maybe because it's not in my route i thought. But as i'm new to this system: when i leave the blog path empty i still see my home page without the blog.

I can spot alot of this in the mbblogcontroller.php:

line 56: $this->assignToLayout('sidebar', new View('../../plugins/mbblog/views/admin/sidebar'));
line 74: if($this->result == 'view')
Line 154      public function view($urltitle)

and index.php:

 Line 52
Dispatcher::addRoute(array( 
    '/'.$blogpath => '/plugin/mbblog/index/', 
    '/'.$blogpath.':num' => '/plugin/mbblog/index/$1',    
    '/'.$blogpath.'view/:any' => '/plugin/mbblog/view/$1'
)); 

What lets me believe the views is coming back everywhere (like in the URL)

I'm still searching, cause changing the view to blog did not help on the frontpage.

Thumbs up

19

Re: mbBlog - Blog system

Small update!

I found out where the URL is coming from.

Bloglist.php and viewblog.php

I changed both, changing bloglist.pgp made the URL change on the frontend.
However: clicking it: no result, still 404


This is, i think, as far as i can go with trying to solve the problem. Cause i cannot think of anything else being the issue.

Thumbs up

20

Re: mbBlog - Blog system

Hello,

I'm trying to make mbBlog work on wolf 0.6.0a... but ran into major problems.. so i tried to do the patches but it didn't fix anything.

I was never able to see the public blog. The admin interface works but not the public facing part.

1) say i set the slug to /myblog/ in the mbBlog settings and try to navigate to www.domain.com/myblog I get a 404 error.

2) say i create a Page called "myblog" which I leave blank then it will just display that page.

Also one thing i'm not sure I understand about this plugin is that it replaces completely a "page"? So I can't create a "Blog Page" and just insert the mbBlog content in it? This is not clear in the instructions.

3) if this plugin replace completely a Page then It breaks main menu navigation which just iterates over Published main Pages to create the menu....

I'm sure there is something I'm misunderstanding but the bottom line is that to me, mbBlog doesn't work.

Last edited by Cybrid (2010-06-29 17:08)

Thumbs up

Re: mbBlog - Blog system

Hmmm, your not the first one to report this.

Think I'm going to spend this weekend reviewing mbBlog.
It was original done to 'replace a page' as it uses dispatcher routes to make use of 'nice urls', by redirecting the page request to the plugin controller instead of a page.

Might see if there is an easy way to fix this issue while still keeping the nice urls! I'll have a look at it this weekend (which is the first chance I'm going to get) and I'll get back to you.

22

Re: mbBlog - Blog system

I just recently tried setting up the mbBlog plugin and ran into many of the difficulties that others have. I am not sure if a final fix has been found and posted elsewhere, but I managed to get it working fine, so I thought I would share how...

1. I installed and activated the plugin.

2. I set my blog path in the settings to: blog/

3. Needing to get a link to said blog to appear in my navigation menu, I created a child page titled: Blog with a slug of: blog and a breadcrumb entry of: Blog
... I then set the page to Published.

4. I installed the Redirector plugin...

5. I added a redirect so that: /blog redirects to: /blog/

6. In viewlog.php I changed this code: href="/view/
...to this: href="blog/view/
...and then in the same line changed: >/">
...to this: >">

7. In bloglist.php I changed this code: href="/view/
...to this: href="blog/view/
...and then in the same line changed: >/">
...to this: >">
....and then changed this code: href='/view/".stripslashes
...to this: href='blog/view/".stripslashes

....and it works. So far. Hope this helps out. I'm getting ready to do a redesign on my site as I pursue something a little different, so I can't say how long that blog post or even the blog will remain online if anyone should care to check it out. I'll try to leave it up a few days and add another post or two to see how it works with multiple posts, but I was up all night and am tired, in need of sleep.

http://www.connectionary.com/

Sean


** UPDATE: 08/29/2010 - 3:21 CST **
Ran into a minor problem with the navigation menu outputting the Blog menu item in the navigation menu as I wanted....but with an empty set of UL tags (no list items...which is what it should be doing, because I want them hidden), and this led to non-validation for XHTML strict.

Solution? I changed the Blog page status to hidden and hard-coded the entry into the navigation menu.

Everything seems fine, and I don't appear to get any robots.txt, 404 or other internal errors in any logs...so the redirection all seems to be going smoothly.


** UPDATE: 08/29/2010 - 5:24 CST **
I tried a few changes to see what I could get going. I deleted the Blog page altogether and eliminated all the redirects....

Things will work like this if I set my blog settings path to: blog/

The problem is that I then have that one page with '/' tacked on the end of the URL which is contrary to what I want. This seems to be the root of the problem--the trailing / required in the Blog Settings - Blog Path field.

I wish I were more knowledgeable of PHP and programming in general so I could track the issue better, but that appears to be the major obstacle to having a uniform navigation/URL structure with this blog plugin. The other issue that I have is in trying to enable commenting on blog posts using the Comments plugin. I have tried various solutions, from placing the required code in the template for my site pages (which then requires ensuring comments are disabled for all non-blog pages...and it doesn't work in any case) to placing the code in viewblog.php...again, with no luck.

The question to me is: why is it necessary to append the Blog Path setting with a / at all? There must be a better way to tackle this.....just wish I knew what it was. I suppose for uniformity's sake, I could tweak .htaccess to append a / to every URL that doesn't end one so everything would look uniform. But that still wouldn't solve the issue with getting the needed Comment plugin code into pages (I suppose there could be something I'm obviously missing....just not aware of?).

Last edited by Sean (2010-08-29 23:47)

Thumbs up

23

Re: mbBlog - Blog system

Very nice plugin !

When I add text in French language it displays a question mark instead of à é è signs... How can I fix this?

The charset is set to iso-8859-1 in my layout and in the database "utf8_general_ci" for the mbBlog.

Thanks

Thumbs up

Re: mbBlog - Blog system

Apache wrote:

Very nice plugin !

When I add text in French language it displays a question mark instead of à é è signs... How can I fix this?

The charset is set to iso-8859-1 in my layout and in the database "utf8_general_ci" for the mbBlog.

Thanks

Setting the charset to UTF-8 should do it:

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

That worked for me anyway.

You could also put this to your .htaccess:

AddType text/css;charset=UTF-8 .css
AddType text/html;charset=UTF-8 .html
AddType application/xhtml+xml;charset=UTF-8 .xhtml

Last edited by Fortron (2010-09-23 08:25)

Re: mbBlog - Blog system

In the modern web, it is always a good idea to set the character encoding to utf-8. This is a helpful page: http://www.w3.org/International/questio … clarations

Wolf CMS founder and lead developer
Please always check the Support forums and Wiki before asking. (My Ohloh account.)
Like Wolf CMS? Consider making a financial contribution or see our financial report first.