[MODDB] Smartfeed for phpBB 3

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment!
Anti-Spam Guide
User avatar
MarkDHamill
Registered User
Posts: 3854
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by MarkDHamill » Fri Nov 30, 2007 1:27 pm

You bring up a good point. I wasn't aware you could subscribe to email notifications for a whole forum with phpBB 3. I didn't see that listed in the new features. I did see subscribe to a topic in the list of new features.

So probably I need to change the user interface to allow for both cases. Of course if you subscribe to a forum or topic, you are going to get email notifications, which is somewhat redundant if they are also in your feed.

It is these added complexities to phpBB which makes upgrading mods like this one so complicated. The number of possibilities and permutations can expand significantly.

Do you think there should be TWO selections, show Subscribed Topics and another for show Subscribed Forums?
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
MarkDHamill
Registered User
Posts: 3854
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by MarkDHamill » Fri Nov 30, 2007 2:00 pm

Here's another example of the complexity of integrating a newsfeed into phpBB. Actually this applied to my earlier version, but I didn't notice it until last night. I currently allow anyone to get a newsfeed. Should a user who is inactive get a personalized newsfeed? Arguably not, unless they use a public feed. I never considered that permutation before and no one ever complained. However, when I was looking for predefined methods or functions I could call to get user information for phpBB it suddenly occurred to me, and I did some research. In phpBB 3, users have 3 statuses: normal, inactive, ignored and founder.

Obviously normal and founder should be okay. Probably inactive and ignored should not be okay. So that's what I am doing: putting up an error message in these cases. Arguably though such users should not be allowed into the user interface at all.

Should the administrator decide which classes of users can get newsfeeds? There is no clear guidance so I decide as I find these issues. There are lots of these sorts of minefields out there with little clear guidance that you stumble through as you do the work. It's good to find them but what worries me more are those that I do not find or even think about.

Ideally, it would be helpful to have a phpBB guide/mentor who could work with a mod developer to think through these issues in design. But given the open source nature of this world and that no one is getting paid for it, it is probably too much to expect.

So please play with the user interface for Smartfeed and if you use phpBB 3 more than I do think about all the new features and how they might relate to Smartfeed and send me your concerns. Thanks.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
Jim Dominic
Registered User
Posts: 101
Joined: Sat Apr 02, 2005 6:38 pm

Re: [DEV] Smartfeed for phpBB 3

Post by Jim Dominic » Sat Dec 01, 2007 1:06 am

First, THANK YOU for writing and adapting this mod. I used it a lot on my old 2.0.22 board and am looking forward to this for phpBB3!

As an admin I have no particular concerns about who may or may not read the board via RSS. If a user is inactive I wouldn't want them to have any access other than as a typical "Guest", and I would agree they should not be able to access the user interface, but I wouldn't worry about it if they did have access.

If Smartfeed will have a "generic" RSS url for non-customized feeds from the forum, that would be fine for guests and inactive users, reserving the extra functionality for registered users.

I'm not sure what the "ignored" status means--if it means that a given user is on someone else's "Foe" list, I don't see why that should mean the "ignored" person should be prevented from user interface access.

User avatar
MarkDHamill
Registered User
Posts: 3854
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by MarkDHamill » Sat Dec 01, 2007 3:20 am

I fixed the Smartfeed user interface to address a number of concerns expressed.

First, if the user is inactive or ignored (I am pretty sure "ignored" means the user represents a search engine robot) they can only select from public forums. The message has been changed to indicate the reason they are getting public forums might be because their account is inactive or has an ignored status.

Second, when a forum's immediate parent is a forum, the parent forum is not checked or unchecked based on the check mark toggled. If it is a category however the logic will move up the parents until the parent is a forum, wherein the check mark toggling stops.

Third, when you check and uncheck a forum that has children, the checkmarks on the children are untouched. If it is a category, however, the children inherent the check or unchecked status.

