[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!
Get Involved
Locked
User avatar
Nawid
Registered User
Posts: 329
Joined: Sat Jun 27, 2009 4:32 pm
Contact:

Re: [DEV] RSS Input

Post by Nawid » Wed Dec 23, 2009 2:11 am

Works like charm, thank you.

I've got a question Is it possible to enable the option to post every single feedpost on new topic?
Image
Check SuperNova Orange style on:
SchoolLife.nl
phpBB.com

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

Re: [DEV] RSS Input

Post by PoPoutdoor » Wed Dec 23, 2009 3:32 am

Nawid wrote:Works like charm, thank you.

I've got a question Is it possible to enable the option to post every single feedpost on new topic?
The related v0.2 posting code in functions_find:

Code: Select all

				// 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';
I'm not sure what you means...if you said post to new topic on every feed import, you could changed to

$new_topic = 'post'.

BTW, if you want every feed import always posted as reply, you can changed to $new_topic = 'reply'.

For future version, I have to figured out how to add new topic intervals option in ACP for 1 day/1 week/1 month to avoid too much post in a single feed topic. Anyway, this depends on the import frequency and the feed source content update frequency, also what the mod user thinks which way is better for their site.
Last edited by PoPoutdoor on Wed Dec 23, 2009 7:09 am, edited 1 time in total.

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

Re: [DEV] RSS Input

Post by PoPoutdoor » Wed Dec 23, 2009 3:46 am

There is a bug fix related to newlines being stripped off, read the first post for the fix. :P

plasmino
Registered User
Posts: 261
Joined: Sat Jul 25, 2009 11:12 am

Re: [DEV] RSS Input

Post by plasmino » Wed Dec 23, 2009 5:11 am

PoPoutdoor wrote:plasmino,

Seems you doesn't follow the upgrade instructions... have you copy the language files?

yes.. errors with the English files Language and fixes applied

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

Re: [DEV] RSS Input

Post by PoPoutdoor » Wed Dec 23, 2009 7:06 am

Documents in second post should address most problem about this mod.

Please PM me about the English syntax issue ;) , post your comments to make this better and useful :)

wolfk
Registered User
Posts: 12
Joined: Tue Dec 08, 2009 11:30 pm

Re: [DEV] RSS Input

Post by wolfk » Wed Dec 23, 2009 8:57 am

I love the idea of this mod, and I think I'm close to getting it working, but I've run into an error with the RSS Import Settings when I try to import a feed.

After I hit submit I get a success, but when I go back to the RSS settings I get this error

[phpBB Debug] PHP Notice: in file /includes/acp/acp_find.php on line 423: Invalid argument supplied for foreach()


Thanks in advance for the help, and a great mod.

User avatar
Nawid
Registered User
Posts: 329
Joined: Sat Jun 27, 2009 4:32 pm
Contact:

Re: [DEV] RSS Input

Post by Nawid » Wed Dec 23, 2009 11:59 am

PoPoutdoor wrote:
Nawid wrote:Works like charm, thank you.

I've got a question Is it possible to enable the option to post every single feedpost on new topic?
The related v0.2 posting code in functions_find:

Code: Select all

				// 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';
I'm not sure what you means...if you said post to new topic on every feed import, you could changed to

$new_topic = 'post'.

BTW, if you want every feed import always posted as reply, you can changed to $new_topic = 'reply'.

For future version, I have to figured out how to add new topic intervals option in ACP for 1 day/1 week/1 month to avoid too much post in a single feed topic. Anyway, this depends on the import frequency and the feed source content update frequency, also what the mod user thinks which way is better for their site.

It works. But I meant, I want that every imported feeds(subject) will be posted on new topic.

For example, if you go to http://test.schoollife.nl/viewtopic.php?f=4&t=2 you can see many subjects and posts. I want that every

Code: Select all

Opmerkelijk | Re: Olympisch gewichtheffer bevalt tijdens ...
Category: Opmerkelijk
Posted: Vr 18 Dec 2009, 20:33 Author: Jasper

wel jij zult het wel weten Statistieken : Geplaatst door Jasper • op Vr 18 Dec 2009, 19:33 • Reacties 7 • Bekeken 38

Read more...
will be posted on a new topic.

Is it possible? I think it's very hard to manage it :)
Image
Check SuperNova Orange style on:
SchoolLife.nl
phpBB.com

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

Re: [DEV] RSS Input

Post by PoPoutdoor » Thu Dec 24, 2009 3:15 am

wolfk wrote:I love the idea of this mod, and I think I'm close to getting it working, but I've run into an error with the RSS Import Settings when I try to import a feed.

After I hit submit I get a success, but when I go back to the RSS settings I get this error

[phpBB Debug] PHP Notice: in file /includes/acp/acp_find.php on line 423: Invalid argument supplied for foreach()
I haven't got any error about that part of code... can you reproduced this again?

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

Re: [DEV] RSS Input

