Extension talk:My blog

blog problems
Hi,

I think there have been some significant changes between 1.5.5 and 1.6.5, that may bee the root of the error message "Call to non-object..." on line 306 of SkinTemplate.php. The site I'm administering, http://www.sciteam.ubc.ca would be an ideal place for a personal blog and although I'm not proficient at coding, I have been able to modify a few things to suit our needs. I'm interested in finding out if there's a way to modify your blog extension to work with the 1.6.5 implementation...

Kphunter 01:12, 7 July 2006 (MDT)


 * I'm very sorry but i'm using mw 1.6.8 and there is the Error discribed above again :( Fatal error: Call to a member function on a non-object in includes/SkinTemplate.php on line 306--Cryptronic 18:36, 20 July 2006 (UTC)


 * Yes it is definitly there:               $wgOut->setArticleRelated( false ) Do i Have to upgrade to 1.7? --Cryptronic 23:12, 21 July 2006 (UTC)
 * Fatal error: Call to a member function getID on a non-object in includes/SkinTemplate.php on line 306 but i can't find this in you pages. This error came up after upgrading php to php5 Maybe that helps you? --Cryptronic 14:16, 25 July 2006 (UTC)
 * I do not believe the tests I did were on PHP5 I would need to re-verify. Did you verify the placing of the MyBlog link like I stated below (Smcnaught) 21:34, 25 July 2006 (UTC)


 * I'm very sorry :( but this was in the specified file and i get exactly the same error. Maybe it would help so set to the files a id of 0? Because the error says, that this is a non object of a member function.
 * 306: if ( $wgOut->isArticle and (!isset( $oldid ) or isset( $diff )) and 0 != $wgArticle->getID ) {
 * I think by setting an id of 0 could resolve the problem?--Cryptronic 10:28, 26 July 2006 (UTC)

Hello .. I am having the precise same problem .. "Call to non-object..." on line 306 of SkinTemplate.php .. I have checked and rechecked and so forth with no effect .. could there be a conflict within SpecialListSubPages.php .. got latest version from source as linked from the metawiki .. [mailto:Ttf3289@gmail.com bob chaney]


 * Ok i think i got the problem: it's definitly the SpecialListSubPages, because when i add to toe source of that file $wgOut->setArticleRelated( false ); the error is away. But i didn't get the blog content i only got: Maybe you, Smcnaught, could give us your SpecialListSubPages.php od did you add a special article to your wiki to get this extension working?--Cryptronic 10:54, 27 July 2006 (UTC)

"No such special page" Resolved

 * I believe I have resolved the issue. Someone changed the function names for SpecialListSubBlogs and so it was not calling the proper SpecialPage function.  I have updated the SpecialPageSubPages.php.  You will need to also change your href in /includes/SkinTemplate.php to be 'href' => $this->makeSpecialUrl("ListSubBlogs/User:$this->username") .  I was able to reproduce the problem on a new wiki deployment and the new changes should correct the issue. -- (Smcnaught) 17:38, 27 July 2006 (UTC)

Cool! It is working great now! Thanks! .. [mailto:Ttf3289@gmail.com bob chaney]
 * Thanks a lot! It works! Now it goes into my working copy :) --Cryptronic 23:11, 28 July 2006 (UTC)

I am still having nosubpages error. I cudnt be able to resolve it. Please help.

limitResult issue
Hi,

Tried to set it up but when I go to my blog I get: Invalid non-numeric limit passed to limitResult

Backtrace:

This is on 1.7.0 --81.28.129.97 07:30, 9 July 2006 (UTC)
 * 1) 0 /opt/lampp/htdocs/mediawiki/includes/Database.php(929): Database->limitResult('', '0,50', false)
 * 2) 1 /opt/lampp/htdocs/mediawiki/includes/Database.php(976): Database->makeSelectOptions(Array)
 * 3) 2 /opt/lampp/htdocs/mediawiki/extensions/SpecialPageSubPages.php(50): Database->select('page', Array, Array, 'listsubpages', Array)
 * 4) 3 /opt/lampp/htdocs/mediawiki/includes/SpecialPage.php(372): SpecialListSubPages->execute('User:xxx')
 * 5) 4 /opt/lampp/htdocs/mediawiki/includes/Wiki.php(156): SpecialPage->executePath(Object(Title))
 * 6) 5 /opt/lampp/htdocs/mediawiki/includes/Wiki.php(47): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
 * 7) 6 /opt/lampp/htdocs/mediawiki/index.php(123): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
 * 8) 7 {main}


 * Sorry I had no time to look at it earlier, but everything works now thanks :-) --81.28.129.97 09:09, 16 July 2006 (UTC)


 * I am running 1.7.1 and seeing this problem persist despite making the change listed above. My error message is:

