Unofficial SMF API Documentation

./Sources/SplitTopics.php

SplitTopics

function SplitTopics(): void

splits a topic into two topics.

delegates to the other functions (based on the URL parameter ‘sa’). loads the SplitTopics template. requires the split_any permission. is accessed with ?action=splittopics.

SplitIndex

function SplitIndex(): void

screen shown before the actual split.

is accessed with ?action=splittopics;sa=index. default sub action for ?action=splittopics. uses ‘ask’ sub template of the SplitTopics template. redirects to SplitSelectTopics if the message given turns out to be the first message of a topic. shows the user three ways to split the current topic.

SplitExecute

function SplitExecute(): void

do the actual split.

is accessed with ?action=splittopics;sa=execute. uses the main SplitTopics template. supports three ways of splitting: (1) only one message is split off. (2) all messages after and including a given message are split off. (3) select topics to split (redirects to SplitSelectTopics()). uses splitTopic function to do the actual splitting.

SplitSelectTopics

function SplitSelectTopics(): void

allows the user to select the messages to be split.

is accessed with ?action=splittopics;sa=selectTopics. uses ‘select’ sub template of the SplitTopics template or (for XMLhttp) the ‘split’ sub template of the Xml template. supports XMLhttp for adding/removing a message to the selection. uses a session variable to store the selected topics. shows two independent page indexes for both the selected and not-selected messages (;topic=1.x;start2=y).

SplitSelectionExecute

function SplitSelectionExecute(): void

do the actual split of a selection of topics.

is accessed with ?action=splittopics;sa=splitSelection. uses the main SplitTopics template. uses splitTopic function to do the actual splitting.

splitTopic

function splitTopic(int $split1_ID_TOPIC, array $splitMessages, string $new_subject): int

general function to split off a topic.

creates a new topic and moves the messages with the IDs in array messagesToBeSplit to the new topic. the subject of the newly created topic is set to ‘newSubject’. marks the newly created message as read for the user splitting it. updates the statistics to reflect a newly created topic. logs the action in the moderation log. a notification is sent to all users monitoring this topic.

Type Parameter Description
int $split1_ID_TOPIC The ID of the topic we’re splitting
array $splitMessages The IDs of the messages being split
string $new_subject The subject of the new topic
Integration hooks
integrate_split_topic

MergeTopics

function MergeTopics(): void

merges two or more topics into one topic.

delegates to the other functions (based on the URL parameter sa). loads the SplitTopics template. requires the merge_any permission. is accessed with ?action=mergetopics.

MergeIndex

function MergeIndex(): void

allows to pick a topic to merge the current topic with.

is accessed with ?action=mergetopics;sa=index default sub action for ?action=mergetopics. uses ‘merge’ sub template of the MoveTopic template. allows to set a different target board.

MergeExecute

function MergeExecute(array $topics = array()): void

set merge options and do the actual merge of two or more topics.

the merge options screen:

the actual merge:

Type Parameter Description
array $topics The IDs of the topics to merge
Integration hooks
integrate_merge_topic

MergeDone

function MergeDone(): void

Shows a ‘merge completed’ screen.

is accessed with ?action=mergetopics;sa=done. uses ‘merge_done’ sub template of the SplitTopics template.

Suggest an edit to this page on GitHub