using strotime to show the top viewed posts of the current week

butlercougar

New Member
I have a widget written in php that displays the most popular posts based on all time views. I'm use the following to create the list:\[code\] <?php echo $this->translate(array('%s view', '%s views', $item->view_count), $this->locale()->toNumber($item->view_count)) ?>\[/code\]I've attempted to edit my string using strotime to show the top viewed posts of the current week using the following:\[code\] <?php foreach(( $this->paginator as $item ), strtotime('this week')): ?>\[/code\]Which shows how many views each of the most popular posts have gotten this week, but I want to show total views and list only the top viewed posts of the week.The expression that outputs the top content is \[code\]<?php foreach( $this->paginator as $item ): ?>\[/code\]Which leads me to believe I need to incorporate strtotime in the above function, however... I have no real idea on how to write the expression as I am php noob and still learning... Can anyone help out with this?best,Mike
 
Back
Top