[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!
Ideas Centre
Locked
User avatar
EXreaction
Former Team Member
Posts: 5666
Joined: Sun Aug 21, 2005 9:31 pm
Location: Wisconsin, U.S.
Name: Nathan

Re: [RC5] Smartfeed for phpBB 3

Post by EXreaction »

Yes, but you do not need to call user->setup for that, user->add_lang is used to add language.
Mr_HaZaRd
Registered User
Posts: 58
Joined: Thu Dec 20, 2007 8:06 pm

Re: [RC5] Smartfeed for phpBB 3

Post by Mr_HaZaRd »

Is there a way to only show the fist post of each topic on the feed?
sotis
Registered User
Posts: 294
Joined: Tue Oct 17, 2006 4:56 pm
Location: Bulgaria
Contact:

Re: [RC5] Smartfeed for phpBB 3

Post by sotis »

MarkDHamill wrote:
EXreaction wrote:Why have you set this up so that in page_header you are calling $user->setup? :|
The code change is:

Code: Select all

	// BEGIN Smartfeed 2.0 Modification
	$user->setup('mods/smartfeed');
	// END Smartfeed 2.0 Modification
So all this does is add some new language variables needed for the mod. In this case they are used because changes are made to overall_header.html that reference new language variables.
EXreaction wrote:Yes, but you do not need to call user->setup for that, user->add_lang is used to add language.

I have both mods installed, User Blog Mod and Smartfeed Mod and there was a conflict between them because of this code:

Code: Select all

 // BEGIN Smartfeed 2.0 Modification
   $user->setup('mods/smartfeed');
   // END Smartfeed 2.0 Modification
When I changed the code to:

Code: Select all

 // BEGIN Smartfeed 2.0 Modification
   $user->add_lang('mods/smartfeed');
   // END Smartfeed 2.0 Modification
everything is fine and there is not a conflict now.
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC5] Smartfeed for phpBB 3

Post by MarkDHamill »

Okay, sounds like a bug that will get fixed in the next version. Thanks.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
Jos12
Registered User
Posts: 5
Joined: Sat Jul 26, 2008 2:28 pm

Re: [RC5] Smartfeed for phpBB 3

Post by Jos12 »

Pezzoni wrote:Only happens in the ACP: in the General > Board Configuration all the links (except for 'Attatchment Settings') link to a blank page. (..)
I have the same problem. How did you solve it Pezzoni? Or does anyone else have an suggestion on how to fix this?

Smartfeed works fine, however in the ACP I get numerous blank pages, except for 'Attachment settings'. The 'smartfeed settings' module in the General > Board Configuration gives also a blank page. I've already tried to remove this module and re-apply it: it didn't matter. I haven't installed or upgraded anything else. I'm running the latest version of phpBB 3.0.2. The forum language is Dutch, but I don't think that would generate the blank pages. Besides, I won't be the first user to install this in an non-english forum, so the problem would have to be widespread in that case.

I've also tried the suggestion from Mark in this topic by testing through

Code: Select all

select * from phpbb_config where config_name like 'sf_%';
if all the variables where correct in PhpMyAdmin. The list which this code generates matches exactly the list stated in the .xml file.

Also is the prefix of the forum database 'phpbb_', so that's also okay.

Any help or suggestion are highly welcomed! :)
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC5] Smartfeed for phpBB 3

Post by MarkDHamill »

A blank page typically means there is a script error somewhere. The hard part is trying to figure out where it is.

Most likely it is at the integration level. If I had to guess it is a syntax error in your Dutch translation. Embedding a single quote in a language string if it is delimited by single quotes without escaping it will get you in trouble. The same is true with double quotes. Also forgetting semicolons at the end of statements. Since it is a global problem, look specifically at changes made to the Dutch version of these files:

language/en/acp/board.php,
language/en/acp/common.php,

Consider sending me the Dutch translation so it can be integrated into the package.

Also look at the modifications made to the /include files and make sure they are applied correctly.

When all else fails I compare my board with a reference copy of phpBB that I have on my site. This will show the differences and can pinpoint the problem. WinMerge is good tool to use if you run Windows. DeltaWalker is good one if you own a Mac.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
Jos12
Registered User
Posts: 5
Joined: Sat Jul 26, 2008 2:28 pm

Re: [RC5] Smartfeed for phpBB 3

Post by Jos12 »

