phpBB Smartfeed

All new MODs released in our MOD Database will be announced in here. All support for released MODs needs to take place in the Customisations Database.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: This forum is only for the announcement of new releases and/or updates of MODs. Any MOD support should be obtained through the Customisations Database in the support area designated for each MOD.

A direct link to support for each MOD is in the first post of the respective topic.
Locked
JakeL
Registered User
Posts: 80
Joined: Thu Oct 16, 2003 11:28 pm
Location: Mass
Contact:

Re: phpBB Smartfeed

Post by JakeL » Wed Sep 02, 2009 2:29 am

Ah, quite understood Mark; that's also largely my hesitation in how much more to 'invest' in this mod (beyond getting it working for my most immediate needs) - the distinct possibility of those efforts being 'obsoleted' one way or the other.

'Native' rss integration in phpBB would be nice of course (whenever it might come about) - but you've done such a thorough implementation so far... well, we'll have to see how whatever's to be might compare.

Meanwhile, I am still playing with 'tweaking' some other styles to support your mod, and have a few more suggestions & questions >g<... So far I've mostly been playing with the "Serenity Purple" style, so the following based on that :
  • - For a "more generic guide / hints" for tweaking styles - the line you suggest to search for in overall_header.html to insert the Smartfeed link after doesn't work so well in other styles; instead, searching for U_FAQ and inserting *before* that line seems a better way to go. The actual line to be inserted is a bit different too, but that's up to the "adventurous modder" to sort out (as that's "non-generic").

    - In smartfeed_url_body.html - is there any particular reason you went with the <dl>/<dt>/<dd>s that you did rather than <table>/<tr>/<td>s that I might be missing ? In some styles your approach ends up with everything in one left-aligned column, whereas a "<table>-based" solution seems to be working across more styles better so far.

    - Also in smartfeed_url_body.html - the <fieldset>s don't seem to be "doing anything" (that I can see ?) in the proSilver style, though they do result in some ugly-ish boxes in other styles - so probably just as well to leave those out ? (Though I admit I haven't played with the subSilver style much yet - maybe they're more "useful" there ?)
Incidentally - I think I've just about got my smartfeed_url_body.html 'tweaked' to my satisfaction and can send a copy on to you if you're interested, just let me know.

Be well & enjoy !

- Jake
Looking for an experienced engineer ? Contact me !
Assembly, C/C++, HTML, Perl, PHP, SQL and much more...
See my page to find out more.

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

Re: phpBB Smartfeed

Post by MarkDHamill » Wed Sep 02, 2009 11:59 am

Anyone who wants to contribute the file changes for other styles are welcome to do so and I will include them in future versions.

Based on my observations, virtually all styles are based on either prosilver or subsilver2, so it's a matter of determining which yours is based on and trying those instructions. My other mod is the Digest mod and I included some instructions there I should add to the DIY instructions for Smartfeed too. Generally if you can understand HTML making template changes are not that big a deal.
If your board uses neither prosilver or subsilver2 styles, you probably would like to make it work for your preferred style.

Most styles are based on either prosilver or subsilver2. To find out which your style is based on, look at the overall_header.html file in your style's template folder. If after the <body> tag you find a <div class="navbar"> the style is subsilver2 based, otherwise it is probably prosilver based.

When copying files, copy the files for the style yours is based on (prosilver or subsilver2) into your style directory.

See if the template files and template changes for that style work for your style. Style changes for prosilver are included in the install.xml file. File changes for subsilver2 can be found here. In some cases you may have to tweak the HTML embedded in the template a bit to make it match your style. If you do not have experience in HTML, consult someone with these skills, although some experimentation usually works. Keep a backup copy of the template in case you make a mistake!
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

marwatk
Registered User
Posts: 3
Joined: Thu Sep 03, 2009 5:06 am

Re: phpBB Smartfeed

Post by marwatk » Thu Sep 03, 2009 5:15 am

Hi Mark,

Great mod. I'm running in to a problem, though. It seems to be consuming a connection for each request:

Code: Select all

[root@iweb ~]# while true; do sleep 2; wget -q "http://www.versatilemonkey.com/forums/smartfeed.php?forum=5&limit=1_DAY&count_limit=100&sort_by=standard&feed_type=RSS2.0&feed_style=HTML"; echo "Finished requesting file"; mysqladmin -u root -p`cat temp.txt` processlist; done;
Finished requesting file
+----+----------+-----------+----------+---------+------+-------+------------------+
| Id | User     | Host      | db       | Command | Time | State | Info             |
+----+----------+-----------+----------+---------+------+-------+------------------+
| 2  | vm_phpbb | localhost | vm_phpbb | Sleep   | 0    |       |                  |
| 3  | root     | localhost |          | Query   | 0    |       | show processlist |
+----+----------+-----------+----------+---------+------+-------+------------------+
Finished requesting file
+----+----------+-----------+----------+---------+------+-------+------------------+
| Id | User     | Host      | db       | Command | Time | State | Info             |
+----+----------+-----------+----------+---------+------+-------+------------------+
| 2  | vm_phpbb | localhost | vm_phpbb | Sleep   | 2    |       |                  |
| 4  | vm_phpbb | localhost | vm_phpbb | Sleep   | 0    |       |                  |
| 5  | root     | localhost |          | Query   | 0    |       | show processlist |
+----+----------+-----------+----------+---------+------+-------+------------------+
Finished requesting file
+----+----------+-----------+----------+---------+------+-------+------------------+
| Id | User     | Host      | db       | Command | Time | State | Info             |
+----+----------+-----------+----------+---------+------+-------+------------------+
| 2  | vm_phpbb | localhost | vm_phpbb | Sleep   | 4    |       |                  |
| 4  | vm_phpbb | localhost | vm_phpbb | Sleep   | 2    |       |                  |
| 6  | vm_phpbb | localhost | vm_phpbb | Sleep   | 0    |       |                  |
| 7  | root     | localhost |          | Query   | 0    |       | show processlist |
+----+----------+-----------+----------+---------+------+-------+------------------+
Finished requesting file
+----+----------+-----------+----------+---------+------+-------+------------------+
| Id | User     | Host      | db       | Command | Time | State | Info             |
+----+----------+-----------+----------+---------+------+-------+------------------+
| 2  | vm_phpbb | localhost | vm_phpbb | Sleep   | 6    |       |                  |
| 4  | vm_phpbb | localhost | vm_phpbb | Sleep   | 4    |       |                  |
| 6  | vm_phpbb | localhost | vm_phpbb | Sleep   | 2    |       |                  |
| 8  | vm_phpbb | localhost | vm_phpbb | Sleep   | 0    |       |                  |
| 9  | root     | localhost |          | Query   | 0    |       | show processlist |
+----+----------+-----------+----------+---------+------+-------+------------------+
Finished requesting file
+----+----------+-----------+----------+---------+------+-------+------------------+
| Id | User     | Host      | db       | Command | Time | State | Info             |
+----+----------+-----------+----------+---------+------+-------+------------------+
| 2  | vm_phpbb | localhost | vm_phpbb | Sleep   | 8    |       |                  |
| 4  | vm_phpbb | localhost | vm_phpbb | Sleep   | 6    |       |                  |
| 6  | vm_phpbb | localhost | vm_phpbb | Sleep   | 4    |       |                  |
| 8  | vm_phpbb | localhost | vm_phpbb | Sleep   | 2    |       |                  |
| 10 | vm_phpbb | localhost | vm_phpbb | Sleep   | 0    |       |                  |
| 11 | root     | localhost |          | Query   | 0    |       | show processlist |
+----+----------+-----------+----------+---------+------+-------+------------------+
Finished requesting file
+----+----------+-----------+----------+---------+------+-------+------------------+
| Id | User     | Host      | db       | Command | Time | State | Info             |
+----+----------+-----------+----------+---------+------+-------+------------------+
| 2  | vm_phpbb | localhost | vm_phpbb | Sleep   | 11   |       |                  |
| 4  | vm_phpbb | localhost | vm_phpbb | Sleep   | 9    |       |                  |
| 6  | vm_phpbb | localhost | vm_phpbb | Sleep   | 7    |       |                  |
| 8  | vm_phpbb | localhost | vm_phpbb | Sleep   | 5    |       |                  |
| 10 | vm_phpbb | localhost | vm_phpbb | Sleep   | 3    |       |                  |
| 12 | vm_phpbb | localhost | vm_phpbb | Sleep   | 0    |       |                  |
| 13 | root     | localhost |          | Query   | 0    |       | show processlist |
+----+----------+-----------+----------+---------+------+-------+------------------+
Finished requesting file
+----+----------+-----------+----------+---------+------+-------+------------------+
| Id | User     | Host      | db       | Command | Time | State | Info             |
+----+----------+-----------+----------+---------+------+-------+------------------+
| 2  | vm_phpbb | localhost | vm_phpbb | Sleep   | 13   |       |                  |
| 4  | vm_phpbb | localhost | vm_phpbb | Sleep   | 11   |       |                  |
| 6  | vm_phpbb | localhost | vm_phpbb | Sleep   | 9    |       |                  |
| 8  | vm_phpbb | localhost | vm_phpbb | Sleep   | 7    |       |                  |
| 10 | vm_phpbb | localhost | vm_phpbb | Sleep   | 5    |       |                  |
| 12 | vm_phpbb | localhost | vm_phpbb | Sleep   | 2    |       |                  |
| 14 | vm_phpbb | localhost | vm_phpbb | Sleep   | 0    |       |                  |
| 15 | root     | localhost |          | Query   | 0    |       | show processlist |
+----+----------+-----------+----------+---------+------+-------+------------------+
Finished requesting file
+----+----------+-----------+----------+---------+------+-------+------------------+
| Id | User     | Host      | db       | Command | Time | State | Info             |
+----+----------+-----------+----------+---------+------+-------+------------------+
| 2  | vm_phpbb | localhost | vm_phpbb | Sleep   | 15   |       |                  |
| 4  | vm_phpbb | localhost | vm_phpbb | Sleep   | 13   |       |                  |
| 6  | vm_phpbb | localhost | vm_phpbb | Sleep   | 11   |       |                  |
| 8  | vm_phpbb | localhost | vm_phpbb | Sleep   | 9    |       |                  |
| 10 | vm_phpbb | localhost | vm_phpbb | Sleep   | 7    |       |                  |
| 12 | vm_phpbb | localhost | vm_phpbb | Sleep   | 4    |       |                  |
| 14 | vm_phpbb | localhost | vm_phpbb | Sleep   | 2    |       |                  |
| 16 | vm_phpbb | localhost | vm_phpbb | Sleep   | 0    |       |                  |
| 17 | root     | localhost |          | Query   | 0    |       | show processlist |
+----+----------+-----------+----------+---------+------+-------+------------------+
The above was done with zero load on the dedicated server.

Eventually it will max out the connections on my server. I took a cursory look at your code and couldn't see any reason why it would do this and the regular forum code wouldn't, any ideas?

Thanks!

-Marcus
VersatileMonkey.com

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

Re: phpBB Smartfeed

Post by MarkDHamill » Thu Sep 03, 2009 11:48 am

Marcus, I don't understand it either. Smartfeed just calls phpBB libraries to make database connections.

Perhaps there is something you can do on your side to tell the database (I assume it is MySQL) to let a session timeout after a given period of inactivity.

Does the same happen with phpBB? You might want to log in, post something, log out, log in again etc. to see what happens with those database connections.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

marwatk
Registered User
Posts: 3
Joined: Thu Sep 03, 2009 5:06 am

Re: phpBB Smartfeed

Post by marwatk » Thu Sep 03, 2009 1:44 pm

Nope, I tried every action I could think of with the base code and I couldn't make it consume an additional connection, but it does every time when generating RSS. The connections do eventually time out, but seemingly not fast enough to keep the total number under the limit during peak times. I'll see what I can do about dropping that threshold, but it would only be a stop-gap solution.

-Marcus

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

Re: phpBB Smartfeed

Post by MarkDHamill » Thu Sep 03, 2009 1:52 pm

I will look into explicitly calling some sort of phpBB sanctioned close connection routine in a future version.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

marwatk
Registered User
Posts: 3
Joined: Thu Sep 03, 2009 5:06 am

Re: phpBB Smartfeed

Post by marwatk » Thu Sep 03, 2009 5:11 pm

Thanks for the hint, I didn't even know there was one, but when I looked I found it. Base phpBB calls garbage_collection after it's finished outputting the template (and a few other places, when no templates are used). Since smartfeed isn't using templates it never gets called so it has be done manually. Adding a call to it in a few places in smartfeed.php solves the issue I was seeing. Here are the places I added it to stop seeing the issue:

Code: Select all

[vm2_phpbb@iweb forums]$ grep -C5 -n garbage_collection smartfeed.php
641-if ($kill_session)
642-{
643-    kill_session();
644-}
645-
646:garbage_collection();
647-// All done!
648-exit;
649-
650-function kill_session ()
651-{
--
667-    if (!(function_exists($auth_method)))
668-    {
669-            include($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
670-    }
671-    $auth_method($user->data, $new_session);
672:        garbage_collection();
673-
674-    return;
675-}
676-
677-function handle_error($error_code)
--
713-    // Kill the session, but only if smartfeed_url.php was not calling this program. Otherwise, the user's phpBB session will end
714-    if (strpos($user->referer,'smartfeed_url') === false)
715-    {
716-            kill_session();
717-    }
718:        garbage_collection();
719-    exit;
720-
721-}
722-
723-function publish_feed($rowset, $pm_rowset = NULL)
--
1014-           }
1015-   }
1016-
1017-   // Publish the feed as RSS or Atom
1018-   $rss->outputFeed($feed_type);
1019:        garbage_collection();
1020-   return;
1021-
1022-}
1023-
1024-function base64_decode_urlsafe($input)
Hope that helps. I'm not sure all of those are necessary, but it shouldn't be a problem if it gets called more than necessary, and I didn't want to follow all the paths by hand.

-Marcus

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

Re: phpBB Smartfeed

Post by MarkDHamill » Thu Sep 03, 2009 5:25 pm

Thanks. You saved me a lot of research.

Add the line of code to smartfeed.php and see if it solves your problem.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

User avatar
Jaifaime
Registered User
Posts: 170
Joined: Wed Jun 10, 2009 12:16 am

Re: phpBB Smartfeed

Post by Jaifaime » Sat Sep 05, 2009 4:12 am

An amazing mod, works perfect!

Thank you very much!
This account is inactive. Have a nice day.

Nanor73
Registered User
Posts: 6
Joined: Tue Jul 07, 2009 6:35 pm

Re: phpBB Smartfeed

Post by Nanor73 » Sat Sep 05, 2009 9:49 am

Great mod, I'm a novice and managed to install it with no issues. Thanks :D

MKULTRA
Registered User
Posts: 188
Joined: Tue Oct 16, 2007 12:07 pm
Contact:

Re: phpBB Smartfeed

Post by MKULTRA » Mon Sep 07, 2009 6:19 am

Hello, I noticed a small issue in my title when viewing the feeds, I use a "&" in my site slogan and it turns up looking like this as an entity:

Cracking the Code - Through & Through

Is there an easy/quick fix for this by chance? Thank you.

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

