New plugin loader, page features, API0.2b, Bugfixes

This commit is contained in:
2016-11-19 16:13:37 +01:00
parent 6d1eef25ca
commit b97faf21fd
230 changed files with 36532 additions and 36346 deletions

View File

@ -1,19 +1,19 @@
<?php
if ($blog->entries)
{
while ($data = $blog->entries())
{
$entry_init = entry_show_init($data['entryContent'], $data['entrySlug']);
echo "<article".($data['entryPinned'] ? ' class="pinned"' : '').(strlen(strip_tags($entry_init)) <= 210 ? ' class="tweet"' : '')." title='".show_date($data['entryPublished'])."'>
<header>
<h2><a href='".get_entry_link($data['entrySlug'])."'>".htmlspecialchars($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></p>
</header>
<div class='content'>".$entry_init."</div>
</article>\n";
unset($entry_init);
}
echo "<p class='paginator'>".(isset($seo[1]) && isnum($seo[1]) ? "<a href='/p/".($seo[1]-1)."' class='prev'>{locale:prev_page}</a><a href='/p/".($seo[1]+1)."' class='next'>{locale:next_page}</a>" : "<a href='/p/2' class='next'>{locale:next_page}</a>")."</p>";
} else
echo "<h1>{locale:no_more_title}</h1>"
<?php
if ($blog->entries)
{
while ($data = $blog->entries())
{
$entry_init = entry_show_init($data['entryContent'], $data['entrySlug']);
echo "<article".($data['entryPinned'] ? ' class="pinned"' : '').(strlen(strip_tags($entry_init)) <= 210 ? ' class="tweet"' : '')." title='".show_date($data['entryPublished'])."'>
<header>
<h2><a href='".get_entry_link($data['entrySlug'])."'>".htmlspecialchars($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></p>
</header>
<div class='content'>".$entry_init."</div>
</article>\n";
unset($entry_init);
}
echo "<p class='paginator'>".(isset($seo[1]) && isnum($seo[1]) ? "<a href='/p/".($seo[1]-1)."' class='prev'>{locale:prev_page}</a><a href='/p/".($seo[1]+1)."' class='next'>{locale:next_page}</a>" : "<a href='/p/2' class='next'>{locale:next_page}</a>")."</p>";
} else
echo "<h1>{locale:no_more_title}</h1>"
."<p>{locale:no_more}</p>\n";

View File

@ -1,31 +1,31 @@
<?php
if ($blog->entries)
while ($data = $blog->entry())
{
addTitle($data['entryTitle']);
if ($data['entryHidden']) echo "<p>{locale:hidden_content}</p>";
if ($data['entryPIN'] && get_pin() != $data['entryPIN'])
echo "<p>{locale:pin_protected_content}</p>
<form action='".get_entry_link($data['entrySlug'])."' method='post' name='entry-pin-input'>
<input type='text' name='read_entry_pin' placeholder='{locale:entry_pin}' />
<button type='submit'>{locale:unlock}</button>
</form>";
else
{
addDescription(entry_show_init($data['entryContent'], $data['entrySlug']));
addImage((preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $data['entryContent'], $images) ? $images[1] : 0));
headerImage($data['entryHeader']);
echo "<article class='full'>
".(strlen($data['entryTitle']) > 50 ? "<h2>".htmlspecialchars($data['entryTitle'])."</h2>" : null)."
<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>
<div class='content'>".entry_show_all($data['entryContent'])."</div>
<p clasS='meta'>".get_entry_admin($data)."</p>
</article>\n";
}
}
else
echo "<h1>{locale:entry_not_found_title}</h1>"
."<p>{locale:entry_not_found}</p>\n";
<?php
if ($blog->entries)
while ($data = $blog->entry())
{
addTitle($data['entryTitle']);
if ($data['entryHidden']) echo "<p>{locale:hidden_content}</p>";
if ($data['entryPIN'] && get_pin() != $data['entryPIN'])
echo "<p>{locale:pin_protected_content}</p>
<form action='".get_entry_link($data['entrySlug'])."' method='post' name='entry-pin-input'>
<input type='text' name='read_entry_pin' placeholder='{locale:entry_pin}' />
<button type='submit'>{locale:unlock}</button>
</form>";
else
{
addDescription(entry_show_init($data['entryContent'], $data['entrySlug']));
addImage((preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $data['entryContent'], $images) ? $images[1] : 0));
headerImage($data['entryHeader']);
echo "<article class='full'>
".(strlen($data['entryTitle']) > 50 ? "<h2>".htmlspecialchars($data['entryTitle'])."</h2>" : null)."
<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>
<div class='content'>".entry_show_all($data['entryContent'])."</div>
<p clasS='meta'>".get_entry_admin($data)."</p>
</article>\n";
}
}
else
echo "<h1>{locale:entry_not_found_title}</h1>"
."<p>{locale:entry_not_found}</p>\n";

View File

@ -1,8 +1,8 @@
<?php
if ($page->readable())
{
addTitle($page->data['pageTitle']);
echo "<article>".entry_show_all($page->data['pageContent'])."</article>";
} else
<?php
if ($page->readable())
{
addTitle($page->data['pageTitle']);
echo "<article>".entry_show_all($page->data['pageContent'])."</article>";
} else
echo "<h2>$_locale[page_not_found]</h2><p>$_locale[page_not_found_text]</p>";

