Popular Hashtags

Can anyone let me know how to automatically reset "Posts-Popular Hashtags" to only display hashtags for a 48 hour period? 

image_transcoder.php?o=bx_froala_image&h=2421&dpx=2&t=1573266836

  • 356
  • More
Replies (2)
    • Hello InPage !

      First of all, you need to add the column with the default timestamp value as our metatags tables don't have similar fields. See the ways how to do it here.

      This block uses the method getKeywordsCloud from the BxBaseMetatags class (the same file in template/script directory). Look on the following lines there:

      public function getKeywordsCloud($mixedSection, $iMaxCount, $bAsArray = false)

          {

              $aKeywords = $this->keywordsPopularList($iMaxCount);

      So you may redeclare this method and change the bold code for the child class in your template (it has the name BxTemplMetatags.php) like:

      $sQuery = $this->_oQuery->prepare("SELECT `keyword`, COUNT(*) as `count` FROM `{$this->_oQuery->_aObject['table_keywords']}` GROUP BY `keyword` WHERE {condition to to select the necessary time interval} ORDER BY `count` DESC LIMIT ?", $iLimit);

      $aKeywords = $this->_oQuery->getPairs($sQuery, 'keyword', 'count');

      • Thank you LeonidS 

        Login or Join to comment.