Illegal websites should not initiate any form of manual service requests to our staff. It is strictly prohibited to use honmau Media's technical support services and products to engage in any illegal activities. If discovered, no technical support will be provided.×
Current location:home> news > help and support

discuz How to call the number of views and replies on the article list page tutorial

Many developers of the dz forum have found that they cannot access the reading and comment counts when creating the dz portal list page. Therefore, they need to modify the program source code separately to support this. Many people are asking and have written a tutorial specifically for everyone.

The specific location is:/source/module/portal/portal_list.php

Search code in portal_list.chp: (around 125 lines)

foreach($query as $value) {

$value['catname'] = $value['catid'] == $cat['catid'] ? $cat['catname'] : $_G['cache']['portalcategory'][$value['catid']]['catname'];

Add under it

'discuz如何在文章列表页调用查看数和回复数教程'

$article_count = C::t('portal_article_count')->fetch($value['aid']); 

if($article_count) $value = array_merge($article_count, $value); 

Call code in template:Comment count: $value [commentnum], View count: $value [viewnum]

© Website copyright and disclaimer

1.[honmau Media] independently owns the copyright of all materials on relevant pages of this website;

2. No one is allowed to copy it without the express written permission of [honmau Media];

3. The articles that do not indicate "honmau Media" on this website are all from the Internet and are only for everyone to learn and refer;

4. If there is any infringement/violation/irregularity, please contact customer service QQ or email to delete it, please understand;

5.[honmau Media] reserves the right to correct, modify and update this statement at any time.legal notice

Message Board
* Contact customer service for urgent issues
submitted
submission
Working days: 8:30 - 22:00 Online QQ

customer service

Company Introduction
top