The related v0.2 posting code in functions_find: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?
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';
PoPoutdoor wrote:plasmino,
Seems you doesn't follow the upgrade instructions... have you copy the language files?
PoPoutdoor wrote:The related v0.2 posting code in functions_find: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?
I'm not sure what you means...if you said post to new topic on every feed import, you could changed toCode: 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';
$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.
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...
I haven't got any error about that part of code... can you reproduced this again?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()
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);
}
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);
}
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.
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.
Change to something like thisCode: 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); }
I haven't test this, but will works as you liked to be. Be prepared for errors and track the variables inside the loop!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); }
Post your working code back and I can put this in the mod file in next update.
Code: Select all
Parse error: syntax error, unexpected ':' in /var/www/vhosts/schoollife.nl/subdomains/test/httpdocs/includes/functions_find.php on line 118
Code: Select all
:
Code: Select all
:
I have reproduced it several times, with the same resultsPoPoutdoor wrote:I haven't got any error about that part of code... can you reproduced this again?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()