简体   繁体   中英

show view count on rss feed in drupal

i have a drupal site and i want to add to the RSS feed a view count

what that i found that should do this is this code but so far i get a null value

<?php print $node->links['statistics_counter']['title']; ?>

and i can't run any SQL query because i can't match the nodes for it.

i also tried to do:

print_r($node->links['statistics_counter']);

and also i get an empty array

any help is appreciated

This should work: <?php print $node->links['statistics_counter']['title']; ?> <?php print $node->links['statistics_counter']['title']; ?> . Be sure that you print it in teaser mode, not in full view ( $page == 1 ).
If not, visit http://YOURSITE/admin/reports/settings and enable access log.
ps Also Views module provide more powerfull feed page with any data and filters.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM