Page 13 of 17

Re: phpBB Smartfeed

Posted: Thu Dec 24, 2009 6:31 am
by gs2088c
Two things Mark; the first one is to answer your question, and the second is to point something out, before someone says it was the cause of another issue in another post (not for your mod), so please don't take the second comment as directed to you, OK?

COMMENT TO YOU: It works, it was "my bad"; I have NOSCRIPT add-on for FF; I forgot to allow your site to temporarily run scripts. :oops: As I would say to my son "Sorry Charlie" -- yep, that is his name!

COMMENT TO ANYONE ABOUT MY POST CONCERNING PROBLEM WITH DATABASE_UPDATE.PHP. This does not apply; the site I was upgrading was on the permanent allow list, so it would have not been affected!

Version 2.2.17 ready for download

Posted: Thu Dec 24, 2009 3:58 pm
by MarkDHamill
Just in time for the holidays!

Download here

Changes in this version:

* Database changes and the ACP module installation are now done using UMIL. At this time, this applies to install only, not changes.
* ACP interface allows an administrator to add an optional list of required forums that must appear in every feed.
* ACP interface allows an administrator to add an optional list of excluded forums that must never appear in any feed.
* Fixed bug with logout method.
* {S_FORM_TOKEN} removed from templates. Not needed as no form is actually submitted resulting in a database change.

Re: phpBB Smartfeed

