diff --git a/api.php b/api.php index eb2d426..f89fdea 100644 --- a/api.php +++ b/api.php @@ -15,13 +15,9 @@ if(!defined('entry')) define('entry',true); header("Content-type: text/xml; charset=utf-8"); $isFeed = true; - require(dirname(__FILE__)."/config.php"); - - include("classes/configuration.class.php"); - $conf = new configuration(); - - include("classes/gelato.class.php"); - $tumble = new gelato(); + require('entry.php'); + global $user, $conf, $tumble; + $f = new feeds(); echo "\n"; ?> @@ -34,31 +30,25 @@ if(!defined('entry')) define('entry',true); if (isset($_GET["type"])) { $hasType = true; } else { $hasType = false; } if ($total > 50) { $total = 50; } ?> - " timezone="offsetCity;?>" title="title;?>">description;?> + " timezone="offsetCity;?>" title="title;?>">description."\n"; +?> + +getFeedList(); + foreach($actual_feeds as $feed){ + $error_text = ($feed["error"]>0) ? "false" : "true"; +?> + " url="" import-type="" next-update-in-seconds="getNextUpdate($feed["id_feed"]);?>" title="" error-text=""/> + + + getPosts($total, $start); if ($tumble->contarRegistros()>0) { diff --git a/classes/functions.php b/classes/functions.php index 3bf02e2..73f0566 100644 --- a/classes/functions.php +++ b/classes/functions.php @@ -13,7 +13,7 @@ if(!defined('entry') || !entry) die('Not a valid page'); ?> /ie', "'<'.removeBadAtributes('\\1').'>'", $source); } - function removeBadAtributes($sourceTag) - { + function removeBadAtributes($sourceTag) { $badAtributes = 'javascript:|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup'; $sourceTag = stripslashes($sourceTag); $sourceTag = preg_replace("/$badAtributes/i", "niceTry", $sourceTag); return $sourceTag; } + + function type2Text($number) { + $tmpStr = ""; + switch ($number) { + case "1": + $tmpStr = "post"; + break; + case "2": + $tmpStr = "photo"; + break; + case "3": + $tmpStr = "quote"; + break; + case "4": + $tmpStr = "url"; + break; + case "5": + $tmpStr = "conversation"; + break; + case "6": + $tmpStr = "video"; + break; + case "7": + $tmpStr = "mp3"; + break; + } + return $tmpStr; + } + + function type2Number($string) { + $tmpStr = ""; + switch ($string) { + case "post": + $tmpStr = "1"; + break; + case "photo": + $tmpStr = "2"; + break; + case "quote": + $tmpStr = "3"; + break; + case "url": + $tmpStr = "4"; + break; + case "conversation": + $tmpStr = "5"; + break; + case "video": + $tmpStr = "6"; + break; + case "mp3": + $tmpStr = "7"; + break; + } + return $tmpStr; + } ?> \ No newline at end of file