Browse Source

Merge pull request #141 from Kanti/master

[TASK] see #140
pull/146/merge v2.5
Kanti 10 years ago
parent
commit
b4362a6468
6 changed files with 441 additions and 437 deletions
  1. +1
    -1
      README.md
  2. +1
    -1
      index.php
  3. +4
    -4
      system/admin/admin.php
  4. +0
    -1
      system/htmly.php
  5. +7
    -2
      system/upgrade/run.php
  6. +428
    -428
      themes/default/css/style.css

+ 1
- 1
README.md View File

@ -47,7 +47,7 @@ HTMLy requires PHP 5.3 or greater.
Installations Installations
------------- -------------
if you have openssl on your server, use the [Installer](https://github.com/Kanti/htmly-installer/releases/latest). read the [Instructions](https://github.com/Kanti/htmly-installer/blob/master/README.md#htmly-installerphp). if you have openssl on your server, use the [Installer](https://github.com/Kanti/htmly-installer/releases/latest). read the [Instructions](https://github.com/Kanti/htmly-installer/blob/master/README.md#htmly-installerphp).
If you don't have openssl, download the latest version, extract it, then upload the extracted files to your server. Make sure the installation folder is writeable by your server.
If you don't have openssl, [download](https://github.com/danpros/htmly/releases/latest) the latest version, extract it, then upload the extracted files to your server. Make sure the installation folder is writeable by your server.
Configurations Configurations
-------------- --------------


+ 1
- 1
index.php View File

@ -1,5 +1,5 @@
<?php <?php
$config_file = 'config/config.ini';
require 'system/vendor/autoload.php'; require 'system/vendor/autoload.php';
require_once "system/upgrade/run.php"; require_once "system/upgrade/run.php";
require 'system/htmly.php'; require 'system/htmly.php';

+ 4
- 4
system/admin/admin.php View File

@ -68,7 +68,7 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null,
$post_title = $title; $post_title = $title;
$post_fi = $fi; $post_fi = $fi;
$post_vid = $vid;
$post_vid = str_replace(["http://", "https://", "www.", "youtube", ".com", "/watch?v=", "/embed/"], "", $vid);
$post_tag = preg_replace(array('/[^a-zA-Z0-9,.\-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($tag)); $post_tag = preg_replace(array('/[^a-zA-Z0-9,.\-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($tag));
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url))); $post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
if ($description !== null) { if ($description !== null) {
@ -157,11 +157,11 @@ function edit_page($title, $url, $content, $oldfile, $destination = null, $descr
// Add blog post // Add blog post
function add_post($title, $tag, $url, $content, $user, $description = null, $fi, $vid) function add_post($title, $tag, $url, $content, $user, $description = null, $fi, $vid)
{ {
$post_date = date('Y-m-d-H-i-s'); $post_date = date('Y-m-d-H-i-s');
$post_title = $title; $post_title = $title;
$post_fi = $fi; $post_fi = $fi;
$post_vid = $vid;
$post_vid = str_replace(["http://", "https://", "www.", "youtube", ".com", "/watch?v=", "/embed/"], "", $vid);
$post_tag = preg_replace(array('/[^a-zA-Z0-9,.\-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($tag)); $post_tag = preg_replace(array('/[^a-zA-Z0-9,.\-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($tag));
$post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url))); $post_url = strtolower(preg_replace(array('/[^a-zA-Z0-9 \-\p{L}]/u', '/[ -]+/', '/^-|-$/'), array('', '-', ''), remove_accent($url)));
if ($description !== null) { if ($description !== null) {
@ -170,7 +170,7 @@ function add_post($title, $tag, $url, $content, $user, $description = null, $fi,
$post_description = ""; $post_description = "";
} }
$post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content; $post_content = '<!--t ' . $post_title . ' t-->' . $post_description . "\n\n" . $content;
$post_content = '<!--fi ' . $post_fi . ' fi-->' . "\n\n" . '<!--vid ' . $post_vid . ' vid-->' . "\n\n" . $post_content;
$post_content = '<!--fi ' . $post_fi . ' fi-->' . "\n\n" . '<!--vid ' . $post_vid . ' vid-->' . "\n\n" . $post_content;
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) {
if (get_magic_quotes_gpc()) { if (get_magic_quotes_gpc()) {


+ 0
- 1
system/htmly.php View File

@ -4,7 +4,6 @@
date_default_timezone_set('Asia/Jakarta'); date_default_timezone_set('Asia/Jakarta');
// Load the configuration file // Load the configuration file
$config_file = 'config/config.ini';
config('source', $config_file); config('source', $config_file);
if(config('timezone')) { if(config('timezone')) {
date_default_timezone_set(config('timezone')); date_default_timezone_set(config('timezone'));


+ 7
- 2
system/upgrade/run.php View File

@ -1,5 +1,7 @@
<?php <?php
config('source', $config_file);
$updater = new Kanti\HubUpdater("danpros/htmly"); $updater = new Kanti\HubUpdater("danpros/htmly");
$info = $updater->getCurrentInfo(); $info = $updater->getCurrentInfo();
$versionNumber = substr($info['tag_name'], 1); $versionNumber = substr($info['tag_name'], 1);
@ -32,5 +34,8 @@ if (isGraterThan("2.3")) {// 2.4, 2.5, ...
} }
} }
file_put_contents("index.php", file_get_contents("system/upgrade/index.php"));
rrmdir("system/upgrade/");
if(!config("dev")){
file_put_contents("index.php", file_get_contents("system/upgrade/index.php"));
rrmdir("system/upgrade/");
}

+ 428
- 428
themes/default/css/style.css
File diff suppressed because it is too large
View File


Loading…
Cancel
Save