There is no new functionality in this release but it does address all the changes from the first (and hopefully final review) by the phpBB extension team. The changes were actually a lot of work! With luck this may become an approved extension.
The main change in this release was to add a missing join that was causing a Cartesian product, but also changed some code to help the mod get approved. I am submitting this release candidate to the phpBB extension team for review and possible approval. It’s pretty unusual to get it approved on the first pass, but you never know.
I have completed a new version of the Smartfeed extension, the first release candidate, now available for download and testing. I tested every feature and in the process fixed a lot of bugs, as well as adopted a number of suggestions from various phpBB extension writers. Feel free to download it, but please leave comments in the phpbb.com Smartfeed extension discussion topic.
Business slowed a bit allowing me to update the Smartfeed extension under development. I’m labeling this version 3.0.1 as a Beta version as it seems to be stable and features seem to work as advertised. You can download it from my Smartfeed page. There are no new features but lots of code improvements have been made and some bugs found and addressed.
I feel I understand this well enough now to begin work on the Digests extension, which is good news for you suffering digests users.
Finally, a very first version of my Smartfeed extension, obviously not ready for production, is out for testing and comment. More detail is available on my Smartfeed page. Comments should be directed to the phpBB topic. The GitHub project is here.
Sorry it took so long. My consulting work (as well as moving my household and buying a house) has taken a lot of time. It took a lot of time and help to chew over various technical issues.
There is obviously a long way to go before the extension is approved, but it’s a start.
I’ve been slowed a bit by vacation but I am still progressing on the Smartfeed extension. The new extension architecture adds all sorts of twists, complications and tradeoffs for us extension developers that are not well documented or easily understood. In my case I had to try stuff to see if it worked and based on what I learned I have had to tweak things, sometimes resulting in major architectural changes. But it is coming along. I am more than halfway through the part that actually generates the feed, the last part of the actual development part. There is also an extensive code clean up and repackaging part and then releasing it for Development, Alpha and Beta testing. phpBB 3.0 code does not easily port to 3.1, although some of it does. There is a lot of trial and error, but hashing through it for Smartfeed will make doing Digests substantially easier.
Some development notes:
The extension will no longer support the PHP Secure Communications Library. This provided mcrypt-like support if the mcrypt module was not integrated into PHP. I tried to integrate it, but it was too much of a hassle and made the code bloaty. I also know from experience that the phpBB extension team will critically examine everything including 3rd party libraries and likely demand changes. The smaller I can keep the code the better because it will get approved faster. So you must have PHP’s mcrypt module installed if you want the ability to take advantage of features like the ability to see posts since your last login or the ability to get posts in protected forums. This won’t be a problem for most phpBB forums because it is typically compiled into PHP. If you don’t have it, users will just see a message saying these features are not supported.
Part of developing the extension will be to do things in a more modern way. One thing will be to put the code in a GitHub repository. I haven’t figured out that part yet, but I expect to do it as part of the release. This will make it easier for others to suggest changes.
I am learning that code that used to be in separate files can be collapsed into one file. This is not true of styles and language files, but it is true of most include files and constants. They can go into the main class instead. There used to be two separate programs: smartfeed.php and smartfeed_url.php. In the future they will all be handled in one executable.
I am moving to use phpBB’s templating system to generate RSS and ATOM markup for the feed. In the past I used the FeedCreator class. It turns out it’s not that difficult to do once you know the templating system.
Anyhow, it is coming along. Thanks for your patience.
I’ve spent a couple of weeks trying various approaches to the last big chunk of Smartfeed, generating the feed itself. For much of that time I was mired in confusion on how to integrate an external feed into the extensions framework. I think I finally figured out an approach that will work and it will simplify things. Meanwhile I was diverted with other issues, such as how to not use an include file for constants. The solution seems to be to build these into the extension’s main object when it is constructed. A lot of things require rethinking with the new architecture.
Anyhow, what I am likely to do is collapse smartfeed_url.php and smartfeed.php (as they were called in the modification) into a single program. Since the two programs share a lot of similar code, it gives me the opportunity to move the shared code into functions. I was using a 3rd party library (the Universal Feed Creator) to create the feed. Now it looks like I will simplify the approach and simply use phpBB’s template system, with a switch based on the feed type (Atom, RSS 1.0 and RSS 2.0). Now that I am over this major bottleneck, I think the rest of the development will proceed in a fairly straightforward manner.
After weeks of wrestling with issues mostly related to adding and deleting extensions in the new phpBB 3.1 architecture, I finally got past them with a lot of support from the extension writers forum on phpbb.com. The Administration Control Panel user interface is now pretty much done, and the actual user interface part got done in just a morning of work. Fortunately I was able to plug in a lot of code from the old version once I had a framework working, which I got from examining the ACP board settings program. See attached screenshots. As you can see, Smartfeed now appears on the Extensions tab, which is generally where extensions should appear.
With the user interface mostly done I can now begin rewriting the program that actually generates the feed, formerly smartfeed.php. Due to the extension architecture, it will have a different URL.
As you can see from the attached image, the user interface for the Smartfeed extension is pretty much done and looks and behaves virtually the same as it did before. Some development notes:
I have skipped integrating jQuery for now so the Javascript logic is pretty much the same. It may not be needed and for a first version I may choose not to delve into it as it takes considerable time to figure out how to do it the proper way.
The URL will put out slightly different values for key/value pairs. The phpBB Mod/Extension team really doesn’t like text strings like ATOM1.0 in URLs and variables and prefers constants, so I plan to go that route. For example, feed_type=0 will be the same as feed_type=ATOM1.0 in the 3.0 mod. Example of the new URL: http://example.com/phpBB3/app.php/smartfeed/smartfeed?u=2&e=C3TRedNDS4Z4coB4fbxHTUM8knYNy2X7_7Xj4y4y_PWxw6yeDkbUp1yXcG6-vJQgwc9UOBZfz19D0VzpaYHnKw..&lastvisit=1&limit=-1&count_limit=10&sort_by=0&feed_type=0&feed_style=3&max_word_size=10
Certain fields that use to accept a blank now show a zero (0). This made the Javascript a lot easier and less confusing and actually more consistent
I’m deferring testing the ability to generate a new Smartfeed key for later. That code will probably need to be rewritten or possibly removed.
I am now puzzling through the Administration Control Panel interface. In phpBB 3.0 you largely did not need a template, rather you added a lot of instances to an array to generate the controls. The example provided shows using a template. I’d prefer to go with the old approach if it exists rather than recreate a lot of logic. The methods of doing so are not well documented.
When both of these are done I’ll tackled what used to be know as smartfeed.php itself.
The URL will look a little different because of the extension syntax. Instead of smartfeed_url.php it will be something like:
Those of you wondering when I’ll be getting around to a digests extension: I will learn 80% of what I need to know to do that by doing Smartfeed, which is simpler. I’ll start the Digests extension while Smartfeed undergoes its first round of reviews.
All this depends on having time to do so. Being semi-retired it is easier to find the time, but when there is consulting business that will take precedence because it generates income. The extensions do not.
I finally got a break from consulting, which has allowed me to start to tackle the process of converting the Digests and Smartfeed mods to extensions. I’ve also been dragging my feet because writing extensions is hard work. Writing a mod is hard enough because there is a lot to learn about coding conventions and templating, and the phpBB mod team is very anal about what they will accept. There are lots of tricks you pick up over time that are not in the knowledge base. Creating extensions is even more so, with lots of added complications related to the plug and play architecture.
I’m starting with converting Smartfeed because it is easier and it shares a lot of code with Digests. Finishing Smartfeed should make Digests a more straightforward conversion. I’m starting like most extension authors by tailoring the Acme Demo example provided. It’s a process of iterating small changes and seeing if they work. Invariably you find differences and you have to puzzle through why things work differently with the extensions architecture. The extension writers forum on phpbb.com is a great place to ask questions. In any event there will be a lot of changes, even if the user interface and reader program itself won’t look or behave that much differently. For example, in the user interface I’ll be expected to use jQuery to drive the Javascript for logic checking and pop up boxes which is an additional learning experience.
I am attaching a picture of smartfeed_url. Obviously I need to plug in a lot of language variables but the hard part is going to be integrating jQuery.