Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2010-09-02 16:40:56

blissend
FluxBB Donor
From: NY, USA
Registered: 2009-07-02
Posts: 30
Website

[PLUGIN] News Generator

newsgenerator.png

This plugin was originally made by Rickard Andersson for PunBB back in the day but I have adapted and expanded upon it with the help of FluxBB devs.

The purpose of this plugin is to generate static markup based on a template for those posts you deem as news (creates news.html). This can be used for example to display the home page of your site.

Download http://fluxbb.org/resources/mods/news-generator/

NOTE: Not really a mod, more like a plugin since its drag/drop install (readme.txt inside).

Options
  • Fetch news from forum
    The forum you want to grab posts from. Simply hovering the mouse over the forum link should display the forum ID (e.g. http://fluxbb.org/forums/viewforum.php?id=1). By default it goes for forum 1.

  • Optional: Max Post Length (new)
    This will crop the post to what you define as the character limit. It won't cut the base forum tags and if it opens one up it'll try to close the tag. Also it'll display a read more link to the rest of the post.

  • Number of posts for latest
    The maximum number of posts to grab for the news.html it generates. So if you set 5, it'll grab the 5 latest topic post from the forum ID chosen.

  • Using news template
    The template used for the generated news.html file and archives. TIP: You can edit news.tpl and save it as about.tpl and using this as the news template will generate an about.html instead.

  • Saving latest news to
    Where to save the generated news.html file. The directory should be writable and if not it should let you know.

  • Optional: Topic ID (new)
    If you only want to generate the news for one in particular then you can specify its topic ID (again you can discover this by looking at the link to the topic). The number of posts option above must be set to 1 for this.

  • Generate news and/or archive? (new)
    You have a choice to generate only news or archives or both. One must be selected.

  • Using archive index template
    The template used to generate the links to all the archives.

  • Saving archive to
    The directory to save all the archives (2010-09.html, 2010-08.html, etc.). This directory should be writable.

  • Optional: Earliest year & month, Optional: Latest year & month (new)
    For large boards it can take a long time to generate the archives and run into problems with script execution time limit. To get around this you can manually do the archives in small batches or perhaps you only want a small portion to be archived in the first place smile

Latest Changes

## Version 1.1.3, 2011-2-09
Removed archive feature.
Added link to latest generated news landing page.

## Version 1.1.2, 2011-2-08
Updated code for FluxBB 1.4.4 latest changes.
Changed generated markup for archive index.

Feel free to make suggestions/comments.

Last edited by blissend (2011-02-09 22:57:11)

Offline

#2 2010-09-02 18:49:48

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,639
Website

Re: [PLUGIN] News Generator

Hmmm... please promise me you'll move it over once the plugin repo is done wink


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

#3 2010-09-02 20:34:10

blissend
FluxBB Donor
From: NY, USA
Registered: 2009-07-02
Posts: 30
Website

Re: [PLUGIN] News Generator

Franz wrote:

Hmmm... please promise me you'll move it over once the plugin repo is done wink

You have my promise. 8)

Offline

#4 2010-09-09 01:18:00

blissend
FluxBB Donor
From: NY, USA
Registered: 2009-07-02
Posts: 30
Website

Re: [PLUGIN] News Generator

Thanks for approving the release 8) Now I have another one for you to approve wink

Added an option to set max character limit which ended up requiring more work than I hoped for. Cropping text and accidentally opening up tags and all had to be addressed.

Last edited by blissend (2010-09-09 01:18:41)

Offline

#5 2010-09-10 19:39:51

blissend
FluxBB Donor
From: NY, USA
Registered: 2009-07-02
Posts: 30
Website

Re: [PLUGIN] News Generator

Thanks for approving again. Also I accidentally submitted for review again. Didn't think updating the description would do that! Sorry big_smile

Offline

#6 2011-02-04 14:48:06

pelm
Member
From: Sweden
Registered: 2010-06-21
Posts: 67

Re: [PLUGIN] News Generator

Hi!

#blissend!

I tried the plugin on 1.4.4, it works if i dont use the crop-option. Whatever number i set in the field character-length, it dont work, it parse out the whole post. It worked on 1.4.2 but not on 1.4.4. Would be happy if you could look at this, if you have the time. smile

/pelm


Sorry for my english, is from Sweden smile

Offline

#7 2011-02-04 19:05:01

blissend
FluxBB Donor
From: NY, USA
Registered: 2009-07-02
Posts: 30
Website

Re: [PLUGIN] News Generator

pelm wrote:

Hi!

#blissend!

