[RC][1.1.0-r2] FIND

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!
Suggested Hosts
Locked
artikkk
Registered User
Posts: 379
Joined: Sun Jan 04, 2009 1:37 pm
Location: Roma

Re: [DEV] RSS Input

Post by artikkk »

gennyna wrote:
PoPoutdoor wrote:gennyna,

This mod only use @fopen() to get the source.

You said in earlier post that you enabled CURL libraries, maybe this change @error_reporting() level... try to set error_reporting(E_ALL) before the @fopen line.

non ho capito bene cosa fare, puoi dire come fare passo per passo?



I did not understand what to do, you can tell how to do it step by step?
per altervista
http://forum.it.altervista.org/cms-foru ... fopen.html

Ciao
sorry for my bad english :S
gennyna
Registered User
Posts: 72
Joined: Mon Apr 06, 2009 7:29 pm

Re: [DEV] RSS Input

Post by gennyna »

has long been seeking a solution and I have not found ..

you can replace allow-urlopen with CURL library?
User avatar
PoPoutdoor
Registered User
Posts: 217
Joined: Fri Oct 31, 2008 2:58 pm
Contact:

Re: [DEV] RSS Input

Post by PoPoutdoor »

Curl support can be added on next version.

I'm very busy right now and the next version will not be out soon.
User avatar
PoPoutdoor
Registered User
Posts: 217
Joined: Fri Oct 31, 2008 2:58 pm
Contact:

Re: [DEV] RSS Input

Post by PoPoutdoor »

I hardly understand that with Google translate...
[phpBB Debug] PHP Notice: in file /includes/functions_find.php on line 531: cannot yet handle MBCS in html_entity_decode()!
I haven't test this mod with php4, just know this :P

BTW, please report here for php4 related issue.
User avatar
Hippie459MN
Registered User
Posts: 948
Joined: Mon Oct 15, 2007 10:13 pm
Location: Minnesota, USA
Contact:

Re: [DEV] RSS Input

Post by Hippie459MN »

PoPoutdoor wrote:
[phpBB Debug] PHP Notice: in file /includes/functions_find.php on line 531: cannot yet handle MBCS in html_entity_decode()!
I haven't test this mod with php4, just know this :P

BTW, please report here for php4 related issue.
Best thing to do is tell the hosting company or who ever to upgrade to php5. No one used 4 anymore. Very outdated.
User avatar
bactunisie
Registered User
Posts: 3
Joined: Tue Dec 08, 2009 7:21 pm
Contact:

Re: [DEV] RSS Input

Post by bactunisie »

i have this problem :

[phpBB Debug] PHP Notice: in file /includes/acp/acp_find.php on line 423: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /adm/index.php on line 150: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 152: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 153: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 154: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3247)
User avatar
PoPoutdoor
Registered User
Posts: 217
Joined: Fri Oct 31, 2008 2:58 pm
Contact:

Re: [DEV] RSS Input

Post by PoPoutdoor »

bactunisie wrote:i have this problem :

[phpBB Debug] PHP Notice: in file /includes/acp/acp_find.php on line 423: Invalid argument supplied for foreach()
Seems I do the update with the wrong file sets :P

Read this: http://www.phpbb.com/community/viewtopi ... #p11243225
User avatar
MrGroove
Registered User
Posts: 24
Joined: Sun Nov 02, 2008 10:15 pm
Location: groovyPost.com
Contact:

Re: [DEV] RSS Input

Post by MrGroove »

PoPoutdoor wrote:
MrGroove wrote:My Comments on features:

If you make it just like the old FIND code, I'll be happy!

Options:

- Create new Topics for each new item in Feed
- Allow for up to 100 characters in Forum Topic Title

Menu:
Forum Name: (DropDown - to post feed into which forum or sub-forum)
NewsFeed Name: (Text Box Give feed nice name)
Newsfeed URL: (Text Box - Obvious - URL to feed)
Limit: (Limit number of news items to create topics for. 0 for unlimited)
Username: (Text Box - Account Name to post topics under)

And then an option to manually kick off a pull for all feeds or just 1 feed (check boxes etc..) as well as check boxes to delete feeds if needed. And an edit feed option of course.

Thanks!
Everything is in place for current version, except Topic Title not in ACP (with phpBB function call to strip off extra chars, defaulted to 60)
Very Groovy!

Thanks for all the hard work! Playing with it now and everything is working nicely. Thnx!
User avatar
bactunisie
Registered User
Posts: 3
Joined: Tue Dec 08, 2009 7:21 pm
Contact:

Re: [DEV] RSS Input

Post by bactunisie »

PoPoutdoor wrote:
bactunisie wrote:i have this problem :

[phpBB Debug] PHP Notice: in file /includes/acp/acp_find.php on line 423: Invalid argument supplied for foreach()
Seems I do the update with the wrong file sets :P

Read this: http://www.phpbb.com/community/viewtopi ... #p11243225
sorry i did not understand how to fix this problem. :( :( :(
User avatar
bactunisie
Registered User
Posts: 3
Joined: Tue Dec 08, 2009 7:21 pm
Contact:

Re: [DEV] RSS Input

Post by bactunisie »

when trying to import rss i get this response :

Code: Select all

Information

RSS fetch succefully: None.

RSS without updates: None.

RSS with error:

[News] Failed to fetch data from source!
URI: http://can2010.blog.lemonde.fr/feed/

HTTP status :
jinkazama75
Registered User
Posts: 13
Joined: Sat Nov 28, 2009 11:21 am

Re: [DEV] RSS Input

Post by jinkazama75 »

i' ve applied this mod but when i import rss i have this error:

Code: Select all

SQL ERROR [ mysql4 ]

Incorrect string value: '\xF9...[/...' for column 'post_text' at row 1 [1366]

SQL

INSERT INTO phpbb_posts (forum_id, poster_id, icon_id, poster_ip, post_time, post_approved, enable_bbcode, enable_smilies, enable_magic_url, enable_sig, post_username, post_subject, post_text, post_checksum, post_attachment, bbcode_bitfield, bbcode_uid, post_postcount, post_edit_locked, topic_id) VALUES ('76', '113', 0, '80.116.173.189', 1263652888, 1, 1, 0, 0, 0, 'Rezet [RSS Bot]', '', 'Ultimo aggiornamento: [color=green:16q70ob3]oggi, 11:49[/color:16q70ob3]\n\n[color=darkblue:16q70ob3][size=150:16q70ob3]H3G, Naviga3 Time perde il roaming “amico”[/size:16q70ob3][/color:16q70ob3]\n[size=125:16q70ob3]Categoria: [color=darkred:16q70ob3]Internet Mobile Tariffe Estero come a Casa H3G Naviga3 Time roaming internazionale[/color:16q70ob3][/size:16q70ob3]\nPostato: [color=green:16q70ob3]oggi, 11:48[/color:16q70ob3]\n\n[url=http://news.mondo3.com/~r/telefonia-mobile-3-italia/~3/9xGAsH7FxEA/2010-01-16-naviga3-time-all-estero-come-a-casa-rimodulazione.html:16q70ob3][i:16q70ob3]Leggi di pi�...[/i:16q70ob3][/url:16q70ob3]', '819b323ee8bfe1b8276e1622a3331576', 0, 'Ng==', '16q70ob3', 1, 1, 1436)

BACKTRACE


FILE: includes/db/mysql.php
LINE: 174
CALL: dbal->sql_error()

FILE: includes/functions_find.php
LINE: 677
CALL: dbal_mysql->sql_query()

FILE: includes/functions_find.php
LINE: 218
CALL: rss_autopost()

FILE: includes/acp/acp_find.php
LINE: 86
CALL: get_rss_content()

FILE: includes/functions_module.php
LINE: 507
CALL: acp_find->main()

FILE: adm/index.php
LINE: 74
CALL: p_master->load_active()

i've done a database collation utf-8...what else can i do?
User avatar
Mess
Registered User
Posts: 985
Joined: Wed Jul 01, 2009 6:37 am
Name: Kim

Re: [DEV] RSS Input

Post by Mess »

I think I made an error while installing but can't locate it. Can you help me with where I might have gone wrong?
After installing and adding the first feed, I get the following error on the ACP page. The test board seems to operates normally, apart from this ACP page.

Code: Select all

[phpBB Debug] PHP Notice: in file /includes/acp/acp_find.php on line 423: Invalid argument supplied for foreach()
[phpBB Debug] PHP Notice: in file /adm/index.php on line 155: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3256)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 157: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3256)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 158: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3256)
[phpBB Debug] PHP Notice: in file /adm/index.php on line 159: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3256)
User avatar
FatherChaos
Registered User
Posts: 150
Joined: Thu Sep 26, 2002 8:23 pm
Location: Somewhere in the Chicagoland Area
Contact:

Re: [DEV] RSS Input

Post by FatherChaos »

bactunisie wrote:when trying to import rss i get this response :

Code: Select all

Information

RSS fetch succefully: None.

RSS without updates: None.

RSS with error:

[News] Failed to fetch data from source!
URI: http://can2010.blog.lemonde.fr/feed/

