Search the Community
Showing results for tags 'counter'.
-
Hi Guys, I have seen some other threads that talk about this but nothing recent nor in line with what I need. I have basically created a page in which I am tracking the number of views. I update the counter which is tied to a field I added to the page's template that I am tracking. The field is hidden from the website admin and only used for this data. However, now I need to track it on a daily basis. I am thinking of keeping track of all time view total for 30 days and perhaps saving that and allowing the user to see the page views of last 7 days, each day as a number and then 30 days of data. This way if I want to build in reporting functionality I can. What I need help with adding a date to the page_views field but also, knowing how many page_views for today, yesterday, day before etc. Here is what I have so far and its working. Now I need to associate a date with every day. NOT every update of the page_views field. if (!$user->hasRole('superuser')) { $page->page_views += 1; $page->of(false); $page->save('page_views'); $page->of(true); } echo $page->page_views; Any guidance, help, suggestions is absolutely appreciated. Thanks!!!!
-
What i wanna achive is a simple counter like that count up on visit (this is no problem) AND save the specific date (year/month/day) of the count... in the end i will be able to get visits per day/per month/per year in a nice and dirty graph. Just to have a way better simple counter system. Should i only go with a complex setup of pages like this: --stats (home template for pageviews) ----2018 (year) ------08 (month) ---------29 ->page_views (integers on every day template) ---------30 ->page_views Or just simple use: --stats (home template for pageviews) ---->count (template) that holds simple field page_views and a date field or could a fieldtype like tables (one table field for every month/year or so) be also a solution? Or a own SQL table special for this and use it in a module? I don't have any experience on this topic... What i have in mind of performance sideeffects on such a thing? Or is there a solution that works with PW? I wanna go the hard way and implement something like this: http://stats.simplepublisher.com/ only directly within PW and use the API to get the data...maybe create a simple module from it later i don't know if i could set it up right from the start ? this is the reason for my questions on more experienced devs Kind regards mr-fan
- 7 replies
-
- performance
- counter
-
(and 1 more)
Tagged with:
-
In page-edit view: If I wanted to display the total count of selections, is there an in-built PW method for this? e.g. let's say the default view is collapsed for a page reference field. I see the label "Services" but would like to see "Services (3)". I would know that three items are selected without opening the inputfield. And ideally after every change, the number gets updated (without page-reload). Did someone once built something similar?
- 11 replies
-
- inputfields
- selection
-
(and 2 more)
Tagged with: