1
0
Fork 0

[GIT] setup initial configuration

This commit is contained in:
Jannik Beyerstedt 2016-03-28 22:32:42 +02:00
commit 46b0df0faf
32 changed files with 10188 additions and 0 deletions

1
site/plugins/columns Symbolic link
View file

@ -0,0 +1 @@
../../modules/getkirby-plugins/columns

1
site/plugins/kirbytextraw Symbolic link
View file

@ -0,0 +1 @@
../../modules/kirby-plugin-kirbytextRaw

1
site/plugins/piwik/.gitignore vendored Executable file
View file

@ -0,0 +1 @@
.idea

33
site/plugins/piwik/Readme.md Executable file
View file

@ -0,0 +1,33 @@
# Piwik plugin
A plugin for [Kirby CMS](http://getkirby.com) that generates piwik analytics code to use in your templates.
## Installation
Put the `piwik` folder in `/site/plugins`.
Configure piwik URL and site id in your page config.
### Config Variables
- spicy.piwik.active: true / false (Default: true)
- spicy.piwik.url: 'stats.yourpage.com'
- spicy.piwik.id: 1 (replace with the page ID in your piwik installation)
## How to use it
You can use this in a template file.
## Example usage
### Snippets
```php
<!-- use this right before closing </body> tag -->
<?php echo piwik(); ?>
```
## Author
Michael Fürmann @ Spicy Web
<https://spicyweb.de>

18
site/plugins/piwik/piwik.php Executable file
View file

@ -0,0 +1,18 @@
<?php
/**
* Piwik Plugin
*
* @author Michael Fürmann <michael@spicyweb.de>
* @version 1.0.0
*/
function piwik($options = array()) {
if(!c::get('spicy.piwik.active', true) || !c::get('spicy.piwik.url') || !c::get('spicy.piwik.id'))
return;
$options['url'] = c::get('spicy.piwik.url');
$options['id'] = c::get('spicy.piwik.id');
// Return template HTML
return tpl::load(__DIR__ . DS . 'template.php', $options);
}
?>

15
site/plugins/piwik/template.php Executable file
View file

@ -0,0 +1,15 @@
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="<?= $url?>/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', <?= $id?>]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="<?= $url?>/piwik.php?idsite=<?= $id?>" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->

1
site/plugins/thumbext Symbolic link
View file

@ -0,0 +1 @@
../../modules/kirby-plugin-thumbExt