Page 1 of 8

[CDB] Smartfeed 3.0.4

Posted: Sun Oct 04, 2015 1:56 am
by MarkDHamill
Smartfeed is now an approved extension. Get it here.

Extension Name: Smartfeed
Author: MarkDHamill

Image
Extension Description: Provides RSS 1.0, RSS 2.0 or Atom 1.0 customized newsfeeds. Users select forums they want, including protected forums if they can access them. There are myriad options to customize the feed. The following features that were in the phpBB 3.0.x modification are not available in the extension: ability to integrate external feeds, ability for users to access posts in non-public forums if mcrypt is not compiled with PHP, the ability to hide Smartfeed sessions, the ability to make the feed work with a specified IP, and the ability to generate a new Smartfeed key. The URL for smartfeed has changed. The URL argument names are different and more concise, so an old Smartfeed URL will not work. IPV6 support is now supported.

Extension Version: 3.0.3

Extension Download: https://phpbbservices.com/smartfeed/sma ... _3.0.3.zip

To speed development of the extension, some features in the 3.0 modification were dropped. They may reappear in future versions. Some major differences between the Smartfeed modification for phpBB 3.0 and the Smartfeed extension for phpBB 3.1 are:

Features removed:
  • Integration of external feeds into the newsfeed are not currently supported.
  • You cannot hide Smartfeed sessions. In most cases Smartfeed sessions will show up as guest sessions.
  • You cannot specify a proxy IP. If you want to use the IP authentication feature, it will apply only to your IP at the time you generated the URI. If your IP changes you will have to regenerate the URI using the Smartfeed user interface.
  • You cannot generate a new Smartfeed key.
  • You lose the ability to see protected forums if mcrypt is not compiled into PHP. Fortunately, it usually is compiled into PHP so it’s probably not a concern. As a result the PHP Secure Communications library is not part of the extension.
  • The feedcreator class is no longer used. Instead, phpBB’s template engine is used to generate Atom, RSS 1.0 and RSS 2.0 feeds.
Features changed:

Code: Select all

// These constants are used to identify URI key/value pair associations. Note these have changed since the phpBB 3.0 mod so URIs will be shorter.

define('SMARTFEED_BOOKMARKS', 'b'); // was bookmarks
define('SMARTFEED_ENCRYPTION_KEY', 'e'); // unchanged
define('SMARTFEED_FEED_STYLE', 'd'); // was feed_style
define('SMARTFEED_FEED_TYPE', 'y'); // was feed_type
define('SMARTFEED_FILTER_FOES', 'ff'); // was filter_foes
define('SMARTFEED_FIRST_POST', 'fp'); // was firstpostonly
define('SMARTFEED_FORUMS', 'f'); // was forum
define('SMARTFEED_LAST_VISIT', 'l'); // was lastvisit
define('SMARTFEED_MARK_PRIVATE_MESSAGES', 'k'); // was pms
define('SMARTFEED_MAX_ITEMS', 'x'); // was count_limit
define('SMARTFEED_MAX_WORDS', 'w'); // was max_word_size
define('SMARTFEED_MIN_WORDS', 'i'); // was min_word_size
define('SMARTFEED_PRIVATE_MESSAGE', 'm'); // was pms
define('SMARTFEED_REMOVE_MINE', 'r'); // was removemine
define('SMARTFEED_SORT_BY', 's'); // was sort_by
define('SMARTFEED_TIME_LIMIT', 't'); // was limit
define('SMARTFEED_USER_ID', 'u'); // unchanged
Features added:
  • Supports IPV6
GitHub
This being my very first extension I am sure there are lots of issues and things I missed, so obviously don't use it in a production environment.

Re: [DEV] Smartfeed 3.0.0

Posted: Sun Oct 04, 2015 7:47 am
by david63
A couple of initial observations.

You do not need the ext.php file unless you plan adding something in there later.

You should not be using global declarations - these should be in your construct function (the extension will probably be denied for using globals)

define('SMARTFEED_GENERATOR', 'Smartfeed Extension for phpBB 3.1'); // Does not need to be language specific
Unless this line is not displayed anywhere (in which case why include it?) then it does have to be translatable.

Re: [DEV] Smartfeed 3.0.0

Posted: Sun Oct 04, 2015 11:19 am
by MuhClaren
Great effort, Mark. I was wondering when you'd share this. ;)

Re: [DEV] Smartfeed 3.0.0

Posted: Sun Oct 04, 2015 1:19 pm
by MarkDHamill
Me too. My phpBB consulting sucks up most of my time and pays real money so this work gets done when the consulting slows down. Also, the first extension for any extension writer is a slow learning process. The documentation helps but there are lots of things you have to puzzle through not in the documentation. Fortunately, the help from other extension team members got me past most hurdles.

The extension architecture is new and fancy but so much more object oriented. I haven't done a whole lot of object oriented programming so that was also a hurdle.

Hope it works well. Looking for feedback.

Re: [DEV] Smartfeed 3.0.0

Posted: Sun Oct 04, 2015 1:22 pm
by MarkDHamill
david63 wrote:A couple of initial observations.

You do not need the ext.php file unless you plan adding something in there later.

You should not be using global declarations - these should be in your construct function (the extension will probably be denied for using globals)

define('SMARTFEED_GENERATOR', 'Smartfeed Extension for phpBB 3.1'); // Does not need to be language specific
Unless this line is not displayed anywhere (in which case why include it?) then it does have to be translatable.
I agree on ext.php. I built everything off the Acme demo example so I kind of left it there figuring I might eventually use it.

The constant SMARTFEED_GENERATOR is actually used, but it's markup in the feed itself. The name of the application generating the feed is required metadata in most feed formats. It's rarely seen, however.

I'm still struggling on how to avoid global variables. I assume some sort of dependency injection is needed instead.

Re: [DEV] Smartfeed 3.0.0

Posted: Sun Oct 04, 2015 1:38 pm
by david63
MarkDHamill wrote:I'm still struggling on how to avoid global variables. I assume some sort of dependency injection is needed instead.
Take a look at my FAQ Manager extension which is not dissimilar in structure with its controller

Re: [DEV] Smartfeed 3.0.0

Posted: Sun Oct 04, 2015 2:47 pm
by MarkDHamill
So it's okay to have one global statement as you have in your code as long as you move them to private variables inside your class, as in faqmanager_module.php?

Code: Select all

	function main($id, $mode)
	{
		global $user, $template, $request, $config, $phpbb_log, $phpbb_root_path, $phpEx;

		$this->config			= $config;
		$this->request			= $request;
		$this->template			= $template;
		$this->user				= $user;
		$this->phpbb_root_path	= $phpbb_root_path;
		$this->phpEx			= $phpEx;

Re: [DEV] Smartfeed 3.0.0

Posted: Sun Oct 04, 2015 2:57 pm
by david63
Sorry - that was the wrong link see this link

Re: [DEV] Smartfeed 3.0.0

Posted: Sat Oct 10, 2015 10:52 pm
by Mick2015
thanks for sharing ya extension mate Sub to this topic, but going to wait untill you add feeds from otheirs sites so they on the news page or new forum, is that in the pipeline too ???

Re: [DEV] Smartfeed 3.0.0

Posted: Tue Oct 13, 2015 9:25 pm
by MarkDHamill
I hope to add it at some point. Right now I haven't figured out how to integrate the SimplePie or similar library into the extensions architecture, so it's on a list of things to look at as I get more familiar with it.

Re: [DEV] Smartfeed 3.0.0

Posted: Fri Oct 16, 2015 7:29 am
by Praggle
Hi Mark,

I am very glad, that you are able to spend some time with this project now. Many thanks !

On my Boardinstallation (3.1.6) the feed (app.php/smartfeed/feed?t=2&s=1&y=0&d=3) is showing up only one category (f=12) independant from my choice of categories and also independant from the access rights of the logged user. Although I have rights for all categories the feed allows only f=12 even in guest status (although f=12 doesn't appear as choice in the smartfeed config panel).

Logged in as user with full access (also for f=15)
app.php/smartfeed/feed?f=12&t=2&s=1&y=0&d=3
is working as expected and
app.php/smartfeed/feed?f=15&t=2&s=1&y=0&d=3
brings
Sorry, due to Smartfeed forum exclusions and your forum access privileges, you cannot access any forums
Praggle

Re: [DEV] Smartfeed 3.0.0

Posted: Fri Oct 16, 2015 12:56 pm
by MarkDHamill
Are those forums publicly accessible? Do you see them when you logout? I used pretty much the same code I had in the 3.0 mod to handle access control and I don't believe the permissions system has changed.

Re: [DEV] Smartfeed 3.0.0

Posted: Sat Oct 17, 2015 7:12 am
by Swen
Thanks for develop this feature! I need this kind of thing, cause i use it just before php3.0.

I have an issue that i have a loop posts:

http://forum.luftfahrtclubbraunschweig. ... =2&y=2&d=3

How can i fix this? There is only one post and i get eleven of it. :?

I can generate what i want, but nothing changes in within the feed. Thats also a point.

Re: [DEV] Smartfeed 3.0.0

Posted: Sat Oct 17, 2015 6:59 pm
by MarkDHamill
Not sure what is causing your issue. Perhaps it was installed incorrectly. The extension handshake is not working. The routing.yml file handles the extension. It should not have changed but you can compare it with what you downloaded.

Re: [DEV] Smartfeed 3.0.0

Posted: Wed Oct 28, 2015 10:38 pm
by Praggle
MarkDHamill wrote:Are those forums publicly accessible? Do you see them when you logout? I used pretty much the same code I had in the 3.0 mod to handle access control and I don't believe the permissions system has changed.
Sorry for my late answer!
No, F=12 is not publicly accessible. I have two publicly accessible forums, but their posts arn't showing up in smartfeeed. It seems to have no influence.