CMS MADE SIMPLE FORGE

Statistics

 

[#2784] per page(url) pageviews

avatar
Created By: Jeremy Bass (jeremybass)
Date Submitted: 2008-12-21 01:10

Assigned To:
Resolution: None
State: Open
Summary:
per page(url) pageviews
Detailed Description:
Love what you did by adding the statistic output... 

but I'd be handy to have pageviews be total number of page-viewings for that
page..

My2Cents.. 

History

Comments
avatar
Date: 2008-12-26 10:40
Posted By: Morten Poulsen (silmarillion)

Hmm, easy to do...  just did a new "what"-option, thispageviews which should
return the number of viewings of the current page, please test and close if it
works!
      
avatar
Date: 2009-01-10 16:00
Posted By: Morten Poulsen (silmarillion)

in 0.9.1
      
avatar
Date: 2009-01-10 17:40
Posted By: Jeremy Bass (jeremybass)

that was odd.. I just got the email for your post that you made that change...
and then that you close it... but it says here that you posted that on the 26th
of last month.... Do you still need it tested... I assume not since it's in
.9.1??


I all so assume that was an error in the system... ???

Keep up the good work... 
cheers
jeremyBass

      
avatar
Date: 2009-01-10 18:41
Posted By: Jeremy Bass (jeremybass)

Ok.. I have test... Have not looked but I assume that this is read by page
alias? That would not work for most things as I see it. So there should be a
"url" type option in conjunction... IMHO

ex:
http://www.corbensproducts.com/Blogs/6/51/emailprotect.html

is on page alias "Blogs"

so when I put 
<h5>This Has {Statistics what='thispageviews'} Views</h5>

in the showentry temp of the blog mod

I got the views of page alias "Blogs" (I think) as every entry had the same 

so when I put the...

Hope that was clear... Have a great day
jeremyBass

      
avatar
Date: 2009-01-10 19:08
Posted By: Jeremy Bass (jeremybass)

Ok... for what it's worth.... 

replacing 

$this->cms->variables["pageinfo"]->content_alias

in Statistics.module.php

with

$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']

does seem to work... I think... still testing but... 


may-be an option to track by URL or alise would work good..... like 


      case "thispageviewsURL" : {

return
$this->GetValue("count_access_page",$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF'],0);

			}
      case "thispageviewsALIAS" : {

return
$this->GetValue("count_access_page",$this->cms->variables["pageinfo"]->content_alias,0);

			}



cheers
jeremyBass


      
avatar
Date: 2009-01-10 19:46
Posted By: Jeremy Bass (jeremybass)

so better then 

$_SERVER['SERVER_NAME'].$_SERVER['PHP_SELF']

would be

	$urlBASE = "http://".$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
if (!empty($_SERVER["QUERY_STRING"]))
   $urlBASE .= "?".$_SERVER['QUERY_STRING'];

$url = str_replace("index.php?page=", "", $urlBASE);


the is for the pretty urls... works good... 

cheers
jeremyBass
      
avatar
Date: 2009-01-11 00:48
Posted By: Jeremy Bass (jeremybass)

ok... I've tested it out for a bit... seems to work well ... 

you can veiw it in action here... 

http://www.corbensproducts.com/Blogs/5/51/http-to-https.html



and the other thing is on that page it's double called so kodos that work... 

you can see the nuber on every page you go to if you to to this in the right top
corner

Layout: #14-TP5G0 A4 

TP# it the  {Statistics what='thispageviewsURL'}

anyways... I think this is more on what I was thinking... or at the least it
accounts for the other mods at live on one alias...

cheers
jeremy
      
avatar
Date: 2009-01-11 01:04
Posted By: Jeremy Bass (jeremybass)

Oh thought... it'd be way cool if you could pass a pram back optionaly for url
too...  I know there is the alias version already...

just a thought so it's work in blogs/news and such

cheers
jeremyBass
      
avatar
Date: 2009-01-12 22:35
Posted By: Jeremy Bass (jeremybass)

Ok... I have tested and tested... What is there in the svn is set so that it's
counting the total number of url views... meaning it is not giving a page by
page break down only the total nuber of views of all the urls as the
thispageviews does...

When I made that change what I did was basicly took the thispageviews and took

return
$this->GetValue("count_access_page",$this->cms->variables["pageinfo"]->content_alias,0);


and replace 

$this->cms->variables["pageinfo"]->content_alias

with the $url

``or now the $this->GetCurrentUrl()``

so I would assume mirroring the url part would bewhat is needed... ??? not to
sure, I would think the case would be like this

      case "thisurlviews" : {
				return $this->GetValue("count_access_url",$this->GetCurrentUrl(),0);
			}


also if it helps... I made my edits to were ever count_access_page was... 

if
$this->cms->variables["pageinfo"]->content_alias 

was there I replaced it with $url... Let me know if that is clear... I'm not
sure if I explained that well...

cheers
jeremyBass
      
avatar
Date: 2009-04-19 20:28
Posted By: Jeremy Bass (jeremybass)

renamed for clarity 
      
avatar
Date: 2010-03-27 19:31
Posted By: Morten Poulsen (silmarillion)

I think we'll have to rethink this... I did many things since last post here...
could you please recheck if it still does not do what you want and suggest a fix
if you have the time?

sil.
      
avatar
Date: 2012-03-14 00:03
Posted By: Lee Peace (angelpeace)

Thanks so much with

 case "thisurlviews" : {
				return $this->GetValue("count_access_url",$this->GetCurrentUrl(),0);
			}

      
Updates

Updated: 2009-04-19 20:28
summary: pageviews => per page(url) pageviews
resolution_id: => 5

Updated: 2009-01-12 04:42
state: Closed => Open

Updated: 2009-01-10 16:01
state: Open => Closed