General Community > Scripting Help
auto-move postings
(1/1)
emwe:
Hello,
I'm looking for some code to move automatically postings from one board to another except for sticky posts for SMF 2.0.2. I already found some code here: http://www.simplemachines.org/community/index.php?topic=264892.0 and applied it. It works fine but moves every posting. I tried to modify it like
--- Code: ---if (isset($topicOptions['id']))
$topic = $topicOptions['id'];
if($board == 'ID_BOARD_IN' && !$topic['is_sticky')
{
require_once($sourcedir . '/MoveTopic.php');
moveTopics($topic, 'ID_BOARD_TO');
}
--- End code ---
but it did not work.
I have no knowledge in programming with PHP so every help is welcome.
Yoshi:
Heya,
--- Code: ---if (isset($topicOptions['id']))
$topic = $topicOptions['id'];
if($board == 'ID_BOARD_IN' && !$topic['is_sticky'])
{
require_once($sourcedir . '/MoveTopic.php');
moveTopics($topic, 'ID_BOARD_TO');
}
--- End code ---
Try that code, as your version would've caused a Parse Error :)
What exactly doesn't work, with this code, though? Just the error?
(I'm assuming you replaced ID_BOARD_IN and ID_BOARD_TO with the board IDs)
emwe:
Hi,
I'm sorry this was a misspelling, I had the code as you provided and I replaced the Board-IDs with the real IDs I got from the database (2 and 4 in my case). The problem is, when I create a new post and select under Attachments and Options "Sticky this topic" it is still moved to the other board when posting it. I want only not sticky posts moved.
In other words, when a new post is created and the sticky flag not set when posting it, it should be moved to the other board, when the sticky flag is selected when posting it it should remain in the original board.
Navigation
[0] Message Index
Go to full version