View File

@ -1,46 +1,46 @@
<div class="profile">
<h3><?=$userData['userName'].($me ? ' <a href="'.get_current_link().'/edit" class="edit">{locale:profile_edit}</a>' : '')?></h3>
<div id="profile_pic" style="background-image: url('<?=get_profile_picture($userData)?>')">
<?php if ($me) : ?>
<form action="<?=get_current_link()?>" method="post" name="userpic-upload" enctype="multipart/form-data">
<input type="file" name="userPic" id="userPicInput" style="display: none" />
<button type="button" onclick="$('#userPicInput').focus().click()">{locale:browse}</button><button type="submit" id="userPicSaveBtn" class="orange">{locale:delete}</button>
</form>
<script>
$("#userPicInput").change(function() {
$("#userPicSaveBtn").html('{locale:save}').removeClass('orange');
});
</script>
<?php endif ?>
</div>
<?php if (LOGGEDIN) : ?>
<div class='box contact'>
<p><strong>{locale:name}:</strong> <?=$userData['userRealName']?></p>
<p><strong>{locale:email}:</strong> <?=$userData['userEmail']?></p>
<?=($userData['userWeb'] ? '<p><strong>{locale:web}:</strong> '.$userData['userWeb'].'</p>' : null)?>
</div>
<?php endif ?>
<?php
$recent = $_sql->query("SELECT entrySlug, entryTitle FROM entries WHERE entryBy = $userData[userId] AND entryPublished <= ".time()." ORDER BY entryPublished DESC LIMIT 5");
if ($recent->num_rows) : ?>
<div class='box recent'>
<?php
while ($data = $recent->fetch_assoc())
echo "<p><a href='".get_entry_link($data['entrySlug'])."'>".trimlink($data['entryTitle'], 42)."</a></p>\n";
?>
</div>
<?php endif; unset($recent); ?>
<div style="clear: both"></div>
<?php if ($userData['userIntroduction']) : ?>
<div class='box introduction'>
<p><?=$userData['userIntroduction']?></p>
</div>
<div style="clear: both"></div>
<?php endif ?>
<div class="clear"></div>
</div>
<div class="profile">
<h3><?=$userData['userName'].($me ? ' <a href="'.get_current_link().'/edit" class="edit">{locale:profile_edit}</a>' : '')?></h3>
<div id="profile_pic" style="background-image: url('<?=get_profile_picture($userData)?>')">
<?php if ($me) : ?>
<form action="<?=get_current_link()?>" method="post" name="userpic-upload" enctype="multipart/form-data">
<input type="file" name="userPic" id="userPicInput" style="display: none" />
<button type="button" onclick="$('#userPicInput').focus().click()">{locale:browse}</button><button type="submit" id="userPicSaveBtn" class="orange">{locale:delete}</button>
</form>
<script>
$("#userPicInput").change(function() {
$("#userPicSaveBtn").html('{locale:save}').removeClass('orange');
});
</script>
<?php endif ?>
</div>
<?php if (LOGGEDIN) : ?>
<div class='box contact'>
<p><strong>{locale:name}:</strong> <?=$userData['userRealName']?></p>
<p><strong>{locale:email}:</strong> <?=$userData['userEmail']?></p>
<?=($userData['userWeb'] ? '<p><strong>{locale:web}:</strong> '.$userData['userWeb'].'</p>' : null)?>
</div>
<?php endif ?>
<?php
$recent = $_sql->query("SELECT entrySlug, entryTitle FROM entries WHERE entryBy = $userData[userId] AND entryPublished <= ".time()." ORDER BY entryPublished DESC LIMIT 5");
if ($recent->num_rows) : ?>
<div class='box recent'>
<?php
while ($data = $recent->fetch_assoc())
echo "<p><a href='".get_entry_link($data['entrySlug'])."'>".trimlink($data['entryTitle'], 42)."</a></p>\n";
?>
</div>
<?php endif; unset($recent); ?>
<div style="clear: both"></div>
<?php if ($userData['userIntroduction']) : ?>
<div class='box introduction'>
<p><?=$userData['userIntroduction']?></p>
</div>
<div style="clear: both"></div>
<?php endif ?>
<div class="clear"></div>
</div>
<div class="clear"></div>

View File

@ -1,18 +1,18 @@
<?php
if ($tagged->num_rows)
{
$tag = $tagged->fetch_assoc();
addTitle($tag['tagName']);
if ($entries->num_rows)
{
while ($data = $entries->fetch_assoc())
echo "<h3><a href='".get_entry_link($data['entrySlug'])."'>".htmlspecialchars(trimlink($data['entryTitle'],90))."</a></h3>"
."<p>".show_date($data['entryPublished'])."</p>";
}
} else
redirect();
unset($tag);
unset($tagged);
<?php
if ($tagged->num_rows)
{
$tag = $tagged->fetch_assoc();
addTitle($tag['tagName']);
if ($entries->num_rows)
{
while ($data = $entries->fetch_assoc())
echo "<h3><a href='".get_entry_link($data['entrySlug'])."'>".htmlspecialchars(trimlink($data['entryTitle'],90))."</a></h3>"
."<p>".show_date($data['entryPublished'])."</p>";
}
} else
redirect();
unset($tag);
unset($tagged);
unset($entries);