Browse Source

Author page simplicity

pull/463/head
danpros 4 years ago
parent
commit
80eacfe356
2 changed files with 7 additions and 7 deletions
  1. +6
    -1
      system/htmly.php
  2. +1
    -6
      system/includes/functions.php

+ 6
- 1
system/htmly.php View File

@ -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);


+ 1
- 6
system/includes/functions.php View File

@ -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];


Loading…
Cancel
Save