Please test the user interface again at this URL, logged in as "Smartfeed Tester" with a password of "smartfeed".

http://potomactavern.org/phpBB3/smartfeed_url.php

You cannot do test #1 because I have no account established as inactive or ignored, but I did change the status of the user in the database and tested each instance and it works fine.

Meanwhile, as time permits I'll keep tackling the smartfeed.php program itself.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

scott_thewspot
Registered User
Posts: 202
Joined: Mon Dec 05, 2005 4:13 am
Location: Australia
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by scott_thewspot » Sat Dec 01, 2007 5:49 am

A few more thoughts then:

As you mentioned, you get an email notification for subscribed topics/forums, so thinking about it, I don't really see any need to put any features around that in Smartfeed at all. If you want those topics then you'll either get the email, or chances are you'll be subscribed to the whole forum through the feed.

With regard to user status, Normal and Founder should get custom feeds. Anyone else just gets the Guest feed. Ignored or inactive users could simply log out which would make them guests, so trying to hide stuff from them would be a waste of code and coding time. Besides, Inactive doesn't mean they are bad people, usually just that they haven't activated a new account yet.

To the comment by Jim about a generic feed, what I did was set the RSS icon auto-feed thingy to use the URL that is generated when you use the interface as a guest. That way, guests didn't even need to use the smartfeed_url interface at all or even be aware of it's existance. :?: Perhaps though an admin option in Smartfeed so that smartfeed.php with no options given presents an admin defined "default" feed? And the smartfeed_url just redirects to the admin defined smartfeed selection if the person isn't logged on? :?:

BUG! The forum selection thing is still buggy. Hopefully you can follow this example:

1. With all forums ticked, untick "Tavern News", and "The Tavern" also goes unticked. "The Watering Hole" is still ticked though. All good so far.
2. Now tick "The Tavern" on. "Tavern News" and "Watering Hole" are both now ticked. Still all good
3. Now untick "The Tavern". The whole branch is now unticked. Moving along nicely.
4. Lastely, tick "The Watering Hole". Now "The Tavern" (and "All subscribed Forums") become ticked again, even though "Tavern News" is still unticked. So we have a different selection of ticks compared to step 1.

The same complication comes about if you play with the forums that have sub and sub-sub forums.

I would suggest simpler approach. Toggling a parent forum or category simply toggles all children below it to the same value, but setting a child forum makes no changes to the parent selections. Unless you have a "grey filled box" option to indicate the partial selection I think this would still work as a logical method.
Forcing phpBB to submit on Microsoft platforms since 2005
Windows Server 2012R2, IIS8.5, MSSQL2012

User avatar
MarkDHamill
Registered User
Posts: 3854
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by MarkDHamill » Sat Dec 01, 2007 2:52 pm

Scott,

Thanks for helping debugging and thinking things through. Collaboration is good and it is much easier to work through these issues now than later.

You are right I think in that the subscriptions logic should be removed. Since there is no way in phpBB to say "stop notifying me of posts for my subscribed forums and topics but retain the settings", getting a feed for only subscribed forums/topics adds no value. It also makes Smartfeed less complicated, which is good. I'll remove it, which is not trivial given all the Javascript.

With my modifications yesterday Inactive or Ignored class users will only see public forums, so that concern is addressed.

On my installation instructions for Smartfeed for phpBB 2 I included instructions on how to "auto advertise" your forum's newsfeed by changing overall_header.tpl. Something similar (a switch) can be done with Smartfeed for phpBB 3. I have to look at it though, but that will likely wait until the end of development. In phpBB 3 these settings would have to be manually edited in constants.php and I don't want to create an admin interface at this time. I would think though that if you have Smartfeed then OF COURSE you would want to "auto advertise" it, so I should make this part of the standard installation instructions.

Thanks for finding that bug. As you can imagine I spent a lot of time working the Javascript and playing with the browser's DOM (thank goodness for Firebug!) to get all the check/uncheck logic working right. It may be more trouble to undo applicable work than to correct this particular bug. It does need to be consistent though and right now it is pretty mysterious how it works. So I will keep playing with it and see what opinions others may have. I do need to keep logic to check/uncheck "All Forums" by examining ALL the checkmarks. All this work is pretty over the top, I suppose, but I like a well thought out and highly usable interface.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

scott_thewspot
Registered User
Posts: 202
Joined: Mon Dec 05, 2005 4:13 am
Location: Australia
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by scott_thewspot » Sat Dec 01, 2007 3:14 pm

I'm wondering if there might not be more value in getting the feed part working, and addressing the interface component after that. I would imagine the feed part, while probably rather more complicated, will more or less stay the same regardless of the config interface? And while I would also like to see a useable interface, I'd really love even more to have some sort of useable feed in place :)
Forcing phpBB to submit on Microsoft platforms since 2005
Windows Server 2012R2, IIS8.5, MSSQL2012

User avatar
Pda0
Registered User
Posts: 217
Joined: Sun Apr 14, 2002 5:00 am
Location: Chile

Re: [DEV] Smartfeed for phpBB 3

Post by Pda0 » Sat Dec 01, 2007 8:51 pm

pimpdaddy wrote:Hi, does anyone know of a "reverse" to this mod? basically i want a news feed to post within my forum...

any ideas?
Mail2Forum will support that functionality, the mod post here: http://www.phpbb.com/community/viewtopi ... 0&t=603719

There is a long way to release though :)

.pd

User avatar
MarkDHamill
Registered User
Posts: 3854
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by MarkDHamill » Sat Dec 01, 2007 10:00 pm

scott_thewspot wrote:I'm wondering if there might not be more value in getting the feed part working, and addressing the interface component after that. I would imagine the feed part, while probably rather more complicated, will more or less stay the same regardless of the config interface? And while I would also like to see a useable interface, I'd really love even more to have some sort of useable feed in place :)
Scott, the user interface defines the URL combinations (name=value pairs) so it is generally a good idea to get that working right before going into the guts of smartfeed.php. Why? Avoids rework. I appreciate your anxiousness to have this working for phpBB 3. I will steal code where I can but it all has to be examined very carefully. I have to look at applicable object methods and functions and use them (or the mod will get rejected), incorporate the latest templating features, obey the myriad rules for coding "correct" phpBB, etc. All this results in higher quality code, but it is time consuming. Too bad phpBB 3 was not designed with a plug in architecture like Wordpress. There would be a lot less of these impacts to worry about.

Anyhow, I think I fixed the glitch with the user interface checkboxes. I have begun work on smartfeed.php but just begun. Right now I am working on the logic that checks for errors in the URL. At best something to test is weeks away, more likely months. Thanks for your patience.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
MarkDHamill
Registered User
Posts: 3854
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by MarkDHamill » Mon Dec 03, 2007 1:01 am

Here are some other things I am discovering as I develop. Forum presentation and sorting has changed in phpBB 3. Users can have topics and posts ordered in all sorts of different ways. So I have added "user order" to the list of ways to order topics which in time will mirror in the feed the way topics and posts are presented on the board. The old phpBB 2 way has been labeled "Traditional Order".

I also noticed that phpBB 3 supports bookmarks. Rather than subscriptions then, bookmarks may be a logical way to get a relevant feed. Do you think I should go this route?

I decided I will no longer support RSS 0.91.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

scott_thewspot
Registered User
Posts: 202
Joined: Mon Dec 05, 2005 4:13 am
Location: Australia
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by scott_thewspot » Mon Dec 03, 2007 2:22 am

MarkDHamill wrote:I also noticed that phpBB 3 supports bookmarks. Rather than subscriptions then, bookmarks may be a logical way to get a relevant feed. Do you think I should go this route?

