is there a way to write a plugin or something which will be done every single page that loads on zikula, i didn't really want to edit core files but i wanted to play around and get zikula to run a function every time a user views a page
thanks in advance :)
kyle
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- michiel responded to »password problem« 10:01 AM
- mazdev responded to »Hide "Register new account" and change template to 3 col« 07:50 AM
- mesteele101 created topic »Zikula 1.3.3 - Site Search 1.5.2 - Unable to turn off plug-ins« 07:48 AM
- mesteele101 responded to »ERR (3): E_USER_ERROR: Smarty error: [in pagesvar:pagesitem2en line XXX]…« 25. May
- mazdev responded to »Pages 2.5.0 and updating - Page not found« 25. May
- mesteele101 responded to »Zikula 1.3.3 - Selecting a category in Pages not working« 25. May
- mdee created topic »How to implement returnpage ?« 25. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
is there a way to....
-
- Rank: Softmore
- Registered: Sep 30, 2008
- Last visit: May 29, 2010
- Posts: 201
-
- Rank: Developer
- Registered: Mar 29, 2005
- Last visit: Mar 13, 2010
- Posts: 228
A plugin in the main templates (master and home) can do it, but it won't be executed in those situation where the template is not used (es. with a redirect the page would be executed twice, but the plugin only once).
I'm not sure, but maybe you can do it with a hook. Since Zikula 1.1.x you can activate a hook for zikula itself (not for a specific module), it should be executed each time (I'm guessing, I'm not sure)
--
Zikula Italia
SimpleGallery -
- Rank: Developer
- Registered: Jun 16, 2003
- Last visit: May 29, 2010
- Posts: 1966
-
- Rank: Softmore
- Registered: Sep 30, 2008
- Last visit: May 29, 2010
- Posts: 201
i was looking more for a way of doing it that does not require template/theme modification, i already have the code i need to do what i want hardwired into the template, but it would be nice to make it in a distributable fashion.
what i'm doing is a PHP redirect from http to https for certain pages etc... this can easily be done directly in the PHP, or using the htaccess, but of course the htaccess method requires i have rewrite mod on apache, and its not exactlyt re-distributable. i would be interested in writing a very small module that you can specify certain pages or functions, and force it to redirect to https.
the only way i really see of doing this (and feel free to point out others if you seen them) is for every time a page is accessed, the PHP checks (before doing anything else) if this page is supposed to be https, if it is https, and then rewrites based on what needs to happen.
does zikula have a way of loading functions, that will be executed with every page? -
- Rank: Developer
- Registered: May 17, 2004
- Last visit: Apr 08, 2010
- Posts: 386
the cleanest way to do this is to use a hook on the event "systeminit" -
- Rank: Registered User
- Registered: Apr 02, 2002
- Last visit: Dec 13, 2009
- Posts: 32
I want to do something similar for a Google Analytics module where it will add the code to the bottom of every page. I started this ages ago and ran out of time. About to start it up again soon.
Where can we find information about what system hooks are available and how to use them?
- Moderated by:
- Support
Users on-line
- 0 users
This list is based on users active over the last 60 minutes.