Re: phpBB Smartfeed

Post by MarkDHamill » Mon Sep 07, 2009 2:38 pm

MKULTRA wrote:Hello, I noticed a small issue in my title when viewing the feeds, I use a "&" in my site slogan and it turns up looking like this as an entity:

Cracking the Code - Through & Through

Is there an easy/quick fix for this by chance? Thank you.
You could go into the Board preferences and replace & with &. See what happens. It may fix the feed but it may also change the title in the browser.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

MKULTRA
Registered User
Posts: 188
Joined: Tue Oct 16, 2007 12:07 pm
Contact:

Re: phpBB Smartfeed

Post by MKULTRA » Tue Sep 08, 2009 4:38 am

Heh, I tried that, it ends up showing the entity on the forum, so that ended up causing a larger issue.

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

Re: phpBB Smartfeed

Post by MarkDHamill » Tue Sep 08, 2009 12:35 pm

What newsreader are you using? My suspicion is that this is a bug in your newsreader and you won't see it in other newsreaders. & should be converted to & otherwise the XML in the RSS feed should render as invalid. Not that there aren't a lot of sloppy/"forgiving" newsreaders out there, but if you tried to validate the feed changing the & to a & it should not validate.
Get the latest versions of my Digests and Smartfeed extensions.
Need phpBB services or a phpBB consultant? I offer most phpBB services.

MKULTRA
Registered User
Posts: 188
Joined: Tue Oct 16, 2007 12:07 pm
Contact:

Re: phpBB Smartfeed

Post by MKULTRA » Wed Sep 09, 2009 3:15 am

Oh in that standard one that you check test the generated code with.

Locked

Return to “[3.0.x] MOD Database Releases”