• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

resource view counter

Jeremy

Well-known member
#4
To which page? The individual resource page?

I'm also not sure that XenForo tracks views on resources, so you would most likely need to develop an add-on to accomplish this.
 
#5
index page where resource title in left side and downloads and votes in right side ...i want to add view has gotten by each resource after downloads ....and resource categories can be selected by left column........on resource list page
 

Jeremy

Well-known member
#6
Just verified, the Resource Manager does not track views of an individual resource. You would need a custom add-on developed to track the views.
 

Jeremy

Well-known member
#8
I suggest looking at how XenForo tracks thread views. Implementing this will take a decent add-on a bit of work to accomplish. The "notes" you so wish me to send do not exist.
 
#10
i am creating a add on to count resource view for that i have create addon from ACP also create a folder in library (view counter) in this i put Listener.php and also create a template for views but i want to put the output of this template in resource_list_item template
in following code


<div class="listBlock resourceStats">
<div class="listBlockInner">
<xen:include template="rating">
<xen:set var="$rating">{$resource.rating_avg}</xen:set>
<xen:set var="$hint">{xen:if '{$resource.rating_count} == 1', {xen:phrase 1_vote}, {xen:phrase x_votes_plural, 'count={$resource.rating_count}'}}</xen:set>
</xen:include>
<div class="pairsJustified">
<xen:if is="!{$resource.is_fileless}"><dl><dt>{xen:phrase downloads}:</dt> <dd>{xen:number $resource.download_count}</dd></dl></xen:if>
<dl><dt>{xen:phrase updated}:</dt> <dd><a href="{xen:link resources/updates, $resource}" class="concealed"><xen:datetime time="{$resource.last_update}" /></a></dd></dl>
</div>
</div>
</div>

to put its output in this template its hook is require....how i will find hook and what code i have to put in Listener.php
 
#11
i create a add on to to show number of view a resource has gotten it show text view where i want ....but how to show number of views a resource has gotten my listener.php code is
<?php
class viewcounter_Listener
{
//Our callback signature! We are using here! Look:
public static function template_hook1($hookName, &$contents, array $hookParams, XenForo_Template_Abstract $template)
{
//Yey! its our template hook!
if ($hookName == 'page_container_head123')
{
//Our tab! We will do somethin better, hang on.
$contents .= 'view';
}
}
}
?>
i want to show number of views with this text for that do i have to create column in xf_resource table and how i will insert in it and how to fetch this ...please reply
 
Last edited:
#12
to show with resources number of view a resource has gotten i have created an add on ........
i want to add a column in database table to handle views ....when someone click on resource to view i want to update view column for that view resource id and want to fetch view value for each id ...how can i do it..for resources i have model resources.php...please help
 
#13
i want to add a column for views a resource has gotten in my xf_resources table.... how can i do it ...can i add direct to table ...and how can i fetch its value for each resource shown on my page...or template resource_index ...or i have to change in model..please reply