Clarifiction about function

Started by Jotade29, April 20, 2024, 07:57:41 PM

Previous topic - Next topic


V: 2.0.19

Hello, i want a clarification about two functions of removetopic.php.

These are RemoveTopic2 (which i think is the one called when deleting a topic with the moderation button in topics), and the removeTopics function, which I don't know in what cases it is used. The notes that this function has are: ("// Removes the passed id_topic's. (permissions are NOT checked here!)")

I thought that the function to delete topics was only one, but checking i found these two, and i need to know where removeTopics() is used

Thank you!!
Quote from: Diego Andrés on August 12, 2023, 02:20:18 AMI'm afraid convincing Jotade to upgrade to SMF 2.1 will require bigger effort than your work sanitizing Unicode characters  :laugh:

Diego Andrés

RemoveTopic2 finds the information about the topic and it's only ever called directly using a URL to the action. It's essentially just a 'helper' function for deleting an individual topic because the URL is always exposed (?action=removetopic2;topic=x). So if you wanted to remove a single topic, you'd just use that URL and be done with it.

removeTopics actually removes the topics, it assumes you already checked what needs to be checked like permissions, the topic existing, etc. Can be useful if you have a list of topics, you check the topics are real, etc and send the array to the function.

SMF Tricks - Free & Premium Responsive Themes for SMF.