diff --git a/system/htmly.php b/system/htmly.php
index 704d5f9..4a8f68e 100644
--- a/system/htmly.php
+++ b/system/htmly.php
@@ -202,7 +202,12 @@ get('/author/:name', function ($name) {
$posts = get_profile_posts($name, $page, $perpage);
- $total = get_count($name, 'dirname');
+ $total = get_count('/'.$name.'/', 'dirname');
+ $username = 'config/users/' . $name . '.ini';
+
+ if ($total === 0 && !file_exists($username)) {
+ not_found();
+ }
$author = get_author($name);
diff --git a/system/includes/functions.php b/system/includes/functions.php
index c71e856..75024a5 100644
--- a/system/includes/functions.php
+++ b/system/includes/functions.php
@@ -503,7 +503,6 @@ function get_category($category, $page, $perpage)
// Replaced string
$replaced = substr($arr[0], 0, strrpos($arr[0], '/')) . '/';
- // Author string
$str = explode('/', $replaced);
$cat = $str[count($str) - 3];
@@ -649,7 +648,6 @@ function get_type($type, $page, $perpage)
// Replaced string
$replaced = substr($arr[0], 0, strrpos($arr[0], '/')) . '/';
- // Author string
$str = explode('/', $replaced);
$tp = $str[count($str) - 2];
@@ -813,7 +811,7 @@ function get_author($name)
if (!empty($tmp) || file_exists($username)) {
return $tmp;
} else {
- not_found();
+ return false;
}
}
@@ -1060,7 +1058,6 @@ function get_categorycount($var)
// Replaced string
$replaced = substr($arr[0], 0, strrpos($arr[0], '/')) . '/';
- // Author string
$str = explode('/', $replaced);
$cat = '/blog/' . $str[count($str) - 3];
if (stripos($cat, "$var") !== false) {
@@ -1088,7 +1085,6 @@ function get_typecount($var)
// Replaced string
$replaced = substr($arr[0], 0, strrpos($arr[0], '/')) . '/';
- // Author string
$str = explode('/', $replaced);
$tp = '/' . $str[count($str) - 2] . '/';
if (stripos($tp, "$var") !== false) {
@@ -1117,7 +1113,6 @@ function get_draftcount($var)
// Replaced string
$replaced = substr($arr[0], 0, strrpos($arr[0], '/')) . '/';
- // Author string
$str = explode('/', $replaced);
$cat = $str[count($str) - 5];