Answer the question
In order to leave comments, you need to log in
How to connect statistics tags to the main page in DLE?
There was a problem, I'm transferring the HTML template to the DLE engine, and I can't connect statistics tags.
I open the statistics file and put the {news-num} tag - it shows the total number of news. Let's say I have a total of 53 news. And I transfer this tag to main.tpl but the tag does not work. Although all news, headlines, comments and reviews are displayed, the tag does not work. As shown in the picture, I need to show the number 53 instead of the {news-num} tag. How can I implement this? help me please
Answer the question
In order to leave comments, you need to log in
For version 11.1
In /engine/modules/main.php after
(If the file is not there then look for the line in index.php)
add
$allcount = dle_cache('news_count');
if(empty($allcount)){
$allcount = $db->super_query("SELECT count(*) as c FROM ".PREFIX."_post WHERE approve");
$allcount = $allcount['c'];
create_cache('news_count',$allcount);
}
$tpl->set ( '{allcount}', $allcount );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question