insanelyBlog/api.php

25 lines
1.0 KiB
PHP
Raw Normal View History

<?php
require_once 'core.php';
header('Content-type: application/json');
$blog = new blog(false, 0, true, (isset($_GET['no']) ? $_GET['no'] : fasle));
$entries = array();
if ($blog->entries)
{
while ($data = $blog->entries())
array_push($entries, array('entryTitle'=>$data['entryTitle'], 'entrySlug'=>$data['entrySlug'], 'entryPublished'=>show_date($data['entryPublished']), 'entryContent'=>entry_show_init($data['entryContent'], $data['entrySlug'], true)));
/*echo "<article>
<header>
<h2><a href='".get_entry_link($data['entrySlug'])."'>$data[entryTitle]</a></h2>
<p class='meta'><time class='date' title='{locale:published_on}'>".show_date($data['entryPublished'])."</time><a href='".get_profile_link($data['userName'])."' class='by' title='{locale:entry_by}'>$data[publicName]</a>".get_entry_admin($data)."</p>
</header>
<div class='content'>".entry_show_init($data['entryContent'], $data['entrySlug'])."</div>
</article>\n";*/
}
echo json_encode($entries);
2016-06-18 10:07:35 +02:00
?>