Invalid non-numeric limit passed to limitResult

Backtrace:


 * 1) 0 /mediawiki/mediawiki-1.7.1-dev/includes/Database.php(1558): Database::limitResult
 * 2) 1 /mediawiki/mediawiki-1.7.1-dev/includes/Database.php(929): DatabaseMysql->limitResult('', '0,10', false)
 * 3) 2 /mediawiki/mediawiki-1.7.1-dev/includes/Database.php(976): DatabaseMysql->makeSelectOptions(Array)
 * 4) 3 /mediawiki/mediawiki-1.7.1-dev/extensions/SpecialPagesAllBlogs.php(51): DatabaseMysql->select('page', Array, Array, 'listallblogs', Array)
 * 5) 4 /mediawiki/mediawiki-1.7.1-dev/includes/SpecialPage.php(372): SpecialListAllBlogs->execute('')
 * 6) 5 /mediawiki/mediawiki-1.7.1-dev/includes/Wiki.php(156): MediaWiki->executePath(Object(Title))
 * 7) 6 /mediawiki/mediawiki-1.7.1-dev/includes/Wiki.php(47): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
 * 8) 7 /mediawiki/mediawiki-1.7.1-dev/index.php(123): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
 * 9) 8 {main}


 * My line looks like:

array( 'ORDER BY'=>'page_touched DESC','LIMIT' => $limit,'OFFSET' => $offset, ) );


 * Any help/suggestions/ideas? The blog function itself seems to work ok, but this overall search won't.
 * Thanks in advance.  Georgewilliamherbert 05:36, 25 August 2006 (UTC)

I had the same problem, but had to make the above change to both SpecialPageSubBlogs.php and SpecialPagesAllBlogs.php

I am running mediawiki 1.7.1, under php 5.1.4 with no other extensions, apart from  User:Joshurtree/SpecialListSubPages of course.

Hello,

I have the same problem, My error message :

Erreur interne

Invalid non-numeric limit passed to limitResult

Backtrace:


 * 0 E:\wamp\www\mediawiki\includes\Database.php(990): Database->limitResult('', '0,10', false)
 * 1 E:\wamp\www\mediawiki\includes\Database.php(1046): Database->makeSelectOptions(Array)
 * 2 E:\wamp\www\mediawiki\extensions\SpecialPagesAllBlogs.php(51): Database->select('page', Array, Array, 'listallblogs', Array)
 * 3 E:\wamp\www\mediawiki\includes\SpecialPage.php(431): SpecialListAllBlogs->execute('')
 * 4 E:\wamp\www\mediawiki\includes\Wiki.php(182): SpecialPage::executePath(Object(Title))
 * 5 E:\wamp\www\mediawiki\includes\Wiki.php(47): MediaWiki->initializeSpecialCases(Object(Title), Object(OutputPage), Object(WebRequest))
 * 6 E:\wamp\www\mediawiki\index.php(48): MediaWiki->initialize(Object(Title), Object(OutputPage), Object(User), Object(WebRequest))
 * 1) 7 {main}

