Skip to content

Commit fccce56

Browse files
author
Echo
committed
new theme and features
1 parent 4a5dbc9 commit fccce56

23 files changed

+899
-1
lines changed

admin/boot/rules/98-constants.bit

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ define('NIBBLEBLOG_BUILD', 1391376286);
2121
// =====================================================================
2222
// DEBUG
2323
// =====================================================================
24-
define('DEBUG_MODE', FALSE);
24+
define('DEBUG_MODE', TRUE);
2525

2626
error_reporting(0);
2727

admin/kernel/db/db_posts.class.php

+31
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,37 @@ public function slug($id_post, $slug)
382382
$this->slug_add($id_post, $slug);
383383
}
384384

385+
public function prev_next_post($id_post)
386+
{
387+
// Set only published post
388+
$this->set_files_by_published();
389+
390+
$filename['prev'] = false;
391+
$filename['next'] = false;
392+
393+
$i = 0;
394+
395+
while($this->files_count>$i)
396+
{
397+
$explode = explode(".",$this->files[$i]);
398+
399+
$id = (int)$explode[1];
400+
401+
if($id==$id_post)
402+
{
403+
$filename['prev'] = isset($this->files[$i+1])?$this->files[$i+1]:false;
404+
$filename['next'] = isset($this->files[$i-1])?$this->files[$i-1]:false;
405+
}
406+
407+
$i = $i + 1;
408+
}
409+
410+
$tmp['prev'] = $filename['prev']==false?false:$this->get_items($filename['prev']);
411+
$tmp['next'] = $filename['next']==false?false:$this->get_items($filename['next']);
412+
413+
return $tmp;
414+
}
415+
385416
/*
386417
========================================================================
387418
PRIVATE METHODS

index.php

+4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@
2323
foreach($plugins as $plugin)
2424
$plugin->boot();
2525

26+
// Theme init.bit
27+
if(file_exists(THEME_ROOT.'init.bit'))
28+
include(THEME_ROOT.'init.bit');
29+
2630
// Load the controller if set
2731
if(file_exists(THEME_CONTROLLERS.$layout['controller']))
2832
require(THEME_CONTROLLERS.$layout['controller']);

themes/medium/config.bit

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
3+
$theme = array
4+
(
5+
'name'=>'Medium',
6+
'description'=>'Insipire on the theme from medium.com',
7+
'notes'=>'Disqus and Facebook commments supported',
8+
'author'=>'Diego Najar',
9+
'version'=>'4.0',
10+
'last_update'=>'08/02/2014', // dd/mm/yyyy
11+
'url'=>'http://www.nibbleblog.com', // http://xxxxxxxxxxxxx
12+
'template'=>array('blog'=>'default.bit', 'post'=>'default.bit', 'page'=>'default.bit'),
13+
'version_supported'=>array('4.0', '4.0.1') // Nibbleblog version supported
14+
);
15+
16+
$remove_image = true;
17+
18+
?>
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
$dom = new DOMDocument();
4+
5+
// Force to load the content in UTF-8
6+
$dom->loadHTML('<meta http-equiv="content-type" content="text/html; charset=utf-8">'.$post['content'][0]);
7+
8+
$finder = new DomXPath($dom);
9+
$classname = "nb-align-center";
10+
$images = $finder->query("//*[contains(@class, '$classname')]");
11+
12+
if($images->length>0)
13+
{
14+
$image = $images->item(0);
15+
$cover_image = $image->getAttribute('src');
16+
17+
if($remove_image)
18+
{
19+
$image->parentNode->removeChild($image);
20+
$post['content'][0] = $dom->saveHTML();
21+
}
22+
}
23+
else
24+
{
25+
// Default cover image if the post doesn't have
26+
$cover_image = HTML_THEME_IMG.'cover.jpg';
27+
}
28+
29+
?>

themes/medium/css/img/console.png

212 Bytes
Loading

themes/medium/css/img/cover.jpg

128 KB
Loading

themes/medium/css/img/favicon.ico

1.12 KB
Binary file not shown.

themes/medium/css/img/image.png

5.5 KB
Loading

themes/medium/css/main.css

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
/*
2+
========================================================================
3+
BLOG :: Body
4+
========================================================================
5+
*/
6+
7+
body {
8+
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
9+
background-color: #FFFFFF;
10+
margin: 0;
11+
padding: 0;
12+
font-size: 62.5%;
13+
color: #333;
14+
}
15+
16+
a {
17+
color: #006AC8;
18+
cursor: pointer;
19+
text-decoration: none;
20+
}
21+
22+
a:hover {
23+
text-decoration: underline;
24+
}
25+
26+
/*
27+
========================================================================
28+
BLOG :: Footer
29+
========================================================================
30+
*/
31+
32+
#blog-foot {
33+
text-align: right;
34+
font-size: 1.1em;
35+
}
36+
37+
/*
38+
========================================================================
39+
BLOG :: Page 404
40+
========================================================================
41+
*/
42+
43+
div.page_404 {
44+
45+
}
46+
47+
48+
/*
49+
========================================================================
50+
BLOG :: Pager
51+
========================================================================
52+
*/
53+
54+
#pager {
55+
font-size: 1.4em;
56+
margin: 30px auto;
57+
overflow: auto;
58+
text-align: center;
59+
width: 900px;
60+
}
61+
62+
#pager a.next-page {
63+
float: right;
64+
background: #EEE;
65+
padding: 10px;
66+
border-radius: 2px;
67+
}
68+
69+
#pager a.prev-page {
70+
float: left;
71+
background: #EEE;
72+
padding: 10px;
73+
border-radius: 2px;
74+
}

