new plugin: serendipity_plugin_piwik

Creating and modifying plugins.
User avatar
onli
Regular
Posts: 2231
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: new plugin: serendipity_plugin_piwik

Post by onli » Sat Oct 19, 2013 8:22 pm

Ok, if you got such a link, you can get the id by using PAT_ARCHIVE, PAT_ARCHIVES or PAT_PERMALINK (I'm always mixing those up). If you have the id, with that you can get all other entry data by calling

Code: Select all

serendipity_fetchEntry('id', $id)
I think that this method should work with or without url rewriting.

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new plugin: serendipity_plugin_piwik

Post by Timbalu » Wed Oct 23, 2013 6:27 pm

bernd_d wrote:In my case, i get URLs like /archives/67-D-Link-DNS-323-im-Test.html from piwik and for output i would need page-title from database. Could be possible with article-id i hope, but it would be needed for different kind of url-rewriting.

But this only would solve my problem, i don't know why Timbalu gets different links/output. This need to be checked within piwik-dashboard and compared to output of the api.
Hi Bernd
I needed to wait for the new week to get some new results... :)
This definitely were links brought-in by google and other SE. It is now a mixture of single entry links (like your ones) and all sort of of archives summary links (monthly/daily). I just return that here, so this does not seem to be a problem of the plugin itself.
I disabled the sidebar plugin for the public again, since it took to many ressources on that quite busy site, and also did not make too much sense there.
Just as a side note, when starting, I had to make it work by

Code: Select all

            // take pagetitles from second array and write it into first one
            @ini_set("memory_limit",'64M');
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

bernd_d
Regular
Posts: 466
Joined: Thu Jun 03, 2010 9:28 am
Contact:

Re: new plugin: serendipity_plugin_piwik

Post by bernd_d » Wed Oct 23, 2013 9:49 pm

Timbalu wrote:I needed to wait for the new week to get some new results... :)
Will be better with Piwik 2.0. As you can see it on my page, then you will be able to query "last x days" instead of current week. It doesn't work within Piwik 1.0 because of some API-bugs. :)
Timbalu wrote:Just as a side note, when starting, I had to make it work by

Code: Select all

            // take pagetitles from second array and write it into first one
            @ini_set("memory_limit",'64M');
64M memory for this little array with 5 entries?!? Or did you use a larger number of entries (plugin-settings) that had to be fetched?

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: new plugin: serendipity_plugin_piwik

Post by Timbalu » Thu Oct 24, 2013 9:47 am

Do you mean those two core file changes. I did use them already.

And about the memory limit, this wondered me too. I surely started with lower tries, until the error was gone. Today I think, it was because the sidebar compilation and piwik in the background raised up the used memory so high, that I had to reserve some more than origin necessary to the plugin.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

bernd_d
Regular
Posts: 466
Joined: Thu Jun 03, 2010 9:28 am
Contact:

Re: new plugin: serendipity_plugin_piwik

Post by bernd_d » Thu Oct 24, 2013 12:51 pm

Timbalu wrote:Do you mean those two core file changes. I did use them already.
Yes, this is what i mean.
Timbalu wrote:And about the memory limit, this wondered me too. I surely started with lower tries, until the error was gone. Today I think, it was because the sidebar compilation and piwik in the background raised up the used memory so high, that I had to reserve some more than origin necessary to the plugin.
I have made a new 0.4.0 with some optmizations at the piwik-query-url, hope this helps a little bit.

Code: Select all

0.4.0
* with Piwik v2 it is possible to use last x days for most
  read entries instead of current week
* some optimizations for fetching most read entries (smaller arrays)
Attachments
serendipity_plugin_piwik_0.4.0.zip
(7.78 KiB) Downloaded 131 times

Post Reply