Thanks for your reply Mark. I've visually compared the Dutch and English versions of 'acp/common.php' and 'acp/board.php'. Both are the same, except offcourse for the Dutch translations, which is embedded correctly in quote signs.

I've also compared 'includes/functions.php' of my phpbb version with an English, new download. Both are the same except for the integration of Smartfeed. I've also re-checked al the steps in the .xml installation file, and there done correctly. I've also compared the new, English install files with the files which needed to be edited for smartfeed: includes/acp/acp_board.php, includes/acp/info/acp_board.php, language/en/acp/board.php, language/en/acp/common.php: they were all the same except for the smartfeed additions.

Which other files could be the problem?

The only other mod I've installed is 'Advanced Quick Reply', which required an editing of 'viewtopic.php' and nothing else.

I noticed this code in the SQL function:

Code: Select all

INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('sf_rfc1766_lang', 'en-GB', '0');
I've changed it to 'nl-NL' but without success. (I could always try. :) )

As last option I've installed WinMerge and compared the following folders and sub-folders:
my phpbb with a clean (new) Dutch download;
my phpbb with a clean (new) English download;
Both had identical files except for installation of smartfeed and (minor) lay out changes in the templates.

What else can I try? :)
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC5] Smartfeed for phpBB 3

Post by MarkDHamill »

The syntax error is there somewhere, just hiding.

I suggest commenting out blocks of inserted code and rerunning and see if that helps isolate where the error is occurring. It sounds like the problem is in the ACP, so I would start first with changes to the language files and see if that makes any difference. Pages may come up with blank text, but it will at least isolate the problem. Then narrow the range of comments until you get a blank screen. This will eventually point to the line with the syntax error.

In my experience, it is always something stupid that is staring you in the face causing these problems.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [RC5] Smartfeed for phpBB 3

Post by IPB_Refugee »

Hi Mark,

thanks a lot for your MOD - I just installed it. :)

One suggestion: When you change the settings in the Smartfeed ACP Module, it is not logged properly but shows {LOG CONFIG SMARTFEED} in the admin logs.

You can look e.g. at this MOD how to add a proper logging part to an ACP module MOD: [Beta] NV user topics 0.1.1

And when I click on the link to smartfeed_url.php I get this error:
[phpBB Debug] PHP Notice: in file /smartfeed_url.php on line 428: Undefined offset: 3
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3790: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3057)
(I have debug mode enabled in config.php.)

And on the page it shows that my version of the MOD is outdated: I have version 2.2.2 but the newest version was 2.1.1 :lol:

Messages like that should only be displayed to admins. Does your MOD show this message only to admins?

Last not least: Sometimes the feed shows
:: answer
("Antwort" in German.) This is really ugly. When a post has no title, it should always show
Re: {name of topic}
Is this possible?

Thanks again for this nice MOD!
Wolfgang
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC5] Smartfeed for phpBB 3

Post by MarkDHamill »

Wolfgang,

The current version is 2.2.2 but it is functionally the same as 2.1.1. I chose not to update the version number file so that people won't waste their time upgrading while this goes through phpBB Mod Team review. They requested these changes. Functionally it is identical.

Thanks for information on how to do ACP logging. It is not there because I never thought to add it. I expect it will be in the next version.

As for the PHP notices, I thought I had gotten them all. But you inadvertently uncovered another one. If there is no letter version, ex 2.2.2.a then the following line will trigger a notice.

Code: Select all

			if (strlen($version_info[3]) > 0)
			{
				$latest_version .=  '.' . $version_info[3];
			}
Not sure precisely how to get around it, but try this and see if it goes away:

Code: Select all

			if ($version_info[3] != NULL && (strlen($version_info[3]) > 0))
			{
				$latest_version .=  '.' . $version_info[3];
			}
--- Some text removed that did not apply ---

As for the problem with a blank subject in the post, in my tests it looks like this:

Code: Select all

Tavern News ::  :: Reply by Mark D Hamill
I was reluctant to add "Re:" because I thought it was not language specific, but as I cannot find a language variable in common.php, it should be okay. So the new code, around line 967 is:

Code: Select all

				if ($row['post_subject'] != '')
				{
					$title = ($config['sf_suppress_forum_names']) ? $row['post_subject'] : $forum_name . $user->lang['SMARTFEED_DELIMITER'] . $row['post_subject'];
				}
				else
				{
					$title = ($config['sf_suppress_forum_names']) ? 'Re: ' . $row['topic_title'] : $forum_name . $user->lang['SMARTFEED_DELIMITER'] . 'Re: ' . $row['topic_title'];
				}
