diff --git a/include/class.topic.php b/include/class.topic.php index af160c303806ba917005a7e6570361fe2884035a..700072c13460540c2b967f2d9e184b4da67c156a 100644 --- a/include/class.topic.php +++ b/include/class.topic.php @@ -198,6 +198,10 @@ class Topic { } function delete() { + global $cfg; + + if ($this->getId() == $cfg->getDefaultTopicId()) + return false; $sql='DELETE FROM '.TOPIC_TABLE.' WHERE topic_id='.db_input($this->getId()).' LIMIT 1'; if(db_query($sql) && ($num=db_affected_rows())) { diff --git a/scp/helptopics.php b/scp/helptopics.php index 9262444a5da1ff5b1cfe658f506100f203dbdec8..b33cad9a5e79b77fae4adce850a6af88c36dc943 100644 --- a/scp/helptopics.php +++ b/scp/helptopics.php @@ -68,7 +68,8 @@ if($_POST){ break; case 'disable': $sql='UPDATE '.TOPIC_TABLE.' SET isactive=0 ' - .' WHERE topic_id IN ('.implode(',', db_input($_POST['ids'])).')'; + .' WHERE topic_id IN ('.implode(',', db_input($_POST['ids'])).')' + .' AND topic_id <> '.db_input($cfg->getDefaultTopicId()); if(db_query($sql) && ($num=db_affected_rows())) { if($num==$count) $msg = 'Selected help topics disabled';