cotonti.com : Plugin on index https://www.cotonti.com Последние сообщения в теме Cotonti en Fri, 07 Nov 2025 07:09:42 -0000 Macik Moreover, this can be accomplished by common News plugin — http://screenshot.galaxyhost.org/img/20140507-2pa-57kb.jpg 

]]>
ср, 07 мая 2014 06:56:26 -0000
Harker That's it of step read the descriptions and to pass next to an interesting plugin, thank you very much :D

]]>
пн, 05 мая 2014 16:12:32 -0000
Kort This can be easily accomplished with the pagelist plugin.

]]>
пн, 05 мая 2014 05:42:28 -0000
Harker Hi Aiwass,

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.

For the design of my website, I need both. (news & my_plug[mininews])

You know how to see on the image what I wish to make

http://hpics.li/3048c75

That's why I wish to make this plugin, to show 4 right images

 

Added 36 minutes later:

Later of numerous copy/paste, I finally managed to show what I wished \o/

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

mininews.index.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->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->fetchAll() as $row)
	{
    	$ttt->assign(array(
            'PAGESS_ALIAS' => htmlspecialchars($row['page_alias']),
			'PAGESS_TITLE' => htmlspecialchars($row['page_title']),
			'PAGESS_AVATAR' => $row['page_avatar']
    	));
		
		/* === Hook - Part2 === */
		foreach ($extp as $pl)
		{
			include $pl;
		}
		/* ===== */
		
		$ttt->parse('MININEWS');
	}
	
	$t->assign('MININEWS', $ttt->text('MININEWS'));

 

]]>
вс, 04 мая 2014 21:10:17 -0000
aiwass Why don't you use recentitems plugin instead? It does what you are trying to achieve.Just change the template (.tpl) to how you want it to look.
I'm using recentitems on www.evlear.com

]]>
вс, 04 мая 2014 20:39:19 -0000
Harker Hello to all,

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)

I tried some solution but I become muddled with =>   $t = new XTemplate(cot_tplfile.....

Here is my code:

mininews.index.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->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->fetch())
	{
    	$t->assign(array(
            'PAGESS_ALIAS' => htmlspecialchars($row['page_alias']),
	    'PAGESS_TITLE' => htmlspecialchars($row['page_title']),
	    'PAGESS_AVATAR' => $row['page_avatar']
    	));
	    $t->parse('MININEWS');
	}

mininews.index.tpl

<!-- BEGIN: MININEWS -->
<div>{PAGESS_ALIAS}{PAGESS_TITLE}{PAGESS_AVATAR}</div>
<!-- END: MININEWS -->

mininews.setup.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');

 

 

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

If you have a little of time, could you help me :D

]]>
вс, 04 мая 2014 13:11:29 -0000