HTTP status :
yea, I got this error too.... any known way to fix it?
User avatar
MrGroove
Registered User
Posts: 24
Joined: Sun Nov 02, 2008 10:15 pm
Location: groovyPost.com
Contact:

Re: [DEV] RSS Input

Post by MrGroove »

PoPoutdoor wrote:Nawid, here comes the code mod :)

Note: Applying this mod renders the ACP use feedname as topic title useless!

You have to assign each feed to post in dedicated forum for the best reader experience ;)

Open includes/function_find.php

Find

Code: Select all

			// init vars
			$contents = $heading = $subject = '';
			$processed = $skipped = $latest_ts = 0;

			// Sort items by timestamp
			$item_ary = $parser->items;
			foreach ($item_ary as $key => $row) 
			{
				$a[$key]  = (!empty($row['pubDate'])) ? $row['pubDate'] : 0;
			}
			array_multisort($a, SORT_DESC, $item_ary);
			unset($a);

			// Determine number of news items to process
			$i = sizeof($item_ary);
			if ($item_limit && ($item_limit < $i) )	
			{ 
				$i = $item_limit;
			}
			$i--;

			// Loop through the list of items, up to the limit.
			for ($i; $i >= 0; $i--)
			{
				// Check if any updates.
				$item_ts = $item_ary[$i]['pubDate'];
				if ($item_ts)
				{
					$latest_ts = ($item_ts > $latest_ts) ? $item_ts : $latest_ts;

					// skip to next item if outdated
					if ($last_update >= $item_ts) 
					{
						$skipped++;
						continue;
					}
				}

				// Check to see if we have a subject - some atom feeds like blogspot provide an empty title.
				$title = utf8_tidy($item_ary[$i]['title'], $parser->cjk);
				if (empty($title))
				{
					$title = utf8_tidy($item_ary[$i]['description'], $parser->cjk);
				}
				$title = truncate_string($title, 60, 255, false, $user->lang['TURNCATE']);

				// prepare the message text
				$message = bb_message(
				   $item_ary[$i], 
				   $item_ts, 
				   $post_limit,
				   $inc_image,
					$parser->cjk
				);

				$processed++;

				$contents .= sprintf($user->lang['BB_CONTENTS'], $title) . $message;

			} // end process items

			// message for skipped items
			if ($skipped)
			{
				$msg['skip'][] = sprintf($user->lang['FEED_SKIP'], $feed_name, $skipped);
			}
			// should we include the newsfeed image
			$image_url = $parser->image_url;
			if ($inc_image && !empty($image_url))
			{
				$image_link = $parser->image_link;

				$heading .= sprintf($user->lang['BB_URL'], (empty($image_link)) ? $parser->items[0]['link'] : $image_link, "[img]${image_url}[/img]") . "\n";
			}

			// should we use the acp feedname as subject?
			if ($subject_feedname)
			{
				$subject = $feed_name;
			}

			// should we include the channel info for this newsfeed
			if ($inc_channel)
			{
				$channel = utf8_tidy($parser->channel, $parser->cjk);
				$channel_desc = utf8_tidy($parser->channel_desc, $parser->cjk);
				$channel_link = $parser->channel_link;

				// Assign subject
				if (empty($subject))
				{
					if (!empty($channel))
					{
						$subject = truncate_string($channel, 60, 255, false, $user->lang['TURNCATE']);
					}
					elseif (!empty($channel_desc))
					{
						$subject = truncate_string($channel_desc, 60, 255, false, $user->lang['TURNCATE']);
					}
					else
					{
						$subject = $feed_name;
					}
				}

				if (!empty($channel) && empty($heading))
				{
					$heading .= sprintf($user->lang['BB_CHANNEL'], (empty($channel_link)) ? $channel : sprintf($user->lang['BB_URL'], $channel_link, $channel)) . "\n";
				}

				if (!empty($channel_desc) && $channel_desc != $channel)
				{
					$heading .= sprintf($user->lang['BB_DESC'], $channel_desc);
				}
			}

			$heading .= sprintf($user->lang['BB_UPDATED'], $user->lang['LAST_UPDATED'], $user->format_date($channel_ts));

			if ($processed)
			{
				// New topic on new day ;)
				$new_topic = ($user->format_date($latest_ts + $config['board_timezone'] + $config['board_dst'], 'Y-m-d', true) 
					== $user->format_date($last_update + $config['board_timezone'] + $config['board_dst'], 'Y-m-d', true)) ? 'reply' : 'post';

				rss_autopost($bot, $new_topic, $subject, $heading . $contents);

				$msg['ok'][] = sprintf($user->lang['FEED_OK'], $feed_name, $processed);
			}
Replace with

