New plugin loader, page features, API0.2b, Bugfixes
This commit is contained in:
48
api.php
48
api.php
@ -1,25 +1,25 @@
|
||||
<?php
|
||||
|
||||
require_once 'core.php';
|
||||
|
||||
header('Content-type: application/json');
|
||||
|
||||
$blog = new blog();
|
||||
$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);
|
||||
|
||||
<?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);
|
||||
|
||||
?>
|
Reference in New Issue
Block a user