<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Create a plugin with page.add.tags</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sat, 18 Apr 2026 06:27:43 -0000</pubDate>

		<item>
			<title>Harker</title>
			<description><![CDATA[<p>Really excellent, it works perfectly :] Thank you</p>
]]></description>
			<pubDate>Thu, 02 Apr 2015 08:08:35 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7926&d=0#post40767]]></link>
		</item>
		<item>
			<title>Dayver</title>
			<description><![CDATA[<blockquote><a href="https://www.cotonti.com/forums?m=posts&amp;q=7926&amp;d=1#40765">#40765</a> <strong>Harker: </strong>

<p>Hello all,</p>

<p>I have problems and i ask your help again :]</p>

<p>... but I dont' know how to retrieve the ID from the page rather than the alias and even worse...</p>
</blockquote>

<p>In <strong>page.add.add.done</strong> hook this is have $id param.</p>
]]></description>
			<pubDate>Thu, 02 Apr 2015 02:47:06 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7926&d=0#post40766]]></link>
		</item>
		<item>
			<title>Harker</title>
			<description><![CDATA[<p>Hello all,</p>

<p>I have problems and i ask your help again :]</p>

<p>I explain, I would like to make a plugin using the systeme page.add.tags.page.edit.tags. I know it's easy to use the extra-fields in the pages but I would like use the plugin as it is a very big database. I have already done some of the plugin and it works but I dont' know how to retrieve the ID from the page rather than the alias and even worse, I don't know if in security if that's ok</p>

<p> </p>

<p>Could you take a look at what I did and show me how to retrieve the page ID and add the security :]</p>

<p>Thank you in advance for your help</p>

<p> </p>

<p>items.page.add.tags.php</p>

<pre class="brush:as3;">
defined('COT_CODE') or die('Wrong URL');

if ($m == 'add')
{	
	$t-&gt;assign(array(
		'PAGEADD_TOP_ITEMS_COST' =&gt; $L['Tags'],
		'PAGEADD_FORM_ITEMS_COST' =&gt; cot_inputbox(text, 'ritemscost', '', array('size' =&gt; 3, 'maxlength' =&gt; 3))
	));
}</pre>

<p> </p>

<p>items.page.add.done.php</p>

<pre class="brush:as3;">
defined('COT_CODE') or die('Wrong URL');

if (!cot_error_found() &amp;&amp; cot_auth('plug', 'items', 'W'))
{
		if (cot_import('ritemscost', 'P', 'INT'))
		{
			$ritemscost = cot_import('ritemscost', 'P', 'INT');
			
			$db-&gt;insert(cot_items, array('items_cost' =&gt; $ritemscost, 'items_page_id' =&gt; $pag['page_id'], 'items_page_alias' =&gt; $rpage['page_alias'], 'items_page_cat' =&gt; $rpage['page_cat']));
		}
}</pre>

<p> </p>

<p>items.page.edit.tags</p>

<pre class="brush:as3;">
defined('COT_CODE') or die('Wrong URL');
$page_alias = $pag['page_alias'];

if ($m == 'edit' &amp;&amp; cot_auth('plug', 'items', 'W'))
{	
$sqlitems = $db-&gt;query("SELECT * FROM cot_items WHERE items_page_alias= ?", $page_alias)-&gt;fetch();

$t-&gt;assign(array(
    "PAGEEDIT_FORM_ITEMS_COST" =&gt; '&lt;input name="ritemscost" value="'.$sqlitems['items_cost'].'" /&gt;',
));
}</pre>

<p> </p>

<p>items.page.edit.done</p>

<pre class="brush:as3;">
defined('COT_CODE') or die('Wrong URL');

if (!cot_error_found() &amp;&amp; cot_auth('plug', 'items', 'W'))
{
		if (cot_import('ritemscost', 'G', 'INT'))
		{
			$ritemscost = cot_import('ritemscost', 'G', 'INT');
			
			$db-&gt;update(cot_items, array('items_cost' =&gt; $ritemscost,), 'items_page_alias="'.$page['page_alias'].'"');
			
		}
}</pre>

<p> </p>
]]></description>
			<pubDate>Wed, 01 Apr 2015 15:16:34 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7926&d=0#post40765]]></link>
		</item>
	</channel>
</rss>