1
0
This commit is contained in:
Chicory ☕ 2024-07-13 19:19:16 +03:00
commit 5e5f659777
Signed by: chicory
GPG Key ID: AC95A793F70BEDCD
42 changed files with 4035 additions and 0 deletions

175
LICENSE Normal file
View File

@ -0,0 +1,175 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.

213
NOTICE Normal file
View File

@ -0,0 +1,213 @@
/*-----------------------------------------------------------------------------
Roboto font
Copyright: Google Inc. 2015
URL: https://github.com/googlefonts/roboto
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
/*-----------------------------------------------------------------------------
Parsedown
Copyright: Emanuil Rusev http://erusev.com
URL: http://parsedown.org
License: The MIT License (MIT)
-----------------------------------------------------------------------------*/
The MIT License (MIT)
Copyright (c) 2013-2018 Emanuil Rusev, erusev.com
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

53
README.md Normal file
View File

@ -0,0 +1,53 @@
## orblog (0.1.1) [Deprecated]
Simple blog for hidden services (like tor / i2p) with markdown support.
## Comment
It was written in 2 evenings in 2020 to complete one small personal task. There will be no updating or development.
!**Use only at your own risk!**
## Features
* Without JavaScript.
* Posts with markdown support.
* Comments with markdown support.
* Categories.
* View posts by tags.
* RSS feed
## System requirements
* PHP 7.3 +
* GDLib
* SQLite3
## Run
```
git clone https://code.fossee.net/chicory/orblog-legacy.git
cd orblog
php -S 127.0.0.1:8000
```
**Admin panel:**
```
hostname/?view=admin
password: changeme
```
## Installation
* Edit config file (./config.php).
* Set permissions.
* For ./private/data 775
* For ./private/data/data.sqlite 664
* For other files 644
* Deny access to ./private directory at web server.
* Open your_domain/?view=admin in web browser.
## Screenshots
### Main page
![Main page](./screeshots/main.png)
### Comment
![Comment](./screeshots/comment.png)
### Amin panel post adding
![Amin panel post adding](./screeshots/admin_add_post.png)
### Amin panel categories management
![Amin panel categories management](./screeshots/admin_category.png)
### Amin panel comments moderation
![Amin panel comments moderation](./screeshots/admin_comments.png)

24
captcha.php Normal file
View File

@ -0,0 +1,24 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
session_name('SESSID');
session_start();
$captcha = imagecreate(80, 30);
imagecolorallocate($captcha, 255, 255, 255);
$color = imagecolorallocate($captcha, 60, 60, 60);
imagettftext($captcha, 16, 0, 6, 22, $color,
'public/style/roboto.ttf', $_SESSION['captcha']);
header('Content-type: image/png');
imagepng($captcha);

45
config.php Normal file
View File

@ -0,0 +1,45 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
// Path to database.
define('DATABASE', 'private/data/data.sqlite');
// URL with ending "/".
define('URL', 'http://orblog.local/');
// Language (en, ru).
define('LANG', 'en');
// Admin password.
define('PASS', 'changeme');
// Title.
define('TITLE', 'orblog - simple blog');
// Text logo in header.
define('TEXTLOGO','orblog');
// Header text.
define('H_DESC', 'Simple blog for hidden services with markdown support. Read README.md for more info or visit <a href="https://code.fossee.net/chicory/orblog-legacy">https://code.fossee.net/chicory/orblog-legacy</a>');
// Copyright.
define('COPY', 'orblog 2020');
// Max. posts per page.
define('MAXPOSTS', 10);
// Allow comments.
define('COMMENTS', true);
// Antiflood.
define('ANTIFLOOD', 30);

40
index.php Normal file
View File

@ -0,0 +1,40 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
include_once 'config.php';
include_once 'private/libs/functions.php';
include_once 'private/libs/parsedown.php';
include_once 'private/languages/'.LANG.'.php';
error_reporting(0);
date_default_timezone_set('UTC');
session_name('SESSID');
session_start();
$sqlite = new SQLite3(DATABASE);
$category_dump = $sqlite -> query('SELECT * FROM `categories`
ORDER BY `sort` ASC');
if (!empty($_GET['view'])) {
$view = preg_replace("/[^a-zA-Z_\-\d]/ui", "", $_GET['view']);
if (file_exists('private/pages/'.$view.'.php')) {
include 'private/pages/'.$view.'.php';
} else {
include 'private/pages/404.php';
}
} else {
include 'private/pages/index.php';
}
$_TPL['category_list'] = view_categories($category_dump);
include_template('footer');

BIN
private/data/data.sqlite Normal file

Binary file not shown.

63
private/languages/en.php Normal file
View File

@ -0,0 +1,63 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
$_LANG = [
'prev_page' => 'later',
'next_page' => 'earlier',
'categories' => 'Categories',
'without_cat' => 'Without category',
'all_posts' => 'All posts',
'comments' => 'Comments',
'add_comment' => 'Add a comment',
'comment_text' => 'Comment text. Markdown is supported.',
'by_guest' => 'by Guest',
'by_admin' => 'by Administrator',
'input_captcha' => 'Enter captcha',
'submit' => 'Submit',
'empty_category' => 'There\'s nothing here',
'post_title' => 'Title',
'post_desc' => 'Short description',
'post_text' => 'Full text',
'post_tags' => 'Tags separated by spaces',
'tags' => 'Tags',
'error_404' => 'Page not found',
'error_404_text' => '<h1>The server could not find page.</h1>Alternatively, you can visit the <a href="'.URL.'">home page</a>.',
'error_sign_in' => 'Invalid captcha or password.',
'flood_err' => 'You can add comments no more than once every '.ANTIFLOOD.' sec.',
'comment_err' => 'Invalid captcha or empty comment form.',
'admin' => 'Admin panel',
'input_pass' => 'Enter password',
'sign_in' => 'Sign in',
'sign_out' => 'Sign out',
'add_post' => 'Add post',
'edit_post' => 'Edit post',
'add_category' => 'New category',
'sort_category' => 'Sort ID (integer, default: 0)',
'category_name' => 'Category name',
'edit' => 'edit',
'delete' => 'delete',
'goto_post' => 'goto',
'stats' => 'Statistics',
'all_posts_count' => 'Posts count',
'all_comm_count' => 'Comments count',
];

63
private/languages/ru.php Normal file
View File

@ -0,0 +1,63 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
$_LANG = [
'prev_page' => 'позже',
'next_page' => 'ранее',
'categories' => 'Категории',
'without_cat' => 'Без категории',
'all_posts' => 'Все сообщения',
'comments' => 'Комментарии',
'add_comment' => 'Добавить комментарий',
'comment_text' => 'Текст комментраия. Поддерживается markdown.',
'by_guest' => 'Гость',
'by_admin' => 'Администратор',
'input_captcha' => 'Введите капчу',
'submit' => 'Отправить',
'empty_category' => 'Здесь ничего нет.',
'post_title' => 'Заголовок',
'post_desc' => 'Краткое описание',
'post_text' => 'Полный текст',
'post_tags' => 'Тэги через пробел',
'tags' => 'Тэги',
'error_404' => 'Страница не найдена',
'error_404_text' => '<h1>Сервер не нашел страницу.</h1>Попробуйте посетить <a href="'.URL.'">домашнюю страницу</a>.',
'error_sign_in' => 'Неверная капча или пароль.',
'flood_err' => 'Выможете добавлять сообщения раз в '.ANTIFLOOD.' сек.',
'comment_err' => 'Неверная капча или пустое сообщение.',
'admin' => 'Админ панель',
'input_pass' => 'Ввведите пароль',
'sign_in' => 'Войти',
'sign_out' => 'Выйти',
'add_post' => 'Добавить сообщение',
'edit_post' => 'Редактировать сообщение',
'edit' => 'изменить',
'add_category' => 'Новая категория',
'sort_category' => 'ID сортировки (число, по умолчанию: 0)',
'category_name' => 'Название категории',
'delete' => 'удалить',
'goto_post' => 'перейти',
'stats' => 'Статистика',
'all_posts_count' => 'Всего сообщений',
'all_comm_count' => 'Всего комментариев',
];

130
private/libs/functions.php Normal file
View File

@ -0,0 +1,130 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
function parser ($string)
{
global $parser;
$string = preg_replace('!\t!', ' ', $string);
$string = $parser -> text($string);
return $string;
}
function category_name($category)
{
global $sqlite;
$query = 'SELECT `name` FROM `categories` WHERE id = '.$category;
$name = $sqlite -> querySingle($query);
return $name;
}
function select_categories($result)
{
while ($cat = $result -> fetchArray())
{
$return.= '<option value="'.$cat['id'].'">'.$cat['name'].'</option>
';
}
return $return;
}
function view_categories($result)
{
while ($cat = $result -> fetchArray())
{
$return.= '<a href="index.php?category='.$cat['id'].'">'.$cat['name'].'</a>
';
}
return $return;
}
function view_edit_categories($result)
{
global $_LANG, $_TPL;
while ($cat = $result -> fetchArray())
{
$_TPL['id'] = $cat['id'];
$_TPL['sort'] = $cat['sort'];
$_TPL['name'] = $cat['name'];
include_template('edit_category');
}
}
function view_posts($result)
{
global $_LANG, $_TPL, $parser;
while ($row = $result -> fetchArray())
{
if(!$row['time']) return 0;
$_TPL['id'] = $row['id'];
$_TPL['time'] = date("d.m.y", $row['time']);
$_TPL['title'] = $row['title'];
$_TPL['desc'] = parser($row['desc']);
$_TPL['text'] = parser($row['text']);
$_TPL['tags'] = separate_tags($row['tags']);
$_TPL['comments'] = $row['comments'];
include_template('post_short');
}
}
function separate_tags($string)
{
$tags = explode(' ', $string);
foreach ($tags as &$tag)
if(!empty($tag))
$return.= '<a href="index.php?tag='.$tag.'">@'.$tag.'</a> ';
return $return;
}
function view_comments($result)
{
global $_LANG, $_TPL, $parser;
while ($row = $result -> fetchArray())
{
if(!$row['time']) return 0;
$_TPL['post_id'] = 0;
if($_TPL['id'] != $row['id']) $_TPL['post_id'] = $row['id'];
$_TPL['pid'] = $row['id'];
$_TPL['cid'] = $row['cid'];
$_TPL['time'] = date("d.m.y h:i", $row['time']);
$_TPL['text'] = parser($row['text']);
$_TPL['admin'] = $row['admin'];
include_template('comment');
}
}
function gen_captcha()
{
$letters = '23456789abcdefghjkmnpqrstvwxyz';
$return = substr(str_shuffle($letters), 0, 6);
return $return;
}
function include_template($template)
{
global $_LANG, $_TPL, $parser;
include 'private/templates/'.$template.'.php';
}

1995
private/libs/parsedown.php Normal file

File diff suppressed because it is too large Load Diff

16
private/pages/404.php Normal file
View File

@ -0,0 +1,16 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
$_TPL['title'] = $_LANG['error_404'].' | '.TITLE;
include_template('header');
include_template('404');

201
private/pages/admin.php Normal file
View File

@ -0,0 +1,201 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
/*-- Admin panel auth -----------------------------------------------------*/
if($_GET['auth'] == 'sign_in')
{
if($_POST['pass'] == PASS and $_POST['captcha'] == $_SESSION['captcha'])
$_SESSION['admin'] = 1;
else
$_TPL['error'] = $_LANG['error_sign_in'];
}
if($_GET['auth'] == 'sign_out')
$_SESSION['admin'] = 0;
/*-- Admin panel actions --------------------------------------------------*/
if($_GET['action'] == 'add_post' and $_SESSION['admin']) // Add post
{
$query = 'INSERT INTO `posts`
(time, category, title, desc, text, tags)
VALUES
(:time, :cat, :title, :desc, :text, :tags)';
$stmt = $sqlite -> prepare($query);
$stmt -> bindValue(':time', time(), SQLITE3_INTEGER);
$stmt -> bindValue(':cat', $_POST['category'], SQLITE3_INTEGER);
$stmt -> bindValue(':title', $_POST['title'], SQLITE3_TEXT);
$stmt -> bindValue(':desc', $_POST['desc'], SQLITE3_TEXT);
$stmt -> bindValue(':text', $_POST['text'], SQLITE3_TEXT);
$stmt -> bindValue(':tags', $_POST['tags'], SQLITE3_TEXT);
$stmt->execute();
header('Location:'.URL); exit;
}
if($_GET['action'] == 'edit_post' and $_SESSION['admin']) // Edit post
{
$query = 'SELECT COUNT(*) FROM `comments` WHERE id = '.$_GET['post'];
$count = $sqlite -> querySingle($query);
$query = 'UPDATE `posts` SET
category = :cat,
title = :title,
desc = :desc,
text = :text,
tags = :tags,
comments = :count
WHERE id = :id';
$stmt = $sqlite -> prepare($query);
$stmt -> bindValue(':cat', $_POST['category'], SQLITE3_INTEGER);
$stmt -> bindValue(':title', $_POST['title'], SQLITE3_TEXT);
$stmt -> bindValue(':desc', $_POST['desc'], SQLITE3_TEXT);
$stmt -> bindValue(':text', $_POST['text'], SQLITE3_TEXT);
$stmt -> bindValue(':tags', $_POST['tags'], SQLITE3_TEXT);
$stmt -> bindValue(':count', $count, SQLITE3_INTEGER);
$stmt -> bindValue(':id', $_GET['post'], SQLITE3_INTEGER);
$stmt->execute();
header('Location:'.URL.'/index.php?view=post&id='.$_GET['post']); exit;
}
if($_GET['action'] == 'delete_post' and $_SESSION['admin']) // Del post
{
$query = 'DELETE FROM `posts` WHERE id = '.$_GET['id'];
$sqlite -> exec($query);
$query = 'DELETE FROM `comments` WHERE id = '.$_GET['id'];
$sqlite -> exec($query);
header('Location:'.URL); exit;
}
if($_GET['action'] == 'add_category' and $_SESSION['admin']) // Add category
{
if (!$_POST['sort']) $_POST['sort'] = 0;
$query = 'INSERT INTO `categories`
(sort, name)
VALUES
('.$_POST['sort'].',
"'.$_POST['name'].'")';
$sqlite -> exec($query);
header('Location:'.URL.'index.php?view=admin&page=categories'); exit;
}
if($_GET['action'] == 'edit_category' and $_SESSION['admin']) // Edit category
{
if($_POST['delete'])
{
$query = 'DELETE FROM `categories` WHERE id = '.$_GET['id'];
$sqlite -> exec($query);
header('Location:'.URL.'index.php?view=admin&page=categories'); exit;
}
$query = 'UPDATE `categories` SET
sort = '.$_POST['sort'].',
name = "'.$_POST['name'].'"
WHERE id = '.$_GET['id'];
$sqlite -> exec($query);
header('Location:'.URL.'index.php?view=admin&page=categories'); exit;
}
if($_GET['action'] == 'delete_comment' and $_SESSION['admin']) // Del comment
{
$query = 'DELETE FROM `comments` WHERE cid = '.$_GET['id'];
$sqlite -> exec($query);
$query = 'SELECT COUNT(*) FROM `comments` WHERE id = '.$_GET['post'];
$count = $sqlite -> querySingle($query);
$query = 'UPDATE `posts` SET comments = '.$count.'
WHERE id = '.$_GET['post'];
$sqlite -> exec($query);
header('Location:'.$_SERVER['HTTP_REFERER']); exit;
}
/*-- Pages ----------------------------------------------------------------*/
$_TPL['title'] = $_LANG['admin'].' | '.TITLE;
include_template('header');
if(!$_SESSION['admin']) // Login
{
$_SESSION['captcha'] = gen_captcha();
include_template('sign_in');
}
else if($_GET['page'] == 'add_post') // Add post
{
$_TPL['category_select'] = select_categories($category_dump);
include_template('admin_header');
include_template('add_post');
}
else if($_GET['page'] == 'categories') // Categories
{
include_template('admin_header');
include_template('categories_header');
view_edit_categories($category_dump);
include_template('categories');
}
else if($_GET['page'] == 'comments') // Comments
{
$parser = new Parsedown();
$parser -> setSafeMode(true);
$query = 'SELECT * FROM `comments` LIMIT 50';
$result = $sqlite -> query($query);
include_template('admin_header');
include_template('comments');
view_comments($result);
}
else if($_GET['page'] == 'edit_post') // Edit post
{
$result = $sqlite -> query('SELECT * FROM `posts` WHERE id='.$_GET['id']);
$post_data = $result -> fetchArray(SQLITE3_ASSOC);
$_TPL['id'] = $post_data['id'];
$_TPL['category'] = $post_data['category'];
$_TPL['title'] = $post_data['title'];
$_TPL['title'] = $post_data['title'];
$_TPL['desc'] = $post_data['desc'];
$_TPL['text'] = $post_data['text'];
$_TPL['tags'] = $post_data['tags'];
if($post_data['category'])
$_TPL['category_name'] = category_name($post_data['category']);
else $_TPL['category_name'] = $_LANG['without_cat'];
$_TPL['category_select'] = select_categories($category_dump);
include_template('admin_header');
include_template('edit_post');
}
else // Admin inddex
{
$query = 'SELECT COUNT(*) FROM `posts`';
$_TPL['posts'] = $sqlite -> querySingle($query);
$query = 'SELECT COUNT(*) FROM `comments`';
$_TPL['comments'] = $sqlite -> querySingle($query);
include_template('admin_header');
include_template('admin_index');
}

100
private/pages/index.php Normal file
View File

@ -0,0 +1,100 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
/*-- Posts count ----------------------------------------------------------*/
if(!isset($_GET['category']) and !isset($_GET['tag']))
{
$query = 'SELECT COUNT(*) FROM `posts`';
}
else if(isset($_GET['category']))
{
$cat = filter_input(INPUT_GET, 'category', FILTER_SANITIZE_NUMBER_INT);
if ($cat < 0) $cat = 0;
$query = 'SELECT COUNT(*) FROM `posts` WHERE category = '.$cat;
$name = category_name($cat);
}
else if($_GET['tag'])
{
$tag = preg_replace ("/[^a-zA-Zа-яА-ЯёЁ_\-\d]/ui","",$_GET['tag']);
$query = 'SELECT COUNT(*) FROM `posts` WHERE tags LIKE "%'.$tag.'%"';
}
$count = $sqlite -> querySingle($query);
/*-- Pagination -----------------------------------------------------------*/
if($count)
{
if(!$_GET['page']) $page = 0;
else $page = filter_input(INPUT_GET, 'page', FILTER_SANITIZE_NUMBER_INT);
$start = $page * MAXPOSTS;
if($page < 0 or ($page * MAXPOSTS) >= $count )
{
header('Location:'.URL.'index.php?view=404'); exit;
}
}
/*-- Get posts and set pagination links -----------------------------------*/
if(!isset($_GET['category']) and !isset($_GET['tag']))
{
$query = 'SELECT * FROM `posts`
ORDER BY `time` DESC
LIMIT '.$start.', '.MAXPOSTS;
$_TPL['title'] = TITLE;
if(($page - 1) >= 0)
$_TPL['prev_page'] = 'index.php?page='.($page - 1);
if((($page + 1) * MAXPOSTS) < $count)
$_TPL['next_page'] = 'index.php?page='.($page + 1);
}
else if(isset($cat)) // Categories
{
$query = 'SELECT * FROM `posts` WHERE category = '.$cat.'
ORDER BY `time` DESC LIMIT '.$start.', '.MAXPOSTS;
$_TPL['title'] = $name.' | '.TITLE;
if($cat == 0) $_TPL['title'] = $_LANG['without_cat'].' | '.TITLE;
if(($page - 1) >= 0)
$_TPL['prev_page'] = 'index.php?category='.$cat.'&page='.($page - 1);
if((($page + 1) * MAXPOSTS) < $count)
$_TPL['next_page'] = 'index.php?category='.$cat.'&page='.($page + 1);
}
else if(isset($tag)) // Tags
{
$query = 'SELECT * FROM `posts` WHERE tags LIKE "%'.$tag.'%"
ORDER BY `time` DESC LIMIT '.$start.', '.MAXPOSTS;
$_TPL['title'] = '@'.$tag.' | '.TITLE;
if(($page - 1) >= 0)
$_TPL['prev_page'] = 'index.php?tag='.$tag.'&page='.($page - 1);
if((($page + 1) * MAXPOSTS) < $count)
$_TPL['next_page'] = 'index.php?tag='.$tag.'&page='.($page + 1);
}
else
{
header('Location:'.URL.'index.php'); exit;
}
$result = $sqlite -> query($query);
/*-- View posts -----------------------------------------------------------*/
$parser = new Parsedown();
include_template('header');
if($count) view_posts($result);
else include_template('index_empty');
include_template('index_footer');

98
private/pages/post.php Normal file
View File

@ -0,0 +1,98 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
$id = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_NUMBER_INT);
/*-- Get post contents -----------------------------------------------------*/
if($id <= 0)
{
header('Location:'.URL.'index.php?view=404'); exit;
}
$result = $sqlite -> query('SELECT * FROM `posts` WHERE id='.$id);
$post_data = $result -> fetchArray(SQLITE3_ASSOC);
if(!$post_data['time'])
{
header('Location:'.URL.'index.php?view=404'); exit;
}
$_TPL['title'] = $post_data['title'].' | '.TITLE;
include_template('header');
/*-- View post contents ----------------------------------------------------*/
$parser = new Parsedown();
$_TPL['id'] = $id;
$_TPL['time'] = date("d.m.y", $post_data['time']);
$_TPL['title'] = $post_data['title'];
$_TPL['desc'] = parser($post_data['desc']);
$_TPL['text'] = parser($post_data['text']);
$_TPL['tags'] = separate_tags($post_data['tags']);
$_TPL['comments'] = $post_data['comments'];
include_template('post');
/*-- Add a comment --------------------------------------------------------*/
if($_GET['action'] == 'add_comment' && COMMENTS)
{
$post_url = URL.'index.php?view=post&id='.$_TPL['id'];
if(empty($_POST['text']) or $_POST['captcha'] != $_SESSION['captcha'])
{
header('Location:'.$post_url.'&error=comment_err#add'); exit;
}
if($_SESSION['flood'] and (time() - $_SESSION['flood']) < ANTIFLOOD)
{
header('Location:'.$post_url.'&error=antiflood#add'); exit;
}
$_SESSION['flood'] = time();
$query = 'INSERT INTO `comments` (id, time, text, admin)
VALUES (:id, :time, :text, :admin)';
$stmt = $sqlite -> prepare($query);
$stmt -> bindValue(':id', $id, SQLITE3_INTEGER);
$stmt -> bindValue(':time', time(), SQLITE3_INTEGER);
$stmt -> bindValue(':text', $_POST['text'], SQLITE3_TEXT);
$stmt -> bindValue(':admin', $_SESSION['admin'], SQLITE3_INTEGER);
$stmt->execute();
$query = 'UPDATE `posts` SET comments = '.($post_data['comments']+1).'
WHERE id = '.$id;
$sqlite -> exec($query);
}
/*-- View comments --------------------------------------------------------*/
$parser -> setSafeMode(true);
$query = 'SELECT * FROM `comments` WHERE id='.$id;
$result = $sqlite -> query($query);
view_comments($result);
/*-- Comment form ---------------------------------------------------------*/
if(COMMENTS)
{
$_SESSION['captcha'] = gen_captcha();
if ($_GET['error'] == "comment_err") $_TPL['error'] = $_LANG['comment_err'];
if ($_GET['error'] == "antiflood") $_TPL['error'] = $_LANG['flood_err'];
include_template('comment_form');
}

46
private/pages/rss.php Normal file
View File

@ -0,0 +1,46 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
header("Content-Type: application/xml; charset=UTF-8");
echo '<?xml version="1.0" encoding="UTF-8"?>';
?>
<rss version="2.0">
<channel>
<title><?=TITLE?></title>
<link><?=URL?></link>
<?php
$query = 'SELECT COUNT(*) FROM `posts`';
$count = $sqlite -> querySingle($query);
$query = 'SELECT * FROM `posts` ORDER BY `time` DESC LIMIT 0, '.MAXPOSTS;
$result = $sqlite -> query($query);
if($count)
{
$parser = new Parsedown();
$parser -> setSafeMode(true);
while ($row = $result -> fetchArray())
{
if(!$row['time']) exit;
$_TPL['id'] = $row['id'];
$_TPL['title'] = $row['title'];
$_TPL['desc'] = parser($row['desc']);
include_template('rss');
}
}
?>
</channel>
</rss>
<?php exit;

20
private/templates/404.php Normal file
View File

@ -0,0 +1,20 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="title">
<div class="title_tab">
<?=$_LANG['error_404']?>
</div>
</div>
<div class="clear"></div>
<div class="content">
<?=$_LANG['error_404_text']?>

View File

@ -0,0 +1,24 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<h1><?=$_LANG['add_post']?></h1>
<form action="index.php?view=admin&action=add_post" method="post">
<input type="text" name="title" class="editor" placeholder="<?=$_LANG['post_title']?>">
<select name="category" class="editor">
<option value="0"><?=$_LANG['without_cat']?></option>
<?=$_TPL['category_select']?>
</select>
<textarea name="desc" class="editor" rows="5" placeholder="<?=$_LANG['post_desc']?>"></textarea>
<textarea name="text" class="editor" rows="20" placeholder="<?=$_LANG['post_text']?>"></textarea>
<input type="text" name="tags" class="editor" placeholder="<?=$_LANG['post_tags']?>">
<input type="submit" class="button" value="<?=$_LANG['submit']?>">
</form>

View File

@ -0,0 +1,27 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="title">
<div class="title_tab">
<?=$_LANG['admin']?>
</div>
<div class="title_etc">
<a href="index.php?view=admin&auth=sign_out"><?=$_LANG['sign_out']?></a>
</div>
</div>
<div class="clear"></div>
<div class="content">
<div class="center">
<a href="index.php?view=admin&page=add_post"><?=$_LANG['add_post']?></a> |
<a href="index.php?view=admin&page=categories"><?=$_LANG['categories']?></a> |
<a href="index.php?view=admin&page=comments"><?=$_LANG['comments']?></a>
</div>

View File

@ -0,0 +1,18 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<h1><?=$_LANG['stats']?></h1>
<ul>
<li><?=$_LANG['all_posts_count']?> : <?=$_TPL['posts']?></li>
<li><?=$_LANG['all_comm_count']?> : <?=$_TPL['comments']?></li>
</ul>

View File

@ -0,0 +1,26 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="clear"></div>
<br>
<div class="title">
<div class="title_tab">
<?=$_LANG['add_category']?>
</div>
</div>
<div class="content">
<form action="index.php?view=admin&action=add_category" method="post">
<input type="text" class="editor" name="sort" placeholder="<?=$_LANG['sort_category']?>">
<input type="text" class="editor" name="name" placeholder="<?=$_LANG['category_name']?>">
<input type="submit" class="button" value="<?=$_LANG['submit']?>">
</form>
</div>

View File

@ -0,0 +1,13 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<h1><?=$_LANG['categories']?></h1>

View File

@ -0,0 +1,35 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="title">
<div class="title_tab">
<?=$_TPL['time']?>
</div>
<div class="title_etc">
<?php if(!$_TPL['admin']) { ?>
<?=$_LANG['by_guest']?>
<?php }else{ ?>
<?=$_LANG['by_admin']?>
<?php } ?>
<?php if($_TPL['post_id']) { ?>
[ <a href="index.php?view=post&id=<?=$_TPL['post_id']?>"><?=$_LANG['goto_post']?></a> ]
<?php } ?>
<?php if($_SESSION['admin']) { ?>
[ <a href="index.php?view=admin&page=comments&action=delete_comment&id=<?=$_TPL['cid']?>&post=<?=$_TPL['pid']?>"><?=$_LANG['delete']?></a> ]
<?php } ?>
</div>
</div>
<div class="clear"></div>
<div class="comment_content">
<?=$_TPL['text']?>
</div>

View File

@ -0,0 +1,24 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<h1 id="add"><?=$_LANG['add_comment']?></h1>
<?php if($_TPL['error']) { ?>
<div class="error">
<?=$_TPL['error']?>
</div>
<?php } ?>
<form action="index.php?view=post&id=<?=$_TPL['id']?>&action=add_comment" method="post">
<textarea name="text" class="editor" rows="4" placeholder="<?=$_LANG['comment_text']?>"></textarea>
<img src="captcha.php" alt="captcha" class="captcha"><br>
<input type="text" name="captcha" class="editor" placeholder="<?=$_LANG['input_captcha']?>">
<input type="submit" class="button" value="<?=$_LANG['submit']?>">
</form>

View File

@ -0,0 +1,14 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<h1><?=$_LANG['comments']?></h1>

View File

@ -0,0 +1,18 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<form action="index.php?view=admin&action=edit_category&id=<?=$_TPL['id']?>" method="post">
<input type="text" class="editor input_id" name="sort" placeholder="ID" value="<?=$_TPL['sort']?>">
<input type="text" class="editor input_name" name="name" placeholder="<?=$_LANG['category_name']?>" value="<?=$_TPL['name']?>">
<input type="submit" class="button editor input_button" value="">
<input type="submit" class="button editor input_button" value="" name="delete">
</form>

View File

@ -0,0 +1,27 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<h1><?=$_LANG['edit_post']?></h1>
<form action="index.php?view=admin&action=edit_post&post=<?=$_TPL['id']?>" method="post">
<input type="text" name="title" class="editor" value="<?=$_TPL['title']?>">
<select name="category" class="editor">
<option value=" <?=$_TPL['category']?>"><?=$_TPL['category_name']?></option>
<option value="0"></option>
<?=$_TPL['category_select']?>
<option value="0"><?=$_LANG['without_cat']?></option>
</select>
<textarea name="desc" class="editor" rows="5"><?=$_TPL['desc']?></textarea>
<textarea name="text" class="editor" rows="20"><?=$_TPL['text']?></textarea>
<input type="text" name="tags" class="editor" value="<?=$_TPL['tags']?>">
<input type="submit" class="button" value="<?=$_LANG['submit']?>" style="float:left">
</form>
<a href="index.php?view=admin&action=delete_post&id=<?=$_TPL['id']?>" class="title_etc"><?=$_LANG['delete']?></a>