My line in SpecialPageSubBlog.php is :

array( 'ORDER BY'=>'page_touched DESC', 'LIMIT' => "$limit", 'OFFSET' => '$offset' ) );

Hardcoding of wiki path results in 404 pages
Within both pages: "SpecialPageSubPages.php" and "SpecialPagesAllBlogs.php", in the following code section, the paths are hardcoded with "/wiki/index.php/" $wgOut->addHTML("

Thank you for the prompt response.

Yes, that snippet of code is present in the SpecialPageSubBlogs.php. I went through it looking to see how it was getting the data, figuring it wasn't recognizing that I was logged in and thus permitted to make an entry on my blog. I've tried clearing my browser cache and session data and then logging back in to my wiki and immediately going to my blog and it still does not appear.

Sadly, my wiki is an internal corporate project and as such is not available over the internet. Let me know if I can provide you with anything more.

This is a c&p from MY SpecialPageSubPages.php:

---

// Output results $wgOut->addWikiText('= ' . $target->getDbKey . '\'s Blog ='); if ( 0 == $dbr->numRows( $result ) ) { $d = date( 'Y F d H:i:s T' ); if ($wgUser->getName == $target->getDbKey) { $wgOut->addWikiText(' Add New Blog Entry');

First, thanks for the great extension. Second, I can provide a workaround if not a fix for the missing "Add New Blog Entry" link. If your username contains spaces, you don't get the link. Simple as that. I'm running 1.7.1 with most of the above tweaks. I'll also mention that the limitResult fix is needed in both of the extension files. Please keep up the great work.

"Add New Blog Entry" Link is Not Present - More Info
Other special characters work ok for me. It seems MediaWiki interchanges spaces and underscores in different situations. This problem looks to be because "John Doe" does not match "John_Doe".

-Rick

"Add New Blog Entry" Link is Not Present - Resolved
Thanks so much for your work in supporting this extension. I was the user who originally brought up the issue and I will be testing to see if this works for me tonight. Makes perfect sense though, I feel kind of silly for not catching it myself.

UPDATE: So, after testing this fix I found I was in fact able to make blog entries. However, there are still a few glitches:

1. The discussion link 404's out on me as it is still linking to a name that has an underscore in it.

2. The "Posted By" link suffers the same problem.

I presume a similar little fix will resolve these issues.

A quick and ugly fix
I'm sure the official fix will be elegant and terrific because it'll be written by someone who actually knows a little PHP. I don't but, I figured out that if you add: $user1 = $wgUser->getName; Right before: while ($row = $dbr->fetchObject($result)) It works. (I'm 1.7.1 on Windows with all of the above fixes). Something to do while you wait. - RickB

Another Special case
It doesn't work if the username has an underscore character in it. --152.228.128.98 15:24, 11 June 2010 (UTC)

prevnext definition
When launching "Most Recent Blogs" I am receiving the following error at the top of the wiki page:

Undefined variable: prevnext in /var/apache/htdocs/wiki/extgensions/SpecialPagesAllBlogs.php on line 81

The page then continues to load the blog entries but the output disrupts the screen image.

Where is prevnext to be defined, or am I missing something?

I am running 1.6.7 MediaWiki

Any suggestions or guidance would be appreciated.

Thanks,

Mark

rss feed from blog pages?
It would be nice to get RSS/atom feeds from the blog pages, is this something that should automatically work, or would it need to be added to 'My Blog'?

Have you checked the PHP log?
Can't find your Wiki, eh? Must be rough. Happened to a friend of mine once... Make sure that PHP error logging is on and check the log. It's usually smething simple like a file in the wrong folder or a missing function (wrong version of a file?). You might also consider upgrading MediaWiki.

RickB

No Such special page issue
Hi i have followed all steps and using the latest version of MyBlog but keep getting no such special page error message. I am using MediaWiki 1.7.1. I am using the updated script (after this issue was reported above). I have tried putting the include command in various places in the localsettings.php file as that sometimes helps with extensions but it doesnt make any difference (where should it go by the way top or bottom?). I suspect that it may have something to do with my pretty urls not being activated as you seem to refer to the urls in the pretty format. I installed and started using the wiki with them switched off and now cannot seem to get things working with them on. My server doesnt like standard syntax in the .htaccess file and causes me loads of problems when i mess around with it so im just gonna leave pretty urls off. Any ideas?

By the way my web site address is http://planetpedia.co.uk


 * Sorry - have been working on a number of projects and not had time to log into meta.wikimedia.org to see whats happening. The issue is related to how you are referencing your URLs.  I have never changed it to the method you are using so I would recommend going to irc.freenode.org and chatting with someone in #MediaWiki to see if they can help you resolve the issue.
 * I would also recommend looking within SpecialPagesAllBlogs.php page and look for any reference of /wiki/, replacing it with your wiki directory of /travelguideswiki/. There is only one line with 4 instances of /wiki/ that need to be changed.  Hope that helps. (Smcnaught 04:44, 13 October 2006 (UTC))


 * If you have problem the "No such special page" error message when you click on the My blog menu, try this:

'href' => $this->makeSpecialUrl("ListSubBlogs/User:$this->username") into 'href' => $this->makeSpecialUrl("ListSubPages/User:$this->username")
 * Edit the /include/SkinTemplate.php file and change

I am using MediaWiki: 1.9.0 and this extension working for me (with this minor change above) very well, thanks for the development! Nagy.zolo 21:36, 21 January 2007 (UTC)

Fatal Error: Fatal error: Call to a member function on a non-object
Installed version 1.6.8 for a friend and tried to add the My Blog feature. Followed the instructions as listed and now this error appears:

Fatal error: Call to a member function on a non-object in /home/xxxxx/public_html/xxxxx/includes/SkinTemplate.php on line 306

I've read through all of the discussion for this and tried a few of the suggestions, but nothing's worked.


 * Can you Copy and Paste the section of code around line 306 of your SkinTemplate.php?
 * And if there are any additional errors that it is reporting?
 * Also, when you added:

Making "my blog" in the user menu

 * link is in /includes/SkinTemplate.php
 * Look for

/* set up the default links for the personal toolbar */ $personal_urls = array; if ($this->loggedin) {


 * Down a few lines, right before "$href = $this->makeSpecialURL('Preferences');" Added:

$personal_urls['myblog'] = array(                               'text' => "my blog",                                'href' => $this->makeSpecialUrl("ListSubBlogs/User:$this->username")                         );


 * Are you sure you did it in the right spot and did not make any typo's? It would be helpful to paste that section also if it is different then the section I asked for above.
 * -- Smcnaught 23:46, 17 October 2006 (UTC)

That was it. It was in the wrong place. However, I have one slight problem still. (Very new to all of this so thank you for bearing with me :))

I made a quick test entry into the My Blog link from my sysop account, then clicked on the Most Recent Blogs link from the main menu. The entry is there and looks fine. To the right, there are links for Discussion or to click to see more of the users blog. If I click on the link to view more of the blog, I see this:

Not Found The requested URL /wiki/index.php/Special:ListSubPages/User:C3po was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

I did go back and removed the /wiki/ part since that is not part of the url for the site our wiki is on. I checked to make sure everything else was there, made the appropriate file edits and am stumped.

Thanks!

are you using fancy URLs? if not, then the code needs changed in several spots for this extension, as many of the link show up as /index.php/pagename.... but need to be changed to /index.php?title=pagename.

just something i noticed. and how convenient - while trying to fix MINE i broke it again. :)

I'm not using the fancy urls, no. However, I did get it working, for the most part. The issue I'm having now has to do with the user names that have a space between them. For example, Mydnyte Syn instead of Mydnyte_Syn. I've tried the suggested fixes but none are working. I'm running mediawiki 1.6.8.

Recent Changes RSS Feed broken after installing My Blog extension
I noticed the recent changes/ new pages RSS feeds no longer work after My Blog extension is installed, anyone else have the same problem? Is there a fix out there?

Thanks!

--Sean360 22:59, 30 January 2007 (UTC)

Help me!: Internal error
Special:ListAllBlogs in my wiki has internal error. Error message is: "Set $wgShowExceptionDetails = true; in LocalSettings.php to show detailed debugging information."

If I add $wgShowExceptionDetails = true; to my, it makes another problem. The error message in this situation is: "Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /wecan2/yes0song/hanbin.new21.net/wiki/LocalSettings.php on line 174".

Please help me~. --Yes0song 07:17, 25 March 2007 (UTC)

RSS Feeds and other improvements.
Hi,

I made some changes to My blog extension so it fit my needs and i'd like to share them with the comunity. One of them is an RSS feed for My Blog: And the other one is an improved version of ListSubBlogs:
 * ListSubBlogsRSS
 * ListSubBlogs

Hope it's useful to someone else.

--girino@201.38.57.23 23:48, 23 June 2007 (UTC)

No such special page - MediaWiki 1.11.0
Hello - I've followed the instructions explicitly and everything went well from that aspect. However, when I click the My Blog link to access my blog, I receive the error:

No such special page You have requested an invalid special page. A list of valid special pages can be found at Special:Specialpages. Return to Main Page.

From my Skin Template.php:

$personal_urls['myblog'] = array(                              'text' => "my blog",                               'href' => $this->makeSpecialUrl("ListSubBlogs/User:$this->username")                       );

Can this extension be used on 1.11.0 and if so, how can I correct this and fix this error? 75.167.211.181 14:21, 14 February 2008 (UTC)


 * Yes it can be used on 1.11, as I have successfully installed it, following instructions found here


 * You can view how it looks on my site here...you will notice the link in the sidebar, and also I have the Dynamic Article List displaying the latest blog posts on the main page as well.


 * I am not one to give help as I dont know much, I just look for bug fixes etc, copy and paste etc...but it you dont have any luck, message me privatley or leave a post in my forums, and I will make the files I edited available, and maybe I have done something different that makes it work?


 * Good luck


 * --HTPCnz 04:06, 22 April 2008 (UTC)

Blog Links
Ok, for some reason, the links provided on the blog posts are not working correctly...
 * Discussion
 * 'Users' blog
 * User profile link
 * Blog post title

They all seem to take me to the main page instead of their proper destination... The only one that does work as intended, is the 'Blog entry.....' link...

I have noticed looking at the addresses shown in my browser, that the addresses do not apear to be correct... I have 'clean' titles...


 * What I originally had:   http://www.htpcnz.net/index.php?title=User:Admin
 * What the blog links have: http://www.htpcnz.net/index.php/User:Admin
 * How it should be:        http://www.htpcnz.net/User:Admin

So the current difference is causing the link to not direct correctly: index.php/

I looked in the code, to try to fix this, and I found this code in the 'SpecialPageSubPages.php file:

$wgOut->addHTML(" "); I attempted modifying it to something like this:

$wgOut->addHTML(" "); I also attempted just placing '?title=' in front of the original code, and leaving in '$wgScript/' But nothing has worked for me...in fact, even with those changes, the links did not change at all?

Can you help? Tell me what to edit so I can make those links work properly

Cheers

--HTPCnz 07:02, 23 April 2008 (UTC)


 * Hi,
 * i don't know if the Problem still exists, but did you try changing
 * "$user1's Blog"
 * into
 * "$user1's Blog"


 * Brilliant!
 * Your answer was not correct, but it got me looking again, and I solved it...


 * I previously had tried changing the code from something like: (example only part of line of code)
 * Posted By: $user1
 * to something like this:
 * Posted By: $user1
 * But it did not appear to make any change...


 * But apon looking again, after your post, I could not find the code as you quoted it, but did realise that the same code was needed to be change in both files SpecialPageSubPages.php and SpecialPagesAllBlogs.php...where when I originally tried to change/fix, I only made the change in one file.


 * The exact change I had to make, if any one else needs to know, is:
 * I had to change
 * $wgScript/
 * to
 * /index.php?title=


 * Also, I was not happy with having a discussion page for every blog post, rather have all discussion on the bloggers user discussion page...so to keep all together in one place...


 * To do that, I made this little change to the code:
 * Changed
 * page_title ."\">Discussion
 * to
 * Discussion
 * Now all blog discussion redirects to the users discussion page
 * --HTPCnz 11:55, 18 May 2008 (UTC)

Ubuntu 8.04 /MediaWiki 1.10
Anyone have this working on this version? If so, can someone post a pointer to their SpecialPageSubPages.php SpecialPagesAllBlogs.php

I've gone over all of the instructions in all of the sites and as soon as I turn on the extensions in my LocalSettings.php, the entire site becomes broken.

I've turned on error logging for PHP but there isn't anything significant in the logs. Any help would be appreciated.

Confirmed for Ubuntu 8.04 and 1.13.2 Mediawiki. Warning: Cannot modify header information - headers already sent by (output started at /var/www/extensions/SpecialPagesAllBlogs.php:92) in /var/www/includes/WebResponse.php on line 10

Admin Blog suggestion
If the admin makes a blog,how about making a "blog" link appear on the left hand side column? For example on this page on the left there is the following:

Main Page Browse categories Community portal Recent changes

So if the Admin posts a blog it could look like this:

Main Page Browse categories Community portal Recent changes Blog

This is so every wiki user can see the admin's blog easily.

There should also be a red text image saying "new" when the admin posts a new blog. eg. Blog *new

Do you think the next version of ur software could have this feature? Ryan14 11:35, 27 December 2008 (UTC)

PHP code showing with mediawiki 1.15
Hi. Having a little trouble. I've followed the installation instructions carefully. However, every wiki page now shows the SpecialPageSubPages.php and SpecialPagesAllBlogs.php code one on top of each other. Each block has a custom sidebar with partnership and sponsor links. Then below the this my pages are finally shown with my sidebar.

Anyone got any idea why this is happening? Mitchelln 10:32, 16 June 2009 (GMT)

Update - Fixed this particular problem. If you download the php files via right-click you get garbage in the files. However, I now get: No such special page You have requested an invalid special page. A list of valid special pages can be found at Special pages.

Mitchelln 10:50, 16 June 2009 (GMT)

Okay, sorted it. I had to apply all the patches in the above discussions. I assumed the latest version of the code would have incorporated these changes. Still can't get the users blog link under the discussion link to work though. I click Recent Blogs and get the list, but when I click the users blog link I get the no such special link page. The link is http://localhost/Permaculture/index.php/Special:ListSubPages/User:xxx why is the link not http://localhost/Permaculture/index.php/Special:ListSubBlogs/User:xxx which works? What is the difference between ListSubBlogs and ListSubPages?

Thanks!

Mitchelln 10:59, 16 June 2009 (GMT)

Including Blog Entries in search
Hi there.... I am starting a wiki, and have incorporated this extension in my site. It is working well, however, I would like to have the blog entries included in the search results.

For example, I would like it to have the search results page in two sections. A section where it searches the wiki articles and then a second section where it shows results from the blogs. Anyone know if this is possible?? --Mattwalker62 03:33, 11 September 2009 (UTC)


 * You need to use the advanced aearch and enable the checkbox for search also within user pages. All blog posts are stored a user owned page. --Mathias 21 March 2010

Extension Maintenance
Is this extension maintained any longer?

--Enterprise user 19:40, 6 August 2010 (UTC)