Post by PoPoutdoor » Thu Dec 24, 2009 3:54 am

Nawid, I got what you means by now :)

This can be done with posting code mod in function get_rss_content() from includes/function_find.php

Current code use a for loop to gather each <item> (or <entry> if Atom) and store in $contents, and the post subject is $subject. You have to assign $subject to $title and move the for loop after rss_autopost($bot, $new_topic, $subject, $heading . $contents); too.

Code: Select all

			// Loop through the list of items, up to the limit.
			for ($i; $i >= 0; $i--)
			{
					:
					:
					:
				$contents .= sprintf($user->lang['BB_CONTENTS'], $title) . $message;

			} // end process items

					:
					:
					:

			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);
			}
Change to something like this

Code: Select all

			for ($i; $i >= 0; $i--)
			{
					:
					:
					:
				$contents .= sprintf($user->lang['BB_CONTENTS'], $title) . $message;

					:
					:
					:

				if ($processed)
				{
					// 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);
			}
I haven't test this, but will works as you liked to be. Be prepared for errors and track the variables inside the loop!

Post your working code back and I can put this in the mod file in next update. :)

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

Re: [DEV] RSS Input

Post by PoPoutdoor » Thu Dec 24, 2009 4:08 am

OOPS! Just found out some files in v0.2r2 contains the "\r" char, v0.2r3 released.

Just copy over the files, no edits for the updates. :)

wolfk
Registered User
Posts: 12
Joined: Tue Dec 08, 2009 11:30 pm

Re: [DEV] RSS Input

Post by wolfk » Thu Dec 24, 2009 9:10 am

PoPoutdoor wrote:OOPS! Just found out some files in v0.2r2 contains the "\r" char, v0.2r3 released.

Just copy over the files, no edits for the updates. :)

Copied over the files and still get the same error :(

User avatar
Nawid
Registered User
Posts: 329
Joined: Sat Jun 27, 2009 4:32 pm
Contact:

Re: [DEV] RSS Input

Post by Nawid » Thu Dec 24, 2009 11:54 pm

PoPoutdoor wrote:Nawid, I got what you means by now :)

This can be done with posting code mod in function get_rss_content() from includes/function_find.php

Current code use a for loop to gather each <item> (or <entry> if Atom) and store in $contents, and the post subject is $subject. You have to assign $subject to $title and move the for loop after rss_autopost($bot, $new_topic, $subject, $heading . $contents); too.

Code: Select all

			// Loop through the list of items, up to the limit.
			for ($i; $i >= 0; $i--)
			{
					:
					:
					:
				$contents .= sprintf($user->lang['BB_CONTENTS'], $title) . $message;

			} // end process items

					:
					:
					:

			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);
			}
Change to something like this

Code: Select all

			for ($i; $i >= 0; $i--)
			{
					:
					:
					:
				$contents .= sprintf($user->lang['BB_CONTENTS'], $title) . $message;

					:
					:
					:

				if ($processed)
				{
					// 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);
			}
I haven't test this, but will works as you liked to be. Be prepared for errors and track the variables inside the loop!

Post your working code back and I can put this in the mod file in next update. :)

Thanks for your reply :) sorry for late respons.

hmmm.... I tried it, but it gives me now this

Code: Select all

 Parse error: syntax error, unexpected ':' in /var/www/vhosts/schoollife.nl/subdomains/test/httpdocs/includes/functions_find.php on line 118
on line 118 I find this

Code: Select all

               :
I'm not that good in coding and to let this work like I want, so I'd really appreciate if you (or someone else) could help me further with this nice mod feature :D
Image
Check SuperNova Orange style on:
SchoolLife.nl
phpBB.com

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

Re: [DEV] RSS Input

Post by PoPoutdoor » Fri Dec 25, 2009 2:03 am

Oh! You got me wrong!

The

Code: Select all

                   :
lines is the original code blocks there!

You need some programming knowledge to get this work... I'm busy right now and don't have the time to test this too!

wolfk
Registered User
Posts: 12
Joined: Tue Dec 08, 2009 11:30 pm

Re: [DEV] RSS Input

Post by wolfk » Fri Dec 25, 2009 2:11 am

PoPoutdoor wrote:
wolfk wrote:I love the idea of this mod, and I think I'm close to getting it working, but I've run into an error with the RSS Import Settings when I try to import a feed.

After I hit submit I get a success, but when I go back to the RSS settings I get this error

[phpBB Debug] PHP Notice: in file /includes/acp/acp_find.php on line 423: Invalid argument supplied for foreach()
I haven't got any error about that part of code... can you reproduced this again?
I have reproduced it several times, with the same results :(

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

Re: [DEV] RSS Input

Post by PoPoutdoor » Fri Dec 25, 2009 2:18 am

wolfk, the "\r" may or may not related to your problem.

For now, only you got this error and I have no idea what's wrong in the code.
Read post #2 and got everything right first! If you still got this error, post settings related to this mod and the php version.

Locked

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