Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

disqus 10. how to add comment counts to theme - tested on magazine02 theme by Fizi #10

Open
Jimmi08 opened this issue Sep 23, 2020 · 0 comments
Labels
documentation Improvements or additions to documentation plugin: disqus

Comments

@Jimmi08
Copy link
Member

Jimmi08 commented Sep 23, 2020

1. check what shortcodes are used in your theme

  • go to templates, news and check all news templates
    It looks as it is only used:
    {NEWS_COMMENT_COUNT}
    (sometimes some can have parameters)

if you change comment system, it depends on the theme what is displayed: (in fact, that icon should be hidden and wrapper functionality used)

image

Simply way: replace it with {DISQUS_NEWSCOMMENTCOUNT}

2. find this shortcode in news_shortcodes (core)

  • look for sc_news_comment_count
    you will see that in fact different shortcode is loaded.
	function sc_newscommentcount($parm=null)
	{
		if($this->commentsDisabled || ($this->commentsEngine != 'e107'))
		{
			return null;
		}
		
		$text = varset($parm['glyph']) ? e107::getParser()->toGlyph($parm['glyph']) : "";
		$text .=  $this->news_item['news_comment_total'];
		return $text;
	}

3. open theme_shortcodes.php file in your theme

  • add override direction:
class theme_shortcodes extends e_shortcode {
  var $override = true;
  • add the same shortcode there (the same name as in the template)
    something like this, just to check if it works.
   function sc_news_comment_count() {
     return 'hello';
   }

It works :)

image

@Jimmi08 Jimmi08 added documentation Improvements or additions to documentation plugin: disqus labels Sep 23, 2020
@Jimmi08 Jimmi08 changed the title disqus how to add comment counts to theme - tested on magazine02 theme by Fizi disqus 10. how to add comment counts to theme - tested on magazine02 theme by Fizi Sep 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation plugin: disqus
Projects
None yet
Development

No branches or pull requests

1 participant