[TH] Trending [Deleted]

ThemeHouse updated [TH] Trending with a new update entry:

Version 1.0.3 released

Important! This add-on no longer supports XenForo 2.0. Please upgrade to XenForo 2.1 first, before updating to this version.

Enhancements:
  • Added more filters within Trending configuration for all three trending types.
  • Added more trending options for threads, resources, and media trending types.
  • Added scoring which allows you to see the position change in thread popularity.
  • Added mark read...

Read the rest of this update entry...
 
I just installed XFMG and i tried to upload a test image and got this error ._.

015.webp

Server error log
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'thtrending_positive_rating_count' in 'field list'
src/XF/Db/AbstractStatement.php:217

Code:
Stack trace
INSERT  INTO `xf_mg_media_item` (`media_hash`, `media_type`, `user_id`, `username`, `category_id`, `media_state`, `title`, `description`, `media_date`, `exif_data`, `rating_weighted`, `rating_avg`, `media_id`, `last_edit_date`, `album_id`, `ip_id`, `view_count`, `watermarked`, `custom_fields`, `warning_id`, `warning_message`, `position`, `imported`, `thumbnail_date`, `custom_thumbnail_date`, `tags`, `last_comment_date`, `last_comment_id`, `last_comment_user_id`, `last_comment_username`, `rating_count`, `rating_sum`, `reaction_score`, `reactions`, `reaction_users`, `thtrending_positive_rating_count`, `thtrending_positive_ratings_views_per_minute`, `thtrending_positive_ratings_per_minute`, `thtrending_views_per_minute`, `thtrending_comments_per_minute`, `thtrending_positive_ratings_views_comments_per_minute`, `thtrending_positive_ratings_comments_per_minute`, `thtrending_comments_views_per_minute`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(221): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#5 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('xf_mg_media_ite...', Array, false)
#6 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#7 src/addons/XFMG/Service/Media/Creator.php(235): XF\Mvc\Entity\Entity->save()
#8 src/XF/Service/ValidateAndSavableTrait.php(40): XFMG\Service\Media\Creator->_save()
#9 src/addons/XFMG/Pub/Controller/Media.php(755): XFMG\Service\Media\Creator->save()
#10 src/XF/Mvc/Dispatcher.php(321): XFMG\Pub\Controller\Media->actionSaveMedia(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XFMG:Media', 'SaveMedia', Object(XF\Mvc\RouteMatch), Object(XFMG\Pub\Controller\Media), NULL)
#12 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XFMG\Pub\Controller\Media), NULL)
#13 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#15 src/XF.php(390): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}

Code:
Request state
array(4) {
  ["url"] => string(17) "/media/save-media"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/media/save-media"] => string(0) ""
  }
  ["_POST"] => array(8) {
    ["attachment_hash"] => string(32) "ea4d5cc001790972df71ff072ca5923b"
    ["attachment_hash_combined"] => string(91) "{"type":"xfmg_media","context":{"category_id":2},"hash":"ea4d5cc001790972df71ff072ca5923b"}"
    ["media"] => array(1) {
      [1] => array(7) {
        ["title"] => string(15) "reputation test"
        ["description"] => string(10) "test image"
        ["tags"] => string(0) ""
        ["temp_media_id"] => string(1) "1"
        ["media_hash"] => string(32) "e46921d18fde8fc470a5166853ce0779"
        ["media_type"] => string(5) "image"
        ["attachment_id"] => string(6) "289444"
      }
    }
    ["category_id"] => string(1) "2"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(31) "/media/categories/fan-art.2/add"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
I just installed XFMG and i tried to upload a test image and got this error ._.

View attachment 201001

Server error log
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'thtrending_positive_rating_count' in 'field list'
src/XF/Db/AbstractStatement.php:217

Code:
Stack trace
INSERT  INTO `xf_mg_media_item` (`media_hash`, `media_type`, `user_id`, `username`, `category_id`, `media_state`, `title`, `description`, `media_date`, `exif_data`, `rating_weighted`, `rating_avg`, `media_id`, `last_edit_date`, `album_id`, `ip_id`, `view_count`, `watermarked`, `custom_fields`, `warning_id`, `warning_message`, `position`, `imported`, `thumbnail_date`, `custom_thumbnail_date`, `tags`, `last_comment_date`, `last_comment_id`, `last_comment_user_id`, `last_comment_username`, `rating_count`, `rating_sum`, `reaction_score`, `reactions`, `reaction_users`, `thtrending_positive_rating_count`, `thtrending_positive_ratings_views_per_minute`, `thtrending_positive_ratings_per_minute`, `thtrending_views_per_minute`, `thtrending_comments_per_minute`, `thtrending_positive_ratings_views_comments_per_minute`, `thtrending_positive_ratings_comments_per_minute`, `thtrending_comments_views_per_minute`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(221): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#5 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('xf_mg_media_ite...', Array, false)
#6 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#7 src/addons/XFMG/Service/Media/Creator.php(235): XF\Mvc\Entity\Entity->save()
#8 src/XF/Service/ValidateAndSavableTrait.php(40): XFMG\Service\Media\Creator->_save()
#9 src/addons/XFMG/Pub/Controller/Media.php(755): XFMG\Service\Media\Creator->save()
#10 src/XF/Mvc/Dispatcher.php(321): XFMG\Pub\Controller\Media->actionSaveMedia(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(248): XF\Mvc\Dispatcher->dispatchClass('XFMG:Media', 'SaveMedia', Object(XF\Mvc\RouteMatch), Object(XFMG\Pub\Controller\Media), NULL)
#12 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(XFMG\Pub\Controller\Media), NULL)
#13 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#15 src/XF.php(390): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}

Code:
Request state
array(4) {
  ["url"] => string(17) "/media/save-media"
  ["referrer"] => bool(false)
  ["_GET"] => array(1) {
    ["/media/save-media"] => string(0) ""
  }
  ["_POST"] => array(8) {
    ["attachment_hash"] => string(32) "ea4d5cc001790972df71ff072ca5923b"
    ["attachment_hash_combined"] => string(91) "{"type":"xfmg_media","context":{"category_id":2},"hash":"ea4d5cc001790972df71ff072ca5923b"}"
    ["media"] => array(1) {
      [1] => array(7) {
        ["title"] => string(15) "reputation test"
        ["description"] => string(10) "test image"
        ["tags"] => string(0) ""
        ["temp_media_id"] => string(1) "1"
        ["media_hash"] => string(32) "e46921d18fde8fc470a5166853ce0779"
        ["media_type"] => string(5) "image"
        ["attachment_id"] => string(6) "289444"
      }
    }
    ["category_id"] => string(1) "2"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(31) "/media/categories/fan-art.2/add"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
Try to disable and re-enable Trending to see if this resolves the error you are experiencing. If not go ahead and create a ticket on our support portal.
 
I just purchased this addon for one purpose, that was to use it as a widget which would be displayed on a home page portal. I want a list, with a short summary, of trending threads.

However, after getting it setup, I've found a limitation with the widget settings.

I assumed it would have similar settings to this:

widget.jpg

The reason I needed these settings is because I don't want a regular thread view, but an expanded view like a RSS feed or blog summary type of listing, similar to the popular posts widget.

This is really important for my design and plans for the portal page.

Is this a planned feature for this addon, or can someone advise me how to achieve something similar?

The reason I just don't purchase XenpPorta is because I don't like the layout of how posts are displayed, and it doesn't have the same trending capability as this addon, plus it requires someone to manually promote posts, where I need it to be automatic.

Thanks!
 
What about determine trending by usergroup? I have a few "expert" usergroups that always post amazing threads.
 
I just purchased this addon for one purpose, that was to use it as a widget which would be displayed on a home page portal. I want a list, with a short summary, of trending threads.

However, after getting it setup, I've found a limitation with the widget settings.

I assumed it would have similar settings to this:

View attachment 203190

The reason I needed these settings is because I don't want a regular thread view, but an expanded view like a RSS feed or blog summary type of listing, similar to the popular posts widget.

This is really important for my design and plans for the portal page.

Is this a planned feature for this addon, or can someone advise me how to achieve something similar?

The reason I just don't purchase XenpPorta is because I don't like the layout of how posts are displayed, and it doesn't have the same trending capability as this addon, plus it requires someone to manually promote posts, where I need it to be automatic.

Thanks!
Good point, I'll go ahead and report this on our issue tracker.
What about determine trending by usergroup? I have a few "expert" usergroups that always post amazing threads.
This is an idea, I'll add it as a feature suggestion on our issue tracker.
 
Hello!

One quick question:

Can i customize the meta content inside a trending widget?

I did make one trending widget for trending news, but I'm getting the posts quantity and many are empty, because is not everybody that comments, they just read the news.

I would like to remove the thread starter and the posts quantity.

One screenshot just for showing the matter in highlighter:

205488
 
Hi, is it possible to configure a trending widget to get current node id to pick trending threads instead of using one configuration for each node where I want to put the widget?

For example, I want to have one "generic" widget that only appears on template forum_view at header, and it displays trending threads from this node.

Kind regards
 
9zMwKoH.png

missing phrase?
 
Last edited:
Hello-

I found a bug in Pub/Controller/Trending.php regarding prefix filters. This code assumes you have SV/MultiPrefix addon installed. There are are other places in your addon where you handle this correctly, so it appears to just be a small oversight.

Broken code:

Code:
        if ($prefixId = $this->filter('prefix_id', 'uint')) {
            $filters['prefix_id'] = [$prefixId];
        } else {
            $filters['prefix_id'] = $this->filter('prefix_id', 'array-uint');
        }

Fixed code (using what you have in Trending/Thread.php as reference):
Code:
        $addonCache = \XF::app()->container('addon.cache');
        if (isset($addonCache['SV/MultiPrefix'])) {
            if ($prefixId = $this->filter('prefix_id', 'uint')) {
                $filters['prefix_id'] = [$prefixId];
            } else {
                $filters['prefix_id'] = $this->filter('prefix_id', 'array-uint');
            }
        } else {
            $filters['prefix_id'] = $input['prefixId'];
        }

Otherwise, amazing addon!
 
Last edited:
Hello-

I found a bug in Pub/Controller/Trending.php regarding prefix filters. This code assumes you have SV/MultiPrefix addon installed. There are are other places in your addon where you handle this correctly, so it appears to just be a small oversight.

Broken code:

Code:
        if ($prefixId = $this->filter('prefix_id', 'uint')) {
            $filters['prefix_id'] = $prefixId;
        } else {
            $filters['prefix_id'] = $this->filter('prefix_id', 'array-uint');
        }

Fixed code (using what you have in Trending/Thread.php as reference):
Code:
        $addonCache = \XF::app()->container('addon.cache');
        if (isset($addonCache['SV/MultiPrefix'])) {
            if ($prefixId = $this->filter('prefix_id', 'uint')) {
                $filters['prefix_id'] = [$prefixId];
            } else {
                $filters['prefix_id'] = $this->filter('prefix_id', 'array-uint');
            }
        } else {
            $filters['prefix_id'] = $input['prefixId'];
        }

Otherwise, amazing addon!
Thank you so much for letting us know about this! I've gone ahead and added it to our issue tracker.
 
Top Bottom