Guide Category

134

Displays info in the comments

In this tutorial we will show you how to display the forum statistics in main DLE comment page which will display in comment page and full article page within comment for each user when they add comment to your site you will see how many topics and replies the user had posted in your BE Forum, it will also display the statistics in last comment page
dlestarter
Displays info in the comments In this tutorial we will show you how to display the forum statistics in main DLE comment page which will display in comment page and full article page within comment for each user when they add comment to your site you will see how many topics and replies the user had posted in your BE Forum, it will also display the statistics in last comment page

Open File: engine/ajax/addcomments.php

Find:

foto, fullname, land,

REPLACE with:

foto, fullname, land, forum_topic_count, forum_post_count, forum_thanks_count, forum_warning, forum_inseption,
Repeat this step for the following files:
  • engine/ajax/comments.php
  • engine/modules/show.full.php
  • engine/modules/lastcomments.php
Open file: engine/classes/comments.class.php

Find:

global $config, $tpl, $is_logged

REPLACE with:

global $apiBullet, $config, $tpl, $is_logged

In the next line add:

if(!$apiBullet) {
      require_once ENGINE_DIR . '/bullet_energy/api/bullet_api.class.php' ;
}

Find:

$tpl->set('{group-name}', $user_group[$row['user_group']]['group_prefix'] . $user_group[$row['user_group']]['group_name'] . $user_group[$row['user_group']]['group_suffix']) ;

Add AFTER:

        $row['forum_inseption'] = unserialize($row['forum_inseption']) ;
        $tpl->set('{countTopic}', $row['forum_topic_count']) ;
        if($row['forum_topic_count'] > 0) {
          $tpl->set('[linckTopic]', '<a href="' . $apiBullet->link->userTopic($row['name']) . '">') ;
          $tpl->set('[/linckTopic]', '</a>') ;
        } else {
          $tpl->set('[linckTopic]', '') ;
          $tpl->set('[/linckTopic]', '') ;
        }
        $tpl->set('{countMessage}', $row['forum_post_count']) ;
        if($row['forum_post_count'] > 0) {
          $tpl->set('[linckPost]', '<a href="' . $apiBullet->link->userMessage($row['name']) . '">') ;
          $tpl->set('[/linckPost]', '</a>') ;
        } else {
          $tpl->set('[linckPost]', '') ;
          $tpl->set('[/linckPost]', '') ;
        }
        $tpl->set('{like}', $row['forum_thanks_count']) ;
        if($row['forum_thanks_count'] > 0) {
          $tpl->set('[linckLike]', '<a href="' . $apiBullet->link->userLike($row['name']) . '">') ;
          $tpl->set('[/linckLike]', '</a>') ;
        } else {
          $tpl->set('[linckLike]', '') ;
          $tpl->set('[/linckLike]', '') ;
        }
        $trophies = count($row['forum_inseption']['honor']) ;
        $tpl->set('{countTrophies}', $trophies) ;
        if($trophies > 0) {
          $tpl->set('[linckTrophies]', $apiBullet->link->userTrophies($row['name'], 0, false, '')) ;
          $tpl->set('[/linckTrophies]', '</a>') ;
        } else {
          $tpl->set('[linckTrophies]', '') ;
          $tpl->set('[/linckTrophies]', '') ;
        }
        if($row['forum_inseption']['title'] and $apiBullet->cache['title'][$row['forum_inseption']['title']]['title']) {
          $tpl->set_block("'\\[titleForum\\](.*?)\\[/titleForum\\]'si", "\\1") ;
          $tpl->set('{titleForum}', $apiBullet->cache['title'][$row['forum_inseption']['title']]['title']) ;
        } else {
          $tpl->set_block("'\\[titleForum\\](.*?)\\[/titleForum\\]'si", "") ;
          $tpl->set('{titleForum}', '') ;
        }
in templates/YOUR THEME/comments.tpl, use the following tags:
  • [linckTopic]ХХХ[/linckTopic] - The text inside these tags will be used as link to the topic if user have any topic posted, it will not show if no topic posted.
  • {countTopic} - Number of topics on the forum.
  • [linckPost]ХХХ[/linckPost] - The text inside these tags will be used as link to the replied messages, if they are greater than zero.
  • {countMessage} - Number of replies.
  • [linckTrophies]ХХХ[/linckTrophies] - The text inside these tags will be awarded trophies as link to the user if they are greater than zero.
  • {countTrophies} - The number of member trophies.
  • [linckLike]XXX[/linckLike] The text inside these tags will be concluded link to the history of the user's "Like", if greater than zero.
  • {like} - Number of "like" from the user.
  • [titleForum]XXX[/titleForum] - The text inside these tags will be displayed if the user has a forum title.
  • {titleForum} - The title of member.

Related Tutorials

Review/Leave Comment

comments powered by Disqus