Jump to content

Show Ratings In Topic Listings


Nuclear General

Recommended Posts

%7Boption%7D



File Name: Show Ratings In Topic Listings

File Submitter: Nuclear General

File Submitted: 20 Jun 2012

File Category: Content Management



This is a Simple Free Hook, To Install, simply visit your Admin Control Panel->System->Manage Hooks Page.
In The Install Hook popup Prompt, Click open and install this file.
This simple hook will show microdata enhanced ratings in forum listings of forums that allow ratings.
As such no settings, or configuration(beyond stock forums configuration) is included with this hook.



here to download this file

Link to comment
Share on other sites

  • 6 months later...
  • 7 months later...

I just threw up a test board locally, and it does.

hello marcher, you help me to explain how this follow code work?

<span itemprop="ratingValue" class="hide">'.((intval($v['data']['topic_rating_hits'] )>0)?round($v['data']['topic_rating_total']/$v['data']['topic_rating_total']):$v['data']['topic_rating_total']).'</span>

it must be...??

<span itemprop="

ratingValue

" class="hide">'.((intval($v['data']['topic_rating_hits'] )>0)?round($v['data']['topic_rating_total']/

$v['data']['topic_rating_hits']

):$v['data']['topic_rating_total']).'</span>

otherwise result is only 1 or 0 ... please help :tongue:

result with hits = 2 and total = 8 (3+5) for topic id = 5

<span class="topicRatings" itemtype="http://schema.org/AggregateRating" itemscope="" itemprop="aggregateRating">
<span class="hide" itemprop="ratingValue">1</span>
<span class="hide" itemprop="ratingCount">2</span>
<span class="mini_rate">
		<img class="mini_rate" alt="*" src="		' alt='' class='ipsImage'  >' alt='' class='ipsImage'  >' alt='' class='ipsImage'  >">
		<img class="mini_rate" alt="*" src="		' alt='' class='ipsImage'  >' alt='' class='ipsImage'  >' alt='' class='ipsImage'  >">
		<img class="mini_rate" alt="*" src="		' alt='' class='ipsImage'  >' alt='' class='ipsImage'  >' alt='' class='ipsImage'  >">
		<img class="mini_rate" alt="*" src="		' alt='' class='ipsImage'  >' alt='' class='ipsImage'  >' alt='' class='ipsImage'  >">
		<img class="mini_rate" alt="-" src="		">
</span>
</span>

i am developing a similar hook but it contain followers counter into topic listings...

Link to comment
Share on other sites

  • 9 months later...

Hiya Nuclear,

Hope your job is going well for you, if you become active again, please take a look at this when possible:
http://community.invisionpower.com/resources/bugs.html/_/ip-board/also-tagged-with-shouldnt-generate-aggregaterating-schemas-r44983

The bug report impacts this hook as well for the same reason. Google doesn't want to see Microdata used this way. For your convenience, the easy fix to this is to just remove the microdata from the string altogether,

                                        /* Start swapping it out */
                                        $string = '<span class="topicRatings">'.$this->registry->output->getTemplate('forum')->topic_rating_image( (intval($v['data']['topic_rating_hits'] )>0)?round($v['data']['topic_rating_total']/$v['data']['topic_rating_hits']):$v['data']['topic_rating_total'] ).'</span>';


Also, there's a bug with this hook where if you move a topic in a forum and leave a link to it, it will throw off all the rankings after that topic on the page.

Thanks for your time,
Kirito

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...