I tried the plugin on 1.4.4, it works if i dont use the crop-option. Whatever number i set in the field character-length, it dont work, it parse out the whole post. It worked on 1.4.2 but not on 1.4.4. Would be happy if you could look at this, if you have the time. smile

/pelm

Hi pelm, no problem I'll take a look at this now...

I just upgraded two of my forums to 1.4.4 (one has mods, the other doesn't) and wasn't able to replicate this issue using version 1.1.1 of my plugin. Can you provide more details? Do you have any other mods? What plugin version of mine are you using? What fields were changed from their defaults? Feel free to email me too if you'd like.

~blissend

Last edited by blissend (2011-02-04 19:47:46)

Offline

#8 2011-02-04 20:33:18

pelm
Member
From: Sweden
Registered: 2010-06-21
Posts: 67

Re: [PLUGIN] News Generator

Hi!

Yes, i have some mods. But i was using mod's even before (1.4.2).
I have changed one line in the 'AP_News_Generator.php'-file: where the plugin will save markup, to forum-root (no problem). In the admin-area-fields i set 'Fetch news from forum' to ex. 6 or even default number: '1' (no problem except below). The field 'Number of posts for latest' i set number of posts, tested even with default number, (no problem either, except below)

The problem is in the field 'Optional: Max Post Length'. I have tested with different numbers eg. 25, 50, 75, 100, this not work. It's no problem parse html if i set one or two or three posts but the plugin parses out the whole post, not the shorter one, irrespective of the number i set in the post-length-field. Maybe it's some of my mods but i does not have any strange one. I have version 1.1.1 of your plugin. Hope you could get something. big_smile

/pelm


Sorry for my english, is from Sweden smile

Offline

#9 2011-02-04 21:24:48

pelm
Member
From: Sweden
Registered: 2010-06-21
Posts: 67

Re: [PLUGIN] News Generator

Have tried again and it somehow works but i don't know how. Some forum-id:s just dont work. And the plugin don't cut the text, and in another forums it can crop the text. Is it me that can't understand how the plugin is built and working. I don't know. But i dont think, somehow, that this plugin is failing. I can't figure out why it isn't working sometimes, though. sad

/pelm

Last edited by pelm (2011-02-04 21:28:23)


Sorry for my english, is from Sweden smile

Offline

#10 2011-02-09 22:59:18

blissend
FluxBB Donor
From: NY, USA
Registered: 2009-07-02
Posts: 30
Website

Re: [PLUGIN] News Generator

I loathe saying this but stranger things have happened. Not really sure why you're experiencing that either. Would have to take a closer look at the database and other things. At any rate I've updated it since then.

Last edited by blissend (2011-02-09 23:03:46)

Offline

#11 2012-04-08 22:41:04

bwog
Member
Registered: 2012-04-08
Posts: 19
Website

Re: [PLUGIN] News Generator

A rather large bump, but is there a way I can change it from saving html files to .xml? Because I'd like to be able to edit the template and make it an RSS feed.

Last edited by bwog (2012-04-08 22:41:17)

Offline

#12 2012-04-08 23:37:55

arw
Member
Registered: 2012-03-20
Posts: 117

Re: [PLUGIN] News Generator

if you only need to change extension, it's at line 158 in files/plugins/AP_News_Generator.php

edit : and I forgot, it's also twice line 187

Last edited by arw (2012-04-08 23:39:50)

Offline

#13 2012-04-08 23:59:59

bwog
Member
Registered: 2012-04-08
Posts: 19
Website

Re: [PLUGIN] News Generator

arw wrote:

if you only need to change extension, it's at line 158 in files/plugins/AP_News_Generator.php

edit : and I forgot, it's also twice line 187

That seemed to have worked, thanks.

Now for editing the template file, which will be the hard part, combining HTML with XML...

Last edited by bwog (2012-04-09 00:03:05)

Offline

#14 2013-12-11 12:30:36

sc4t
Member
Registered: 2013-12-06
Posts: 15
Website

Re: [PLUGIN] News Generator

Hello!

I have a problem of encoding with accents
encodage.jpg

Offline

#15 2013-12-11 17:07:58

Otomatic
FluxBB Donor
From: Paris - France
Registered: 2010-01-26
Posts: 568
Website

Re: [PLUGIN] News Generator

Hi,

String encoded utf-8 but displayed in a declared iso-8859-1 environment.


Ce n'est pas parce que l'erreur se propage qu'elle devient vérité. Ghandi
An error does not become truth by reason of multiplied propagation. Ghandi

Offline

Board footer

Powered by FluxBB