Code: Select all

			// init vars
			//$contents = $heading = $subject = '';
			$processed = $skipped = $latest_ts = 0;

			// Sort items by timestamp
			$item_ary = $parser->items;
			foreach ($item_ary as $key => $row) 
			{
				$a[$key]  = (!empty($row['pubDate'])) ? $row['pubDate'] : 0;
			}
			array_multisort($a, SORT_DESC, $item_ary);
			unset($a);

			// Determine number of news items to process
			$i = sizeof($item_ary);
			if ($item_limit && ($item_limit < $i) )	
			{ 
				$i = $item_limit;
			}
			$i--;

			// Loop through the list of items, up to the limit.
			for ($i; $i >= 0; $i--)
			{
				// Check if any updates.
				$item_ts = $item_ary[$i]['pubDate'];
				if ($item_ts)
				{
					$latest_ts = ($item_ts > $latest_ts) ? $item_ts : $latest_ts;

					// skip to next item if outdated
					if ($last_update >= $item_ts) 
					{
						$skipped++;
						continue;
					}
				}

				$contents = $heading = $subject = '';

				// Check to see if we have a subject - some atom feeds like blogspot provide an empty title.
				$title = utf8_tidy($item_ary[$i]['title'], $parser->cjk);
				if (empty($title))
				{
					$title = utf8_tidy($item_ary[$i]['description'], $parser->cjk);
				}
				$title = truncate_string($title, 60, 255, false, $user->lang['TURNCATE']);

				// prepare the message text
				$message = bb_message(
				   $item_ary[$i], 
				   $item_ts, 
				   $post_limit,
				   $inc_image,
					$parser->cjk
				);

				$processed++;

				$contents .= sprintf($user->lang['BB_CONTENTS'], $title) . $message;

				// message for skipped items
				if ($skipped)
				{
					$msg['skip'][] = sprintf($user->lang['FEED_SKIP'], $feed_name, $skipped);
				}

				// should we include the newsfeed image
				$image_url = $parser->image_url;
				if ($inc_image && !empty($image_url))
				{
					$image_link = $parser->image_link;

					$heading .= sprintf($user->lang['BB_URL'], (empty($image_link)) ? $parser->items[0]['link'] : $image_link, "[img]${image_url}[/img]") . "\n";
				}

/*	ACP use feedname as topic title will be useless after this mod.
				// should we use the acp feedname as subject?
				if ($subject_feedname)
				{
					$subject = $feed_name;
				}
*/
				$subject = $title;

				// should we include the channel info for this newsfeed
				if ($inc_channel)
				{
					$channel = utf8_tidy($parser->channel, $parser->cjk);
					$channel_desc = utf8_tidy($parser->channel_desc, $parser->cjk);
					$channel_link = $parser->channel_link;

					// Assign subject
					if (empty($subject))
					{
						if (!empty($channel))
						{
							$subject = truncate_string($channel, 60, 255, false, $user->lang['TURNCATE']);
						}
						elseif (!empty($channel_desc))
						{
							$subject = truncate_string($channel_desc, 60, 255, false, $user->lang['TURNCATE']);
						}
						else
						{
							$subject = $feed_name;
						}
					}

					if (!empty($channel) && empty($heading))
					{
						$heading .= sprintf($user->lang['BB_CHANNEL'], (empty($channel_link)) ? $channel : sprintf($user->lang['BB_URL'], $channel_link, $channel)) . "\n";
					}

					if (!empty($channel_desc) && $channel_desc != $channel)
					{
						$heading .= sprintf($user->lang['BB_DESC'], $channel_desc);
					}
				}

				$heading .= sprintf($user->lang['BB_UPDATED'], $user->lang['LAST_UPDATED'], $user->format_date($channel_ts));

				// New topic for each item ;)
				$new_topic = 'post';

				rss_autopost($bot, $new_topic, $subject, $heading . $contents);

			} // end process items

			if ($processed)
			{
				$msg['ok'][] = sprintf($user->lang['FEED_OK'], $feed_name, $processed);
			}

Ahh.. you read my mind. Made the mod and it's working perfectly now. The only other suggestion would be:

1 - Each item in RSS Feed should create new Topic
2 - New topic should be named the Subject line of each RSS Feed Item
3 - New Topic should not include Item Subject inside Topic body
4 - New Topic should not include Last Updated data inside Topic Body

Make sense?
User avatar
PoPoutdoor
Registered User
Posts: 217
Joined: Fri Oct 31, 2008 2:58 pm
Contact:

Re: [DEV] RSS Input

Post by PoPoutdoor »

MrGroove, I already add 1-3 in ACP options in next version :) For #4, I'll consider.

I'm still busy and the new version may be released by mid-Feb., I hoped.
Locked

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