Extension talk:NewsBulletins

From mediawiki.org
Latest comment: 8 years ago by 194.44.30.245 in topic Templates?

Content disappears?[edit]

Hello Ruggerit ... When adding the tags <newsBulletins></newsBulletins> to a page the whole pagecontent diappears (in read-mode) exept for the title? Help?

OK; it seems the above has something to do with the extension MagicNoCache. When I disable this, newsBulletin works.

Next: newsBulletin doesn't return pages in defined categories, exept the default (=Bulletins)? It returns 'no entries found at this time', while i'm sure there are entries (category=abcde). And moreover: the extension ALWAYS shows ONLY bulletins in the category "bulletins". Even when I specify another category, the category "bulletins" is (the only one) showing? Help again?

thnx, grtz BS 20240420114521

Download code and cache issue[edit]

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[edit]

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 [[Category:Bulletins]] 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 "<?php" to the top of the file, and "?>" 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 <newsBulletins> tags

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

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

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 <?php and ?> 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 "<?php" to the top line of the file, and "?>" to the last line and the extension should start working. Sorry for the mistake.

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

Patch to allow wikilinks to be rendered properly in news items[edit]

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 .= "<div class='news-bulletin-title'>» " . $sk->makeKnownLinkObj($title, $title_text) . "</div>";
---
>                               $output .= "<div class='news-bulletin-title'>» " . "[[$title|$title_text]]" . "</div>";

-Jlerner 04:45, 3 March 2009 (UTC)Reply

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

Time zone patch[edit]

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 .= "<div class='news-bulletin-time'>" . date("M j, Y g:i a",strtotime($row->cl_timestamp)) . "</div>";
---
>                               //Patched to display correct time in current time zone
>                               $output .= "<div class='news-bulletin-time'>" . date("M j, Y g:i a",strtotime($row->cl_timestamp) + ($wgLocalTZoffset * 60)) . "</div>";

Version 1.1 is available[edit]

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)Reply

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[edit]

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)Reply

Templates?[edit]

Hi. I would like to simplify my news management and I would like to introduce a template to generify the news coding. Please clarify: is it possible to work with templates? I mean, I would like to implement something like


<newstitle>{{{Title}}}</newstitle>
<teaser>... some generic complex markup here hard to copy/paste|type ... {{{Date}}}, {{{Source}}}</teaser>

{{{Text}}}

<includeonly>[[Category:News]]</includeonly>
<noinclude>[[Category:Templates]]</noinclude>

and then use the template like {{News|...|tet=...}}. But it does not work, because it only renders the "text" instead of the news title and the teaser at the <newsbulletin>. However, using not-templatized text works. Is this extension compatible with templates?

194.44.30.245 17:42, 12 July 2015 (UTC)Reply