Extension talk:NewsBulletins

Download code and cache issue
''The "cut'n paste" option instead of download create a real mess when working on remote terminals with weird setup; many characters are losts, it's a big lost of time fixing all. Why not a simple .gz file to download and extract? ''

''Also, I have to edit the mainpage (and just save it without any changes) to see a new news on it, as stated below. This is very annoying!''

- Asbesto

Issues
''Hello Ruggerit, two more suggestions:

1) Is it correct that I have to edit the mainpage (and just save it without any changes) to see a new news on it? I tried F5, Strg+F5 but id didn't work.

2) I think it would be useful when URLs would been parsed automatically.

''Hello Ruggerit, thank you so much for this Extension! Easy, small, sexy >> perfect :) Just one little bug is annoying me. I use the SelectCategoryTagCloud (version 1.3) extension and it seems that your NewsBulletins has some parsing Problems with it. ''On my "Bulletin Page" I see the Category-Token at the end of every news.

''Your extension appears to do exactly what I've been looking for and I'm very excited about it. However, I can't get it working. After adding the php file to my extensions folder and adding the necessary line to my LocalSettings.php my entire wiki is rendered with the NewsBulletins.php text in the background. An error message is also printed out repeatedly underneath the code that says:''

Warning: Cannot modify header information - headers already sent by (output started at /var/www/wiki/extensions/NewsBulletins/NewsBulletins.php:8) in /var/www/wiki/includes/WebResponse.php on line 10

Any ideas?

The problem is perhaps the following : when you have copied/pasted the code, you have copied a blank line. So, you have to delete the last line.

''I appreciate the quick response. However, I doubled checked the code and there are no blank lines. Any other ideas?' Is the Calendar extensions required for your extension to work?

The calendar extension is not required for this extension, I was just trying to give credit for coding ideas and help.

The php error of trying to output headers comes from an error somewhere in the php code itself. The best way to troubleshoot this is to start from the top:
 * Be sure to copy the php code exactly from the source (I will try to provide another source that is an exact file, rather than copying out of the wiki). Also, add "" to the end of the file.
 * This file should be in the extensions directory
 * The include_once php command should point to the extension file location (ex: extensions/yourdirectoryname/file.php)
 * Note that the css file will not cause this problem.

Now assuming that all these steps are followed exactly, any more information would help me in finding the problem. You say that this error message comes up on every page? What happens on pages with the  tags

I will preform some more tests and get back with any findings.

--Ruggerit 20:35, 5 August 2008 (UTC)

After a little bit of testing, I believe I found the issue. When adding the code to the wiki page, I forgot to add the  tags in the NewsBulletins.php file. These indicate the start and end of php code and are very important to the extension (and all php code). Add "" to the last line and the extension should start working. Sorry for the mistake.

--Ruggerit 00:20, 6 August 2008 (UTC)

Patch to allow wikilinks to be rendered properly in news items
The following simple change enables the extension to handle wikilinks in news items properly: 177a178 >      global $wgOut, $wgTitle, $wgParser; 213c214,217 <      return $newsBulletins->showBulletins; --- >      $popts = $wgOut->parserOptions; >      $popts->enableLimitReport( false ); >      $parserOutput = $wgParser->parse( $newsBulletins->showBulletins, $wgTitle, $popts, true, false ); >      return $parserOutput->getText; 366c370 <                              $output .= " &raquo; ". $sk->makeKnownLinkObj($title, $title_text). " "; --- >                              $output .= " &raquo; ". "$title_text". " "; -Jlerner 04:45, 3 March 2009 (UTC)

Hi, where do I have to change the code? I'm very interesing in rendering wikilinks properly. --Trop 22:20, 26 April 2009 (UTC)

Time zone patch
This may be helpful if the incorrect time is displayed in your news bulletins.

317c317 <               global $wgScript, $wgUser, $wgParser, $wgTitle, $wgOut; --- >               global $wgScript, $wgUser, $wgParser, $wgTitle, $wgOut, $wgLocalTZoffset; 370c370,371 <                              $output .= " ". date("M j, Y g:i a",strtotime($row->cl_timestamp)). " "; --- >                              //Patched to display correct time in current time zone >                              $output .= " ". date("M j, Y g:i a",strtotime($row->cl_timestamp) + ($wgLocalTZoffset * 60)). " ";

Version 1.1 is available
Since today version 1.1 is available. Details and new source code are posted on the main page. Alvinos 15:58, 5 March 2010 (UTC)

well i must say i ate shit with this extention. every time i did anything to my server like purging chace it caused my server to stop responding and made mysql invalid thins. mediawiki 1.15

[SOLVED] Problem when updating to MediaWiki v1.17.0
I had a problem when I upgraded to MediaWiki v1.17.0 - after the upgrade, I received the following error:

Fatal error: Call to undefined function wfPurgeSquidServers in \extensions\NewsBulletins\NewsBulletins.php

I found out that the function wfPurgeSquidServers had been deprecated in v1.15.x of MW, and I guess it's been removed in v1.17.0 (or v1.16.x). To fix the problem I replaced the following line: wfPurgeSquidServers(array($wgTitle->getInternalURL));

with this: SquidUpdate::purge(array($wgTitle->getInternalURL));

Kbobash 22:01, 4 August 2011 (UTC)