I decided I will no longer support RSS 0.91.
From what I can gather, bookmarks are just subscriptions without the notification. If you can identify bookmarked topics within the feed I think that would work well (ie: add a bookmark keyword to the topic title or something?). As per the subscribed topics discussion, I wouldn't want it as a choice between bookmarked *or* subscribed topics, being able to have a combination of both together would be my pick, but simply (?) adding a keyword to the feed would be my preferred choice.

As for RSS 0.91, fine. It's too restricitve anyway so I don't know why anyone would still be using it.
Forcing phpBB to submit on Microsoft platforms since 2005
Windows Server 2012R2, IIS8.5, MSSQL2012

User avatar
MarkDHamill
Registered User
Posts: 3854
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by MarkDHamill » Mon Dec 03, 2007 2:50 am

Scott, while in theory you can integrate bookmarked posts/topics with normal posts/topics, implementation is tough. Essentially I need to make two queries and then merge the results. This would be okay if I could depend on SQL unions, but I cannot. I could in theory load everything into arrays and unload into the feed from arrays, but in practice that's not a great idea, simply because it is computationally and memory expensive.

An either/or is possible, however.

I originally supported RSS 0.91 because it had some marginal traction. That was nearly two years ago. Things change. RSS 2.0 seems to be the standard now, but there are some ATOM 1.0 and RSS 1.0 fans. Supporting all 3 is not a problem. Supporting RSS 0.91 is a pain because a proper feed can have no more than 15 items. I will be glad to get rid of it.

I think I have implemented the URL consistency error checking in smartfeed.php correctly. I also have errors being reported as a feed item. I also have the authentication working. The devil is in all the SQL and function calls to collect and create the feed. That will be a slow process.

I discovered another thing to watch out for: draft posts. They will need to be filtered out in the feed. It's always something!
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

scott_thewspot
Registered User
Posts: 202
Joined: Mon Dec 05, 2005 4:13 am
Location: Australia
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by scott_thewspot » Fri Dec 07, 2007 11:12 am

The forums selector is still a bit buggy.

If you untick "All forums", that then unticks every box as expected
If you then tick "SubForum 1" on it's own, it also ticks the top level "The Social Hall" despite other sub forums still being unticked below it.

Another one, if you untick all forums, then tick "The Social Hall", all it's children get selected but itself doesn't. You then can't toggle it at all after that.

Perhaps it isn't worth the effort of the logic? What if you just have every postable forum a tick box that isn't "connected" to the logic of whether or not other forums get selected, and just have category (non-postable forums) with a grey unselectable (or even no) box.
Forcing phpBB to submit on Microsoft platforms since 2005
Windows Server 2012R2, IIS8.5, MSSQL2012

User avatar
MarkDHamill
Registered User
Posts: 3854
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [DEV] Smartfeed for phpBB 3

Post by MarkDHamill » Fri Dec 07, 2007 1:50 pm

Scott, thanks for finding these bugs. It's hard to think of every test case. Yeah, it may be simpler to reduce the logic but that in itself adds complications. For example, if Subsubcategory is checked and the 2 forums under it are not, then I need to build logic in smartfeed.php to figure out its descendants and fetch those forums. So I pay the price somewhere either in the user interface or at the time the feed is generated.

As you may have noticed, I added bookmarks to the user interface, at least when logged in. As for the feed itself, I haven't had time to work on it much this week. Right now I am puzzling how to get a list of authorized forums when the user is not technically logged in.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
Sr X
Registered User
Posts: 202
Joined: Wed Feb 07, 2007 9:25 am

Re: [DEV] Smartfeed for phpBB 3

Post by Sr X » Sat Dec 08, 2007 3:59 pm

is possible add a "RSS Autodiscovery" and "view who read RSS feed online from viewonline"?

is possible that when any user generate the rss url, then show any newsreaders buttons too where the user can subscribe that rss url?

thanks.

Locked

Return to “[3.0.x] MODs in Development”