themes/medium/css/normalize.css

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*! normalize.css v2.0.1 | MIT License | git.io/normalize */
2+
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block}
3+
audio,canvas,video{display:inline-block}
4+
audio:not([controls]){display:none;height:0}
5+
[hidden]{display:none}
6+
html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}
7+
a:focus{outline:thin dotted}
8+
a:active,a:hover{outline:0}
9+
h1{font-size:2em}
10+
abbr[title]{border-bottom:1px dotted}
11+
b,strong{font-weight:700}
12+
dfn{font-style:italic}
13+
mark{background:#ff0;color:#000}
14+
code,kbd,pre,samp{font-family:monospace, serif;font-size:1em}
15+
pre{white-space:pre-wrap;word-wrap:break-word}
16+
q{quotes:\201C \201D \2018 \2019}
17+
small{font-size:80%}
18+
sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
19+
sup{top:-.5em}
20+
sub{bottom:-.25em}
21+
img{border:0}
22+
svg:not(:root){overflow:hidden}
23+
fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
24+
button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
25+
button,input{line-height:normal}
26+
button,html input[type=button],/* 1 */
27+
input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
28+
button[disabled],input[disabled]{cursor:default}
29+
input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}
30+
input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}
31+
input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}
32+
textarea{overflow:auto;vertical-align:top}
33+
table{border-collapse:collapse;border-spacing:0}
34+
body,figure{margin:0}
35+
legend,button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}

themes/medium/css/page.css

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
/*
2+
========================================================================
3+
PAGE
4+
========================================================================
5+
*/
6+
7+
article.page {
8+
margin-bottom: 60px;
9+
overflow: hidden;
10+
}
11+
12+
/*
13+
========================================================================
14+
PAGE :: Head
15+
========================================================================
16+
*/
17+
18+
article.page header {
19+
padding: 0;
20+
margin: 0;
21+
}
22+
23+
article.page header h1.page-title {
24+
font-size: 2em;
25+
margin: 0;
26+
color: #2986D2;
27+
font-weight: normal;
28+
}
29+
/*
30+
========================================================================
31+
PAGE :: Content
32+
========================================================================
33+
*/
34+
35+
article.page div.page-content pre {
36+
border: 1px dashed #ccc;
37+
}
38+
39+
article.page div.page-content .nb-code {
40+
border-style: solid !important;
41+
}
42+
43+
article.page div.page-content .console,
44+
article.page div.page-content .nb-console {
45+
background: url("img/console.png") no-repeat scroll 8px 8px #F1F1F1;
46+
display: block;
47+
line-height: 24px;
48+
margin: 5px 0;
49+
overflow: auto;
50+
padding-left: 38px;
51+
white-space: nowrap;
52+
border: 1px solid #ccc;
53+
}
54+
55+
article.page div.page-content img:not(.captcha) {
56+
max-width:100%;
57+
}
58+
59+
article.page div.page-content img.align_left {
60+
margin: 5px 10px 5px 0px;
61+
float: left;
62+
}
63+
64+
article.page div.page-content img.align_right {
65+
margin: 5px 0px 5px 10px;
66+
float: right;
67+
}
68+
69+
article.page div.page-content blockquote {
70+
font-size: 1.1em;
71+
font-style: italic;
72+
73+
}
74+
75+
article.page div.page-content h1,
76+
article.page div.page-content h2,
77+
article.page div.page-content h3,
78+
article.page div.page-content h4,
79+
article.page div.page-content h5 {
80+
font-weight: normal;
81+
color: #333333;
82+
margin: 22px 0 13px 0;
83+
padding: 0;
84+
}
85+
86+
article.page div.page-content h1 {
87+
font-size: 1.8em;
88+
}
89+
90+
article.page div.page-content p {
91+
line-height: 1.5em;
92+
}
93+
94+
article.page div.page-content .video-embed {
95+
position: relative;
96+
padding-bottom: 56.25%;
97+
padding-top: 30px;
98+
height: 0;
99+
overflow: hidden;
100+
margin: 13px 0;
101+
}
102+
103+
article.page div.page-content .video-embed iframe,
104+
article.page div.page-content .video-embed object,
105+
article.page div.page-content .video-embed embed {
106+
position: absolute;
107+
top: 0;
108+
left: 0;
109+
width: 100%;
110+
height: 100%;
111+
}

0 commit comments

Comments
 (0)