Location: PHPKode > projects > Tellmatic - the newslettermachine > tellmatic/api_example_dev_04.php
<?php
/********************************************************************************/
/* this file is part of: / diese Datei ist ein Teil von:                        */
/* tellmatic, the newslettermachine                                             */
/* tellmatic, die Newslettermaschine                                            */
/* 2006/7 by Volker Augustin, multi.art.studio Hanau                            */
/* Contact/Kontakt: hide@address.com                                      */
/* Homepage: www.tellmatic.org                                                   */
/* leave this header in file!                                                   */
/* diesen Header nicht loeschen!                                                */
/* check Homepage for Updates and more Infos                                    */
/* Besuchen Sie die Homepage fuer Updates und weitere Infos                     */
/********************************************************************************/
exit;//remove this line or add # in front of line
//inclue tm config
include ("./include/tm_config.inc.php");//change path to full path to tm_config if the script is not in tellmatic installation directory!

//Beispielcode: letzte X Newsletter anzeigen, newsletter aber aus q holen! nur mit status versendet!
//"export RSS"

$rss_output_filename="newsletter_index.xml";
//This is just a very simple example!
$nl_offset=0;//offset, kann auch aus $_GET oder per getVar ermittelt werden....
$nl_limit=10;//anzahl anzuzeigender newsletter
$nl_content=0;//do not return content
$nl_grpid=0;//nl group, 0=all groups

$QUEUE=new tm_Q();
$NL=new tm_NL();
$search_nl['is_template']=0;
$search_nl['aktiv']=1;
$search_nl['status']=Array(3,4,5);//started, sent, archiv, see Stats.inc.php
$Q=$QUEUE->getQ(0,0,$nl_limit,0,$nl_grpid,4);

$_RSS='<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Newsletter</title>
<description>Tellmatic</description>
<link>http://www.tellmatic.org</link>
';

foreach ($Q as $q) {
	$N=$NL->getNL($q['nl_id'],0,1,0,1,"",1,$search_nl);
	$nl=$N[0];
	$_RSS.='
	<item>
	<title>'.$nl['subject'].'</title>
	<link>'.$tm_URL_FE.'/'.$tm_nldir.'/nl_'.date_convert_to_string($nl['created']).'_p.html</link>
	</item>
	';
}

$_RSS.='
</channel>
</rss>
';
write_file(TM_PATH,$rss_output_filename,$_RSS);
?>
Return current item: Tellmatic - the newslettermachine