Posted: Thu Dec 24, 2009 10:10 pm
by eblom00
Mark,
Thank you for your extremely useful RSS MOD. I seem to have my site working, but, only after changing the kill_session function as you suggested in August 2009 ( http://www.phpbb.com/community/viewtopi ... #p10548935 ). I don't know much about RSS feeds so I used a feed validator to identify the problem ( http://beta.feedvalidator.org/ ).

Without the changes to the kill_session function I was getting

Code: Select all

[phpBB Debug] PHP Notice: in file smartfeed.php on line 705: include(./includes/auth/auth_logout_db.php) function.include: failed to open stream: No such file or directory
Should I have to modify 2.2.17 in this way?

Thanks,
Eric

Re: phpBB Smartfeed

Posted: Thu Dec 24, 2009 10:17 pm
by MarkDHamill
Which version of Smartfeed are you using?

Re: phpBB Smartfeed

Posted: Thu Dec 24, 2009 10:24 pm
by eblom00
Hi Mark,
Thanks for your reply. I'm using 2.2.17.

Code: Select all

<?php
/** 
*
* @package phpBB3
* @version $Id: smartfeed.php, v 2.2.17 Production 2009/06/10 mark@phpbbservices.com Exp $
* @copyright (c) Mark D. Hamill (mhamill@computer.org, http://phpbbservices.com) 
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License 
*
*/
Eric

Re: phpBB Smartfeed

Posted: Thu Dec 24, 2009 11:18 pm
by MarkDHamill
Please change line 705 in smartfeed.php to:

Code: Select all

		include($phpbb_root_path . 'includes/auth/auth_' . basename(trim($config['auth_method'])) . '.' . $phpEx);
This code does not execute for me so I could not test it. Thanks for finding the bug. I will repack the archive.

Re: phpBB Smartfeed

Posted: Sat Dec 26, 2009 7:57 am
by gs2088c
Any idea why I'm getting this?
================================================
Internet Explorer cannot display this feed

This feed contains code errors.
Go back to the previous page.

More information

Only one top level element is allowed in an XML document.
Line: 1292 Character: 2

<br />
================================================
Did 2.2.15 to 2.2.16 then 2.2.17

Thanks.

Re: phpBB Smartfeed

Posted: Sat Dec 26, 2009 3:22 pm
by MarkDHamill
Can you print out the code around the error?

Re: phpBB Smartfeed

Posted: Sat Dec 26, 2009 3:53 pm
by gs2088c
MarkDHamill wrote:Can you print out the code around the error?
I tried to create a feed, clicked "GENERATE", then "TEST", and I got the error. I hope that is will help!

Re: phpBB Smartfeed

Posted: Sat Dec 26, 2009 6:01 pm
by MarkDHamill
Please run it in the browser, then do a view source and paste the lines near where the error is occurring.

Re: phpBB Smartfeed

Posted: Sat Dec 26, 2009 11:03 pm
by gs2088c
MarkDHamill wrote:Please run it in the browser, then do a view source and paste the lines near where the error is occurring.
Dan:

Here's what you asked for. Here is what I do:

1. I have a "site" on my local PC that I make the changes and test.
2. If they are AOK, I then use beyond compare program (see attached) to open up the files in http://localhost/00phpbbchg/ and http://localhost/offline copy of the online board/, and make the changes there.
3. I make the appropriate DB changes to the offline copy.
4. I test it on the offline copy
5. If they are good, I migrate the changes on line.

This is the best way for me to insure that the on-line site is updates correctly. This is especially true, because I now have more than one site on the internet, and this allows me to make sure that they both are perfect, before updating it on line.

Now, after all the above was said, I was able to determine this:

1. Online, 2.2.15 works AOK in IE8 and FF 3.5.6
2. Offline, 2.2.15 works AOK in IE8 and FF 3.5.6
3. Offline, 2.2.17 works AOK in FF 3.5.6
4. Offline, 2.2.17 doesn't work in IE8 (this is what the below is)

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.8.0-dev (info@mypapit.net)" -->
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>******00phpbbchg******00phpbbchg******00phpbbchg******</title>
        <description></description>
        <link>http://localhost/00phpbbchg/board2/smartfeed.php?u=2&e=Z-3Jy7_ZE2pLEsSQnpVHo_LCDsAlWMMDACF9XxxhkxWDlWDsGXax4g..&lastvisit=1&limit=LF&count_limit=500&sort_by=user&feed_type=RSS2.0&feed_style=HTML</link>
        <lastBuildDate>Sat, 26 Dec 2009 17:38:43 GMT</lastBuildDate>
        <generator>FeedCreator 1.8.0-dev (info@mypapit.net)</generator>
<atom:link href="http://localhost/00phpbbchg/board2/smartfeed.php?u=2&e=Z-3Jy7_ZE2pLEsSQnpVHo_LCDsAlWMMDACF9XxxhkxWDlWDsGXax4g..&lastvisit=1&limit=LF&count_limit=500&sort_by=user&feed_type=RSS2.0&feed_style=HTML" rel="self" type="application/rss+xml" />
        <image>
            <url>http://localhost/00phpbbchg/board2/styles/prosilver/imageset/site_logo.gif</url>
            <title>******00phpbbchg******00phpbbchg******00phpbbchg******</title>
            <link>http://localhost/00phpbbchg/board2/smartfeed.php?u=2&e=Z-3Jy7_ZE2pLEsSQnpVHo_LCDsAlWMMDACF9XxxhkxWDlWDsGXax4g..&lastvisit=1&limit=LF&count_limit=500&sort_by=user&feed_type=RSS2.0&feed_style=HTML</link>
        </image>
        <language>en-GB</language>
        <pubDate>Sat, 26 Dec 2009 22:38:43 GMT</pubDate>
        <ttl>60</ttl>
    </channel>
</rss>
<br />
<b>Fatal error</b>:  Cannot redeclare login_db() (previously declared in C:\MyData\My Web Sites\00phpbbchg\board2\includes\auth\auth_db.php:27) in <b>C:\MyData\My Web Sites\00phpbbchg\board2\includes\auth\auth_db.php</b> on line <b>196</b><br />

Re: phpBB Smartfeed

Posted: Sun Dec 27, 2009 12:06 am
by MarkDHamill
Starting around line 687 in smartfeed.php, replace the kill_session function with the following:

Code: Select all

function kill_session ($new_session=true)
{

	// Kill the sessions we consumed. We don't want to use session_kill() because it updates user_lastvisit,
	// which we don't necessarily want to do since the user may want to visit the board later and see
	// messages in the feed as unread.
	
	global $db, $user, $config, $phpEx, $phpbb_root_path;
	
	$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
			WHERE session_id = '" . $db->sql_escape($user->session_id) . "'
				AND session_user_id = " . (int) $user->data['session_id'];
	$db->sql_query($sql);
	
	// Allow connecting logout with external auth method logout
	$method = basename(trim($config['auth_method']));
	include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);

	$method = 'logout_' . $method;
	if (function_exists($method))
	{
		$method($this->data, $new_session);
	}

	return;
}
I tried to avoid using include_once. I should not have as phpBB uses it in session.php.

This looks like a big enough bug to repack the archive.

Re: phpBB Smartfeed

Posted: Thu Dec 31, 2009 3:35 am
by gs2088c
I finally had a change to test out the changes (above), and it works great. But I do have one question, before final implementation on line (it will be, I just have this question).

When I upgrade SF, what happens with the previous feeds. Are they still good, or will SF make the user recreate the URL?

Re: phpBB Smartfeed

Posted: Thu Dec 31, 2009 3:45 am
by MarkDHamill
This is not usually a problem. It would only matter if I change the logic for encrypting keys. I can't see that happening any time soon. Generally I put out a notice in the DIY instructions of the mod if there are impacts like this.

If the event, the user will simply get a message in the feed pointing them to the site to upgrade their encryption key.

Re: phpBB Smartfeed

Posted: Thu Dec 31, 2009 5:07 pm
by gs2088c
MarkDHamill wrote:This is not usually a problem. It would only matter if I change the logic for encrypting keys.
Thanks for the reply. This got me thinking, and a question comes up. If the Admin adds a required forum after the person gets their Smartfeeed URL generated, what happens then? Do they still get the required forums, or does it just have to wait until they generate it the next time? If they have to wait, it might be a good idea on somehow to check to make sure they are getting the required forums, and if not either send it automatically, or invalidate the feed.