[pmwiki-users] PMwiki, counting page hits and flow off the login pages

Petko Yotov 5ko at 5ko.fr
Thu Nov 26 10:36:58 PST 2020


On 26/11/2020 17:32, Foster Schucker wrote:
> First On my left margin I have
> 
> * [[Main/HomePage]]
> * [[Main/WikiSandbox]]
> 
> * (:if authid:) User: [[Main.{$AuthId} | {$AuthId}]] (:else:)
> [[Site.AuthUser | Please login]] (:ifend:)
> 
> %sidehead% [[PmWiki/PmWiki]]
> 
> This shows either the link to Site.Authuser so the user can log in, or
> their user name as a link to their personal home page.
> 
> After they do the authentication is there a way to send them off the
> Site.Authuser page to some place else?  The page they were on before
> they did the Auth would be best but Main.{AuthId} or  Main.HomePage
> would also work.   I'm kind of following along in scripts/authuser,
> but not seeing how I can get it to return to do a redirect.

Yes, you can link to [[Main.HomePage?action=login]] however maybe you 
don't need to -- a login form will appear when the user tries to access 
a restricted area or action.

BTW by default the wikigroup for user profiles is "Profiles", not 
"Main". This group is linked when a user signs with 3 or 4 tildes ~~~ or 
~~~~ and there is a shortcut [[~Foster]] that also links to 
Profiles/Foster.


> Second question is there a way to count the number of times a page has
> been accessed?   I found a cook book that seems to track edits, but
> not just a plain read.  That cookbook seems to be plugging into the
> list of functions that are called as part of the edit/update cycle.
> 
> Having a page called Main.Pagecounts with a row for each  page name
> and the access count would be fine, or a variable  that I could put in
> the page to say "This page has been accessed {$Pagecount} times."

No, there is no recipe that would be reasonably performant or scalable. 
If you have only a few visitors per day, you may try some of the recipes 
on the PmWiki Cookbook.

I suggest using a web analytics software, see some free/open source ones 
listed here:

   https://en.wikipedia.org/wiki/Category:Free_web_analytics_software

Some hosting providers offer web analytics/statistics in their hosting 
packages, based on the server access logs -- check your hosting panel.

Some people install Google Analytics, especially if they want to also 
show ads. However, many visitors now have ad-blocking and 
privacy-enhancing browsers or extensions, and external analytics may be 
unreliable, notably with the providers that are known and popular.

Petko



More information about the pmwiki-users mailing list