Thank you for reporting bugs. All these will be incorporated in the next version.
Last edited by MarkDHamill on Wed Jul 30, 2008 12:20 pm, edited 1 time in total.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [RC5] Smartfeed for phpBB 3

Post by IPB_Refugee »

Hi Mark,

thanks again for your work - it is much appreciated. Especially security (that unauthorized people can't read private forums) is very important for me.

Here is my solution to avoid the mentioned debug notice:

Code: Select all

		else
		{
			$latest_version = (int) $version_info[0] . '.' . (int) $version_info[1];
			if (strlen($version_info[2]) > 0)
			{
				$latest_version .=  '.' . $version_info[2];
			}
			if (isset($version_info[3]))
			{
				if (strlen($version_info[3]) > 0)
				{
					$latest_version .=  '.' . $version_info[3];
				}
			}

			$version_info = '<span style="color:red">' . sprintf($user->lang['SMARTFEED_VERSION_NOT_UP_TO_DATE'],$config['sf_smartfeed_page_url']);
			$version_info .= ' ' . sprintf($user->lang['SMARTFEED_LATEST_VERSION_INFO'], $latest_version) . ' ' . sprintf($user->lang['SMARTFEED_CURRENT_VERSION_INFO'], $config['sf_version']) . '</span>';
		}
As you see, I just check whether or not $version_info[3] is set, and that works for me. I will test all your other suggestions later and will give you feedback.

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

Re: [RC5] Smartfeed for phpBB 3

Post by MarkDHamill »

Wolfgang, I will apply your changes.

BTW, I referenced changes to /includes/constants_smartfeed.php. This is not in version 2.2.2 and is one of the changes requested by the phpBB Mod Team that I am working on. I edited the post to remove this information. The Mod Team is requesting a number of changes, some of which disturb me and I am hoping they can accommodate some exceptions. For example, they want changes to the feedcreator.class.php, a 3rd party piece of code. I don't want to get into that business if I can avoid it and in the past they have been accepting of using 3rd party classes.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
Darthmat
Registered User
Posts: 114
Joined: Mon Jun 23, 2008 4:08 pm

Re: [RC5] Smartfeed for phpBB 3

Post by Darthmat »

Thanks! I love it.
User avatar
IPB_Refugee
Registered User
Posts: 1290
Joined: Fri Jul 07, 2006 2:25 pm
Location: Austria
Name: Wolfgang Weber

Re: [RC5] Smartfeed for phpBB 3

Post by IPB_Refugee »

Hello,

I generated the URL on the page smartfeed_url.php, then I put it into the NewsFox newsreader. Now I wanted to go the ACP and got the message that I was not allowed to enter the ACP because I had no admin privileges...

What can I have done wrong?

Yesterday it happened a few times that I was logged out of the ACP when using the Smartfeed MOD (tested with different newsreaders, one after the other) and had to re-enter my password.

Regards
Wolfgang

EDIT: I refreshed the page and now I'm completely logged out of my board.
User avatar
MarkDHamill
Registered User
Posts: 4347
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: [RC5] Smartfeed for phpBB 3

Post by MarkDHamill »

When you run smartfeed.php it consumes a phpBB session. A session is needed in order to take advantage of all the features of phpBB, access to constants, error handling routines, etc.

Since a board may run smartfeed.php hundreds or thousands of times a day, part of the design was to make sure that bogus sessions were not showing up. So smartfeed.php will normally kill your session. If you were recently logged into your board, this will have the effect of logging you out. If your board session timed out and an hour or two later you were to run smartfeed.php this should not be a problem.

So the problem is seen if you run smartfeed.php shortly after being on the board.

If you search the code you will find a kill_sessions function.

However, since people will run the test URL in smartfeed_url.php, this instance should not result in a log out due to this code:

Code: Select all

// Kill the session, but only if smartfeed_url.php was not calling this program. Otherwise, the user's phpBB session will end
if (isset($_SERVER['HTTP_REFERER']) && (strpos($_SERVER['HTTP_REFERER'],'smartfeed_url') === false))
{
	kill_sessions();
}
If this bugs you simply comment out these lines, but expect if you to into the ACP that you may see lots of bogus sessions which are really instances of smartfeed.php running by different people.

Perhaps smartfeed.php could be a bit "smarter" by not logging out administrators.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. eBook and paper versions available.
Locked

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