View File

@ -0,0 +1,48 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
</div>
</section>
<section class="sidebar">
<div class="title">
<div class="title_tab">
<?=$_LANG['categories']?>
</div>
<div class="title_etc">
<a href="index.php?view=rss">RSS</a>
<?php if($_SESSION['admin']) { ?>
[ <a href="index.php?view=admin"><?=$_LANG['admin']?></a> ]
<?php } ?>
</div>
</div>
<div class="clear"></div>
<nav class="categories">
<?=$_TPL['category_list']?>
<a href="index.php?category=0"><?=$_LANG['without_cat']?></a>
<a href="index.php"><?=$_LANG['all_posts']?></a>
</nav>
</section>
</div>
<div class="clear"></div>
<footer>
<div class="body">
<div class="footer_copy">
&copy; <?=COPY?>
</div>
<div class="footer_text">
Powered by <a href="https://code.fossee.net/chicory/orblog-legacy" title="Simple blog for hidden networks.">orblog</a>.
</div>
</div>
</footer>
</body>
</html>

View File

@ -0,0 +1,36 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<!DOCTYPE html>
<html lang="<?=LANG?>">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="public/style/main.css">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<meta name="description" content="<?=$_TPL['desc']?>">
<title><?=$_TPL['title']?></title>
</head>
<body>
<header>
<div class="body">
<div class="header_logo">
<a href="<?=URL?>"><?=TEXTLOGO?></a>
</div>
<div class="header_desc">
<div class="heder_block">
<?=H_DESC?>
</div>
</div>
</div>
</header>
<div class="body">
<section class="main">

View File

@ -0,0 +1,17 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="clear"></div>
<div class="content"><br>
<div class="center">
<h1><?=$_LANG['empty_category']?></h1>
</div>

View File

@ -0,0 +1,22 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="content">
<div class="center">
<?php if($_TPL['prev_page']) { ?>
<a href="<?=$_TPL['prev_page']?>"> &nbsp;<?=$_LANG['prev_page']?></a>&nbsp;
<?php } ?>
<?php if($_TPL['next_page']) { ?>
&nbsp;<a href="<?=$_TPL['next_page']?>"><?=$_LANG['next_page']?>&nbsp; ⤼</a>
<?php } ?>
</div>

View File

@ -0,0 +1,33 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="title">
<div class="title_tab">
<?=$_TPL['time']?>
</div>
<div class="title_etc">
<?php if($_SESSION['admin']) { ?>
[ <a href="index.php?view=admin&page=edit_post&id=<?=$_TPL['id']?>"><?=$_LANG['edit']?></a> ]
<?php } ?>
<a href="index.php?view=post&id=<?=$_TPL['id']?>#comments"><?=$_LANG['comments']?> ( <?=$_TPL['comments']?> )</a>
</div>
</div>
<div class="clear"></div>
<div class="content">
<h1><?=$_TPL['title']?></h1>
<?=$_TPL['text']?>
<br>
<?php if($_TPL['tags']) { ?>
<?=$_LANG['tags']?>: <?=$_TPL['tags']?><br>
<?php } ?>
<br>
<div class="clear" id="comments"></div>

View File

@ -0,0 +1,32 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="title">
<div class="title_tab">
<?=$_TPL['time']?>
</div>
<div class="title_etc">
<?php if($_SESSION['admin']) { ?>
[ <a href="index.php?view=admin&page=edit_post&id=<?=$_TPL['id']?>"><?=$_LANG['edit']?></a> ]
<?php } ?>
<a href="index.php?view=post&id=<?=$_TPL['id']?>#comments"><?=$_LANG['comments']?> ( <?=$_TPL['comments']?> )</a>
</div>
</div>
<div class="clear"></div>
<div class="content">
<h1><a href="index.php?view=post&id=<?=$_TPL['id']?>" class="post_title"><?=$_TPL['title']?></a></h1>
<?=$_TPL['desc']?>
<?php if($_TPL['tags']) { ?>
<?=$_LANG['tags']?>: <?=$_TPL['tags']?><br>
<?php } ?>
<br>
</div>

19
private/templates/rss.php Normal file
View File

@ -0,0 +1,19 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<item>
<title><?=$_TPL['title']?></title>
<link><?=URL?>index.php?view=post&amp;id=<?=$_TPL['id']?></link>
<description>
<![CDATA[<?=$_TPL['desc']?>]]>
</description>
</item>

View File

@ -0,0 +1,34 @@
<?php
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
?>
<div class="title">
<div class="title_tab">
<?=$_LANG['admin']?>
</div>
</div>
<div class="clear"></div>
<div class="content">
<div class="center">
<h1><?=$_LANG['sign_in']?></h1>
<?php if($_TPL['error']) { ?>
<div class="error">
<?=$_TPL['error']?>
</div>
<?php } ?>
<form action="index.php?view=admin&auth=sign_in" method="post">
<input type="password" name="pass" placeholder="<?=$_LANG['input_pass']?>"><br>
<img src="captcha.php" alt="captcha" class="captcha"><br>
<input type="text" name="captcha" placeholder="<?=$_LANG['input_captcha']?>"><br>
<input type="submit" value="<?=$_LANG['sign_in']?>" class="button"><br>
</form>
</div>

286
public/style/main.css Normal file
View File

@ -0,0 +1,286 @@
/*-----------------------------------------------------------------------------
orblog - Simple blog for hidden networks.
Version: 0.1
Git: https://code.fossee.net/chicory/orblog-legacy
Copyright: chicory@fossee.net 2020
License: http://www.apache.org/licenses/LICENSE-2.0
-----------------------------------------------------------------------------*/
@font-face
{
font-family: roboto;
src: url(roboto.ttf);
}
*
{
padding: 0;
margin: 0;
box-sizing: border-box;
font-family: roboto, sans;
line-height: 1.5;
outline: none;
}
.body
{
max-width: 840px;
margin: auto;
}
a
{
text-decoration: none;
color: #673ab7;
}
p, h1, h2, h3, h4, h5, h6, hr, ul, ol, blockquote, pre
{
margin-bottom: 10px;
}
pre
{
background: #ededfd;
padding: 10px;
padding-left: 14px;
border-left: 4px solid #607d8b;
}
code
{
font-family: monospace;
font-size: 14px;
}
h1, h2
{
font-size: 20px;
}
h3, h4
{
font-size: 18px;
}
h5, h6
{
font-size: 16px;
}
blockquote
{
font-style: italic;
border-left: 4px solid #607d8b;
padding-left: 14px;
margin-left: 20px;
}
li
{
margin-left: 30px;
}
img
{
max-width: 100%;
}
header
{
background: #512da8;
color: #fff;
box-shadow: 2px 2px 2px #ccc;
margin-bottom: 10px;
}
header, .header_logo, .header_desc
{
height: 60px;
}
.header_logo, .header_desc
{
display: flex;
align-items: center;
}
.header_logo
{
width: 30%;
font-size: 20px;
float: left;
}
.header_desc
{
width: 70%;
font-size: 14px;
float: left;
}
header a
{
color: #fff;
}
.main, .sidebar
{
margin-bottom: 10px;
}
.main
{
width: 70%;
float: left;
padding-right: 20px;
}
.sidebar
{
width: 30%;
float: left;
}
.title
{
width: 100%;
border-bottom: 3px solid #607d8b;
overflow: auto;
}
.title_tab
{
background: #512da8;
padding: 10px;
float: left;
color: #fff;
font-size: 16px;
}
.title_etc
{
float: right;
padding: 10px 0;
color: #757575;
font-size: 16px;
}
.title_etc a
{
color: #757575;
}
.title_etc a:hover
{
text-decoration: underline;
}
.post_title
{
color: #333;
}
.categories a
{
padding: 10px 0;
display: block;
border-bottom: 1px solid #b0cddb;
color: #607d8b;
transition: 0.2s linear;
}
.categories a:hover
{
padding: 10px 5px;
}
.content
{
padding: 10px 0;
color: #333;
font-size: 16px;
}
.comment_content
{
padding-top: 10px;
}
input, textarea, select, option
{
padding: 10px 18px 10px 18px;
margin: 10px 0;
border: 1px solid #607d8b;
font-size: 14px;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
background: #fff;
}
.button
{
background: #512da8;
color: #fff;
border: 2px solid #512da8;
transition: color 0.2s linear;
}
.editor
{
width: 100%;
}
.button:hover
{
background: #fff;
color: #512da8;
}
.input_id, .input_name, .input_button
{
display: flex;
float: left;
}
.input_id
{
width: 10%;
}
.input_name
{
width: 70%;
border-left: 0px;
}
.input_button
{
width: 10%;
border: 1px solid #512da8;
}
.error
{
color: #fd2d2d;
}
.captcha
{
margin-bottom: 0;
}
.center
{
text-align: center;
}
footer
{
background: #607d8b;
color: #fff;
box-shadow: -2px -2px 2px #ccc;
font-size: 14px;
height: 80px;
padding-top: 10px;
}
.footer_copy
{
width: 30%;
float: left;
}
.footer_text
{
width: 70%;
float: left;
text-align: right;
}
footer a
{
color: #fff;
text-decoration: underline;
}
.clear
{
clear: both;
}
@media only screen and (max-width: 860px)
{
.body
{
padding: 0 10px;
}
.header_logo, .footer_copy, .main, .sidebar
{
width: 100%;
}
.header_desc, .footer_text
{
display: none;
}
.main
{
padding: 0;
}
}

BIN
public/style/roboto.ttf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
screeshots/comment.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

BIN
screeshots/main.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB