Extension that expires after saving

Discuss PivotX 2.0.x extensions here, and view extensions that are available for download.

Extension that expires after saving

Postby Samson » Fri Mar 23, 2012 10:23 pm

I need an extension that works after saving an article. Is there an example?

edit:

this code works:
Code: Select all
$this->addHook(
    'entry_edit_aftersave',
    'callback',
    'phpcms_content'
);

function phpcms_content($item) {
  global $PIVOTX;
  debug_printr($item);
  debug_printr($PIVOTX);
  return;
}
Regards
Frank
My blog (with PivotX) - and my actual projects: German Chess Union, Berlin Chess Union (with phpCMS, all in german)
Samson
 
Posts: 38
Joined: Sun Apr 10, 2011 1:18 pm
Location: Berlin, Germany

Re: Extension that expires after saving

Postby jadwigo » Wed Jul 11, 2012 11:56 am

Sorry for the slow reply here.

There is currently no example extension for the after save hook.

But if you add your code and the headers like the following example to a file called 'hook_afstersave.php' and place the file in a subdirectory of your pivotx/extensions it should work.

Code: Select all
<?php
// - Extension: After save hook
// - Version: 0.1
// - Author: You
// - Email: you@youremail.com
// - Site: http://www.pivotx.net
// - Updatecheck: http://www.pivotx.net/update.php?ext=aftersavehook
// - Description: A small extension to show how the aftersavehook works.
// - Date: 2012-07-11
// - Identifier: aftersavehook

$this->addHook(
    'entry_edit_aftersave',
    'callback',
    'phpcms_content'
);

function phpcms_content($item) {
  global $PIVOTX;
  debug_printr($item);
  debug_printr($PIVOTX);
  return;
}
My pivotx playground is at http://jivotx.twokings.eu - the rest is at http://www.jadwigo.nl
jadwigo
Developer
 
Posts: 117
Joined: Wed Nov 18, 2009 9:49 am
Location: Den Haag, Netherlands


Return to 2.x Extensions

Who is online

Users browsing this forum: No registered users and 2 guests

cron