<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : Plugin on index</title>
		<link>https://www.cotonti.com</link>
		<description>Last topic posts</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sat, 11 Apr 2026 16:01:29 -0000</pubDate>

		<item>
			<title>Macik</title>
			<description><![CDATA[<p>Moreover, this can be accomplished by common News plugin — http://screenshot.galaxyhost.org/img/20140507-2pa-57kb.jpg </p>
]]></description>
			<pubDate>Wed, 07 May 2014 06:56:26 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7733&d=0#post39515]]></link>
		</item>
		<item>
			<title>Harker</title>
			<description><![CDATA[<p>That's it of step read the descriptions and to pass next to an interesting plugin, thank you very much :D</p>
]]></description>
			<pubDate>Mon, 05 May 2014 16:12:32 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7733&d=0#post39512]]></link>
		</item>
		<item>
			<title>Kort</title>
			<description><![CDATA[<p>This can be easily accomplished with the <a href="http://www.cotonti.com/extensions/navigation-structure/pagelist">pagelist plugin</a>.</p>
]]></description>
			<pubDate>Mon, 05 May 2014 05:42:28 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7733&d=0#post39509]]></link>
		</item>
		<item>
			<title>Harker</title>
			<description><![CDATA[<p>Hi Aiwass,</p>

<p>I am going to try to explain but I manage not very well in English. In fact, I already use 'recentitems' other leave in the design. Actually, i use the plugin 'News' and i also parametrized him to see 4 news.</p>

<p>For the design of my website, I need both. (news &amp; my_plug[mininews])</p>

<p>You know how to see on the image what I wish to make</p>

<p><a href="http://hpics.li/3048c75" rel="nofollow">http://hpics.li/3048c75</a></p>

<p>That's why I wish to make this plugin, to show 4 right images</p>

<p> </p>
<p><strong>Added 36 minutes later:</strong></p><p>Later of numerous copy/paste, I finally managed to show what I wished \o/</p>

<p>To be frank, I have no idea of why it works. This is what I modified :</p>

<p><strong>mininews.index.php</strong></p>

<p> </p>

<pre class="brush:php;">
/* ====================
[BEGIN_COT_EXT]
Hooks=index.tags
Tags=index.tpl:{MININEWS}
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

	$ttt = new XTemplate(cot_tplfile('mininews.index', 'plug'));

	$sql = $db-&gt;query("SELECT page_alias, page_title, page_avatar 
			FROM $db_pages 
			WHERE page_cat = 'news' 
			ORDER BY page_id DESC 
			Limit 4");
						
	/* === Hook - Part1 === */
	$extp = cot_getextplugins('mininews.index.tags');
	/* ===== */					

	foreach ($sql-&gt;fetchAll() as $row)
	{
    	$ttt-&gt;assign(array(
            'PAGESS_ALIAS' =&gt; htmlspecialchars($row['page_alias']),
			'PAGESS_TITLE' =&gt; htmlspecialchars($row['page_title']),
			'PAGESS_AVATAR' =&gt; $row['page_avatar']
    	));
		
		/* === Hook - Part2 === */
		foreach ($extp as $pl)
		{
			include $pl;
		}
		/* ===== */
		
		$ttt-&gt;parse('MININEWS');
	}
	
	$t-&gt;assign('MININEWS', $ttt-&gt;text('MININEWS'));</pre>

<p> </p>
]]></description>
			<pubDate>Sun, 04 May 2014 21:10:17 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7733&d=0#post39508]]></link>
		</item>
		<item>
			<title>aiwass</title>
			<description><![CDATA[<p>Why don't you use <strong>recentitems</strong> plugin instead? It does what you are trying to achieve.Just change the template (.tpl) to how you want it to look.<br />
I'm using <strong>recentitems</strong> on <a href="http://www.evlear.com" rel="nofollow">www.evlear.com </a></p>
]]></description>
			<pubDate>Sun, 04 May 2014 20:39:19 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7733&d=0#post39507]]></link>
		</item>
		<item>
			<title>Harker</title>
			<description><![CDATA[<p>Hello to all,</p>

<p>I come towards you because I try to create a plugin which displays on page index. I need that he shows only the information of 4 back pages(news)</p>

<p>I tried some solution but I become muddled with =&gt;   $t = new XTemplate(cot_tplfile.....</p>

<p>Here is my code:</p>

<p><strong>mininews.index.php</strong></p>

<pre class="brush:php;">
/* ====================
[BEGIN_COT_EXT]
Hooks=index.tags
Tags=index.tpl:{MININEWS}
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');

	$t = new XTemplate(cot_tplfile('mininews', 'plug'));

	$sql = $db-&gt;query("SELECT page_alias, page_title, page_avatar 
			   FROM $db_pages 
			   WHERE page_cat = 'news' 
			   ORDER BY page_id DESC 
			   Limit 4");

	while($row = $sql-&gt;fetch())
	{
    	$t-&gt;assign(array(
            'PAGESS_ALIAS' =&gt; htmlspecialchars($row['page_alias']),
	    'PAGESS_TITLE' =&gt; htmlspecialchars($row['page_title']),
	    'PAGESS_AVATAR' =&gt; $row['page_avatar']
    	));
	    $t-&gt;parse('MININEWS');
	}</pre>

<p><strong>mininews.index.tpl</strong></p>

<pre class="brush:plain;">
&lt;!-- BEGIN: MININEWS --&gt;
&lt;div&gt;{PAGESS_ALIAS}{PAGESS_TITLE}{PAGESS_AVATAR}&lt;/div&gt;
&lt;!-- END: MININEWS --&gt;</pre>

<p><strong>mininews.setup.php</strong></p>

<pre class="brush:php;">
/* ====================
[BEGIN_COT_EXT]
Code=mininews
Name=mininews
Description=provides mininews
Version=1.0
Date=04/20/2014
Author=Stygz
Copyright=
Notes=Just A Test.
Auth_guests=R
Lock_guests=12345A
Auth_members=RW
Lock_members=12345A
[END_COT_EXT]
==================== */

defined('COT_CODE') or die('Wrong URL');</pre>

<p> </p>

<p> </p>

<p>With this code, nothing displays and I do not manage to understand why :'(</p>

<p>If you have a little of time, could you help me :D</p>
]]></description>
			<pubDate>Sun, 04 May 2014 13:11:29 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/forums?m=posts&q=7733&d=0#post39506]]></link>
		</item>
	</channel>
</rss>