Dividing the view_count_one result
Posted: 21 July 2008 02:09 PM   [ Ignore ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  424
Joined  04-02-2007

We’re trying to get a rough guess on the number of times a particular entry has been viewed.  Normally the {view_count_one} would work perfectly for this but in my case the count is increasing by 3 instead of 1.  Research tells me it has something to do with embedded javascript or something.  The thing is is that we don’t need an exact count, just something close so I thought if I could just get the count to divide by three I’d be golden.  I’ve got PHP enabled and set to input.  I tried:

<?php
  $num_view
= {view_count_one} / 3;
?>

Article viewed <?php
echo $num_view ?> times.

but I get an unexpected curly bracket error.  Is there an easy way to achieve what I’m aiming for?

Profile
 
 
Posted: 22 July 2008 09:37 AM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  424
Joined  04-02-2007

Anyone?

Profile
 
 
Posted: 22 July 2008 03:22 PM   [ Ignore ]   [ # 2 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  29019
Joined  05-15-2004

Are you parsing PHP on Input? That should work, in principle.

 Signature 

ExpressionEngine 2.0 Downloads | Docs | Bugtracker

“If the English language made any sense, lackadaisical would have something to do with a shortage of flowers.” (Doug Larson)

Profile
MSG
 
 
Posted: 22 July 2008 03:38 PM   [ Ignore ]   [ # 3 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  424
Joined  04-02-2007

Yes, I am.

Profile
 
 
Posted: 22 July 2008 03:42 PM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  29019
Joined  05-15-2004

Obviously, you need to run PHP on Output in this case.

 Signature 

ExpressionEngine 2.0 Downloads | Docs | Bugtracker

“If the English language made any sense, lackadaisical would have something to do with a shortage of flowers.” (Doug Larson)

Profile
MSG
 
 
Posted: 22 July 2008 03:59 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  424
Joined  04-02-2007

Yep, that worked.  I didn’t think it’d be something so simple.  Thanks Ingmar!

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1743, on December 02, 2009 02:47 PM
Total Registered Members: 119675 Total Logged-in Users: 72
Total Topics: 125877 Total Anonymous Users: 29
Total Replies: 662335 Total Guests: 377
Total Posts: 788212    
Members ( View Memberlist )
Newest Members:  Ricardo Yesurllesspatrick11cJan Peetersdeloplldfcxxffdavouidwowgreendaniellakimbris