Answer the question
In order to leave comments, you need to log in
How to prevent publication of news without selecting a category on DLE?
Hello.
Any DLE experts here?
Help solve the problem.
I have a module on dle, which itself publishes news on the site, you can say Bot. It happens that sometimes this bot publishes news without categories, i.e. does not select any of the categories. How can you prevent such news from being published?
I googled and found this - https://dle-faq.ru/faq/phpquest/755-zapret-publika...
There are two ways to prohibit adding news without selecting categories, but these two methods work when adding news manually, i.e. e. a human, but for some reason they don’t work on a bot, it still publishes news. How else can you disable posts on dle without selecting categories?
Answer the question
In order to leave comments, you need to log in
Do you need to correct the module engne/modules/addnews.php
Or do you need a ready-made code?
UPD: Something like this, but did not check:
In the file:
Find:
Add above:
if (count($category_list) < 1){
$stop .= "<li>Не выбрано ни одной категории</li>";
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question