T
T
Timur Fisenko2016-11-30 15:40:16
DLE
Timur Fisenko, 2016-11-30 15:40:16

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
578eebe146e54e83991d42085050ec3e.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Tutubalin, 2016-11-30
@nanupocuk

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 );

Now in the main.tpl template, the {allcount} tag will display the total number of news (except for those that are being moderated).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question