API Plugin, bug fixed

This commit is contained in:
dignajar 2016-10-19 16:57:10 -03:00
parent 3079bbbd76
commit 5ff7511863
16 changed files with 8902 additions and 5 deletions

View File

@ -112,7 +112,6 @@ function buildPostsForPage($pageNumber=0, $amount=POSTS_PER_PAGE_ADMIN, $removeU
// PAGE FUNCTIONS
// ----------------------------------------------------------------------------
function sortPages($a, $b)
{
if ($a['position'] == $b['position']) {

View File

@ -18,7 +18,7 @@ class Theme {
return $tmp;
}
public static function css($files, $path=HTML_PATH_THEME_CSS, $echo=true)
public static function css($files, $path=DOMAIN_THEME_CSS, $echo=true)
{
if(!is_array($files)) {
$files = array($files);

View File

@ -178,7 +178,7 @@ class pluginAPI extends Plugin {
}
// Remove the first part of the URI
$URI = ltrim($URI, HTML_PATH_ROOT.'api/');
$URI = mb_substr($URI, $length)
// Parameters
// ------------------------------------------------------------
@ -206,8 +206,6 @@ class pluginAPI extends Plugin {
'message'=>'Check the parameters'
));
if($parameters[0]==='show') {
if($parameters[1]==='all') {

View File

@ -0,0 +1,64 @@
.bl-list {
margin: 20px 0;
}
.bl-container-title {
padding: 7em 0;
}
.bl-container-main {
padding-bottom: 7em;
}
.bl-author img {
max-width: 50%;
border-radius: 150px;
}
.bl-author .name {
margin-top: 10px;
margin-bottom: 4px;
}
.bl-author .social a {
font-size: 0.9em;
}
.plugin-content ul {
list-style: none;
padding: 0 5px;
}
a.page-parent {
color: #000;
}
/*
Page and post content
------------------------------------------------
*/
.bl-page-post-content p {
margin-bottom: 10px;
}
.bl-page-post-content ul {
}
.bl-page-post-content h1,
.bl-page-post-content h2,
.bl-page-post-content h3,
.bl-page-post-content h4,
.bl-page-post-content h5,
.bl-page-post-content h6 {
margin: 0 0 20px 0;
}
.bl-page-post-content h1:not(:first-child),
.bl-page-post-content h2:not(:first-child),
.bl-page-post-content h3:not(:first-child),
.bl-page-post-content h4:not(:first-child),
.bl-page-post-content h5:not(:first-child),
.bl-page-post-content h6:not(:first-child) {
margin-top: 40px;
}

File diff suppressed because it is too large Load Diff

115
bl-themes/klean/index.php Normal file
View File

@ -0,0 +1,115 @@
<!DOCTYPE html>
<head>
<?php
// Include the php file ../php/head.php
include(THEME_DIR_PHP.'head.php');
?>
</head>
<body>
<!-- Header
- Logo
- Home link
-->
<header id="fh5co-header" role="banner">
<nav class="navbar navbar-default" role="navigation">
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<!-- Logo
-->
<div class="navbar-header">
<a class="navbar-brand" href="<?php echo $Site->url() ?>"><?php echo $Site->title() ?></a>
</div>
<!-- Links
-->
<div id="fh5co-navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="<?php echo $Site->url() ?>"><span>Home <span class="border"></span></span></a></li>
</ul>
</div>
</div>
</div>
</div>
</nav>
</header>
<!-- Main
- Home page
- Page list
- Post list
-->
<div id="fh5co-main">
<!-- Main
-->
<?php
if( ($Url->whereAmI()=='home') || ($Url->whereAmI()=='tag') || ($Url->whereAmI()=='blog') ) {
include(THEME_DIR_PHP.'home.php');
}
elseif($Url->whereAmI()=='post') {
include(THEME_DIR_PHP.'post.php');
}
elseif($Url->whereAmI()=='page') {
include(THEME_DIR_PHP.'page.php');
}
?>
<!-- Show plugins
-->
<div id="fh5co-services">
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="row">
<?php
foreach($plugins['siteSidebar'] as $Plugin) {
echo '<div class="col-md-4 col-sm-6 col-xs-6 col-xxs-12 fh5co-service">';
echo '<div class="fh5co-desc">';
echo $Plugin->siteSidebar();
echo '</div>';
echo '</div>';
}
?>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Footer
-->
<footer id="fh5co-footer">
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1 text-center">
<p><?php echo $Site->footer() ?> <br> Powered by <a href="https://www.bludit.com" target="_blank">BLUDIT</a></p>
</div>
</div>
</div>
</footer>
<!-- Javascript
-->
<?php
Theme::jquery();
Theme::javascript('jquery.waypoints.min.js');
Theme::javascript('main.js');
?>
<!-- Load plugins
- Hook: Site body end
-->
<?php
Theme::plugins('siteBodyEnd');
?>
</body>
</html>

5
bl-themes/klean/init.php Normal file
View File

@ -0,0 +1,5 @@
<?php
define('PARENT_PAGES_LINK', false);
?>

File diff suppressed because one or more lines are too long

131
bl-themes/klean/js/main.js Normal file
View File

@ -0,0 +1,131 @@
;(function () {
'use strict';
// iPad and iPod detection
var isiPad = function(){
return (navigator.platform.indexOf("iPad") != -1);
};
var isiPhone = function(){
return (
(navigator.platform.indexOf("iPhone") != -1) ||
(navigator.platform.indexOf("iPod") != -1)
);
};
// Burger Menu
var burgerMenu = function() {
$('body').on('click', '.js-fh5co-nav-toggle', function(){
if ( $('#fh5co-navbar').is(':visible') ) {
$(this).removeClass('active');
} else {
$(this).addClass('active');
}
});
};
// Animate Projects
var animateBox = function() {
if ( $('.animate-box').length > 0 ) {
$('.animate-box').waypoint( function( direction ) {
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
$(this.element).addClass('fadeIn animated');
}
} , { offset: '80%' } );
}
};
// Animate Leadership
var animateTeam = function() {
if ( $('#fh5co-team').length > 0 ) {
$('#fh5co-team .to-animate').each(function( k ) {
var el = $(this);
setTimeout ( function () {
console.log('yaya');
el.addClass('fadeInUp animated');
}, k * 200, 'easeInOutExpo' );
});
}
};
var teamWayPoint = function() {
if ( $('#fh5co-team').length > 0 ) {
$('#fh5co-team').waypoint( function( direction ) {
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
setTimeout(animateTeam, 200);
$(this.element).addClass('animated');
}
} , { offset: '80%' } );
}
};
// Animate Feature
var animateFeatureIcons = function() {
if ( $('#fh5co-services').length > 0 ) {
$('#fh5co-services .to-animate').each(function( k ) {
var el = $(this);
setTimeout ( function () {
el.addClass('bounceIn animated');
}, k * 200, 'easeInOutExpo' );
});
}
};
var featureIconsWayPoint = function() {
if ( $('#fh5co-services').length > 0 ) {
$('#fh5co-services').waypoint( function( direction ) {
if( direction === 'down' && !$(this.element).hasClass('animated') ) {
setTimeout(animateFeatureIcons, 200);
$(this.element).addClass('animated');
}
} , { offset: '80%' } );
}
};
$(function(){
burgerMenu();
animateBox();
teamWayPoint();
featureIconsWayPoint();
});
}());

View File

@ -0,0 +1,7 @@
{
"theme-data":
{
"name": "Klean",
"description": "Based on the theme Clean, minimalist, fast, and klean."
}
}

View File

@ -0,0 +1,7 @@
{
"theme-data":
{
"name": "Klean",
"description": "Basado en el tema Clean, minimalista, rapido y limpio."
}
}

View File

@ -0,0 +1,10 @@
{
"author": "FREEHTML5.co",
"email": "",
"website": "https://freehtml5.co/",
"version": "16.10.13",
"releaseDate": "2016-10-13",
"license": "",
"compatible": "1.5.2",
"notes": "Responsive theme for Bludit adapted by Diego."
}

View File

@ -0,0 +1,32 @@
<?php
// <meta charset="utf-8">
Theme::charset('utf-8');
// <meta name="viewport" content="width=device-width, initial-scale=1">
Theme::viewport('width=device-width, initial-scale=1');
// <title>...</title>
Theme::title();
// <meta name="description" content=".....">
Theme::description();
// <link rel="shortcut icon" href="favicon.png">
Theme::favicon('favicon.png');
// CSS files
Theme::css('style.css');
Theme::css('bludit.css');
?>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- Google Webfont
-->
<link href='//fonts.googleapis.com/css?family=Roboto:400,300,100,500' rel='stylesheet' type='text/css'>
<link href='//fonts.googleapis.com/css?family=Roboto+Slab:400,300,100,500' rel='stylesheet' type='text/css'>
<!-- Load plugins
- Hook: Site head
-->
<?php Theme::plugins('siteHead') ?>

View File

@ -0,0 +1,59 @@
<?php
// PRINT PAGES and SUB-PAGES
// ------------------------------------------------------
foreach($parents as $Parent) {
echo '<div class="bl-list">';
echo '<div class="container">';
echo '<div class="row">';
echo '<div class="col-md-12 text-center">';
if(PARENT_PAGES_LINK) {
echo '<h1><a class="page-parent" href="'.$Parent->permalink().'">'.$Parent->title().'</a></h1>';
} else {
echo '<h1>'.$Parent->title().'</h1>';
}
// Check if the parent has children
if( isset( $pagesParents[ $Parent->key() ] ) ) {
// Get the children of the parent
$children = $pagesParents[ $Parent->key() ];
echo '<ul class="list-unstyled">';
// Foreach child
foreach( $children as $Child ) {
if( $Child->published() ) {
echo '<li><h4><a href="'.$Child->permalink().'">'.$Child->title().'</a></h4></li>';
}
}
echo '</ul>';
}
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
echo '<hr>';
foreach($posts as $Post) {
echo '<div class="bl-list">';
echo '<div class="container">';
echo '<div class="row">';
echo '<div class="col-md-12 text-center">';
echo '<h1><a href="'.$Post->permalink().'">'.$Post->title().'</a></h1>';
echo '<h4>Posted on '.$Post->date().'</h4>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
}
?>

View File

@ -0,0 +1,101 @@
<!-- Page title and description
-->
<div class="bl-container-title text-center">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 class="title"><?php echo $Page->title() ?></h1>
<p class="description"><?php echo $Page->description() ?></p>
</div>
</div>
</div>
</div>
<!-- Page content and author
-->
<div class="bl-container-main">
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="row">
<!-- Author
-->
<div class="col-md-3 col-md-push-9">
<div class="bl-author text-center">
<?php
$User = $Page->user();
$author = $User->username();
if( Text::isNotEmpty($User->firstName()) || Text::isNotEmpty($User->lastName()) ) {
$author = $User->firstName().' '.$User->lastName();
}
?>
<!-- Author profile
-->
<img src="<?php echo $User->profilePicture() ?>" alt="">
<!-- Author name
-->
<h4 class="name"><?php echo $author ?></h4>
<!-- Social networks
-->
<?php
if( Text::isNotEmpty( $User->twitter()) )
echo '<div class="social"><a href="'.$User->twitter().'">Twitter</a></div>';
if( Text::isNotEmpty( $User->facebook()) )
echo '<div class="social"><a href="'.$User->facebook().'">Facebook</a></div>';
if( Text::isNotEmpty( $User->googleplus()) )
echo '<div class="social"><a href="'.$User->googleplus().'">Google+</a></div>';
if( Text::isNotEmpty( $User->instagram()) )
echo '<div class="social"><a href="'.$User->instagram().'">Instagram</a></div>';
?>
</div>
</div>
<!-- Page content
-->
<div class="col-md-9 col-md-pull-3">
<!-- Load plugins
- Hook: Page Begin
-->
<?php Theme::plugins('pageBegin') ?>
<!-- Cover Image
-->
<?php
if( $Page->coverImage() ) {
echo '<div class="bl-cover-image">';
echo '<img src="'.$Page->coverImage().'" alt="Cover Image">';
echo '</div>';
}
?>
<!-- Page content
- The flag TRUE is to get the full content.
- This content is Markdown parsed.
-->
<div class="bl-page-post-content">
<?php echo $Page->content(true) ?>
</div>
<!-- Load plugins
- Hook: Page End
-->
<?php Theme::plugins('pageEnd') ?>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,101 @@
<!-- Post title and description
-->
<div class="bl-container-title text-center">
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<h1 class="title"><?php echo $Post->title() ?></h1>
<p class="description"><?php echo $Post->description() ?></p>
</div>
</div>
</div>
</div>
<!-- Post content and author
-->
<div class="bl-container-main">
<div class="container">
<div class="row">
<div class="col-md-10 col-md-offset-1">
<div class="row">
<!-- Author
-->
<div class="col-md-3 col-md-push-9">
<div class="bl-author text-center">
<?php
$User = $Post->user();
$author = $User->username();
if( Text::isNotEmpty($User->firstName()) || Text::isNotEmpty($User->lastName()) ) {
$author = $User->firstName().' '.$User->lastName();
}
?>
<!-- Author profile
-->
<img src="<?php echo $User->profilePicture() ?>" alt="">
<!-- Author name
-->
<h4 class="name"><?php echo $author ?></h4>
<!-- Social networks
-->
<?php
if( Text::isNotEmpty( $User->twitter()) )
echo '<div class="social"><a href="'.$User->twitter().'">Twitter</a></div>';
if( Text::isNotEmpty( $User->facebook()) )
echo '<div class="social"><a href="'.$User->facebook().'">Facebook</a></div>';
if( Text::isNotEmpty( $User->googleplus()) )
echo '<div class="social"><a href="'.$User->googleplus().'">Google+</a></div>';
if( Text::isNotEmpty( $User->instagram()) )
echo '<div class="social"><a href="'.$User->instagram().'">Instagram</a></div>';
?>
</div>
</div>
<!-- Post content
-->
<div class="col-md-9 col-md-pull-3">
<!-- Load plugins
- Hook: Post Begin
-->
<?php Theme::plugins('pageBegin') ?>
<!-- Cover Image
-->
<?php
if( $Post->coverImage() ) {
echo '<div class="bl-cover-image">';
echo '<img src="'.$Post->coverImage().'" alt="Cover Image">';
echo '</div>';
}
?>
<!-- Post content
- The flag TRUE is to get the full content.
- This content is Markdown parsed.
-->
<div class="bl-page-post-content">
<?php echo $Post->content(true) ?>
</div>
<!-- Load plugins
- Hook: Post End
-->
<?php Theme::plugins('pageEnd') ?>
</div>
</div>
</div>
</div>
</div>
</div>