<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://gwiki3.thatlinuxbox.com/index.php?action=history&amp;feed=atom&amp;title=PLG_itemSaved</id>
		<title>PLG itemSaved - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://gwiki3.thatlinuxbox.com/index.php?action=history&amp;feed=atom&amp;title=PLG_itemSaved"/>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=PLG_itemSaved&amp;action=history"/>
		<updated>2026-04-06T13:20:47Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.27.5</generator>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=PLG_itemSaved&amp;diff=4804&amp;oldid=prev</id>
		<title>Dirk: Fixed HTML tag mismatch</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=PLG_itemSaved&amp;diff=4804&amp;oldid=prev"/>
				<updated>2009-02-06T13:34:00Z</updated>
		
		<summary type="html">&lt;p&gt;Fixed HTML tag mismatch&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 13:34, 6 February 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l31&quot; &gt;Line 31:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 31:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When an item is deleted, &amp;lt;code&amp;gt;PLG_itemDeleted&amp;lt;/code&amp;gt; is called (&amp;lt;code&amp;gt;PLG_itemSaved&amp;lt;/code&amp;gt; is ''not'' called for deleted items):&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;When an item is deleted, &amp;lt;code&amp;gt;PLG_itemDeleted&amp;lt;/code&amp;gt; is called (&amp;lt;code&amp;gt;PLG_itemSaved&amp;lt;/code&amp;gt; is ''not'' called for deleted items):&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;function PLG_itemDeleted($id, $type)&amp;lt;/&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;code&lt;/del&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;function PLG_itemDeleted($id, $type)&amp;lt;/&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;pre&lt;/ins&gt;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Plugin Development]]&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Plugin Development]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dirk</name></author>	</entry>

	<entry>
		<id>http://gwiki3.thatlinuxbox.com/index.php?title=PLG_itemSaved&amp;diff=4802&amp;oldid=prev</id>
		<title>Dirk: PLG itemSaved</title>
		<link rel="alternate" type="text/html" href="http://gwiki3.thatlinuxbox.com/index.php?title=PLG_itemSaved&amp;diff=4802&amp;oldid=prev"/>
				<updated>2009-02-06T09:46:42Z</updated>
		
		<summary type="html">&lt;p&gt;PLG itemSaved&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
The motivation for &amp;lt;code&amp;gt;PLG_itemSaved&amp;lt;/code&amp;gt; is to have a call that plugins can hook into whenever Geeklog (or another plugin) saves one of its items (article, comment, ...) so that plugins can perform actions on their own if they want to track changes on an item.&lt;br /&gt;
&lt;br /&gt;
The original implementation, however, was very complex and included a rollback mechanism that was called when one of the plugins indicated a problem. As a result, it was only ever implemented for stories (and not even correctly at that ...).&lt;br /&gt;
&lt;br /&gt;
So as of Geeklog 1.6.0, this API has been simplified and implemented not only for stories but also for Events, Links, Polls, and Static Pages (more to come).&lt;br /&gt;
&lt;br /&gt;
= The API =&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function PLG_itemSaved($id, $type, $old_id = '')&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt; is the unique ID of the item being saved. If the item's ID is changed with this save operation, then &amp;lt;code&amp;gt;$id&amp;lt;/code&amp;gt; will contain the new ID and &amp;lt;code&amp;gt;$old_id&amp;lt;/code&amp;gt; contains the previous ID (otherwise it's empty).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;$type&amp;lt;/code&amp;gt; is the item's type, e.g. &amp;lt;code&amp;gt;'article'&amp;lt;/code&amp;gt; for a story. For plugins, the item's type is usually identical with the plugin's internal name, e.g. &amp;lt;code&amp;gt;'links'&amp;lt;/code&amp;gt; for a link from the Links plugin.&lt;br /&gt;
&lt;br /&gt;
== Subtypes ==&lt;br /&gt;
&lt;br /&gt;
''(not finalized yet)''&lt;br /&gt;
&lt;br /&gt;
For plugins that support more than one type of item (e.g. the Links plugin, which has links and link categories), the type can consist of two parts: The main type (identical with the plugin's name) and a subtype, separated by a dot &amp;lt;code&amp;gt;'.'&amp;lt;/code&amp;gt;, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;links.category&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Return value ==&lt;br /&gt;
&lt;br /&gt;
The return value of &amp;lt;code&amp;gt;PLG_itemSaved&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;void&amp;lt;/code&amp;gt;, i.e. it does not return anything (actually, it does currently return &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt; for backward compatibility with the old API implementation but that should not be relied upon).&lt;br /&gt;
&lt;br /&gt;
= PLG_itemDeleted =&lt;br /&gt;
&lt;br /&gt;
When an item is deleted, &amp;lt;code&amp;gt;PLG_itemDeleted&amp;lt;/code&amp;gt; is called (&amp;lt;code&amp;gt;PLG_itemSaved&amp;lt;/code&amp;gt; is ''not'' called for deleted items):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;function PLG_itemDeleted($id, $type)&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugin Development]]&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Dirk</name></author>	</entry>

	</feed>