mirror of
https://github.com/danpros/htmly.git
synced 2026-04-20 04:26:22 +05:30
Bugs fixed for new created blog
This commit is contained in:
parent
3dd6c364e5
commit
5a924e9164
1 changed files with 24 additions and 17 deletions
|
|
@ -88,26 +88,33 @@ function add_content($title, $tag, $url, $content, $user, $description = null, $
|
|||
|
||||
$tag = explode(',', preg_replace("/\s*,\s*/", ",", rtrim($tag, ',')));
|
||||
$tag = array_filter(array_unique($tag));
|
||||
$taglang = array_flip(unserialize(file_get_contents('content/data/tags.lang')));
|
||||
$tflip = array_intersect_key($taglang, array_flip($tag));
|
||||
$post_tag = array();
|
||||
$post_tagmd = array();
|
||||
foreach ($tag as $t) {
|
||||
if (array_key_exists($t, $tflip)) {
|
||||
foreach ($tflip as $tfp => $tf){
|
||||
if($t === $tfp) {
|
||||
$post_tag[] = $tf;
|
||||
$post_tagmd[] = $tfp;
|
||||
$tagslang = "content/data/tags.lang";
|
||||
if (file_exists($tagslang)) {
|
||||
$taglang = array_flip(unserialize(file_get_contents($tagslang)));
|
||||
$tflip = array_intersect_key($taglang, array_flip($tag));
|
||||
$post_tag = array();
|
||||
$post_tagmd = array();
|
||||
foreach ($tag as $t) {
|
||||
if (array_key_exists($t, $tflip)) {
|
||||
foreach ($tflip as $tfp => $tf){
|
||||
if($t === $tfp) {
|
||||
$post_tag[] = $tf;
|
||||
$post_tagmd[] = $tfp;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$post_tag[] = $t;
|
||||
$post_tagmd[] = $t;
|
||||
}
|
||||
} else {
|
||||
$post_tag[] = $t;
|
||||
$post_tagmd[] = $t;
|
||||
}
|
||||
}
|
||||
|
||||
$post_tag = safe_tag(implode(',', $post_tag));
|
||||
$post_tagmd = safe_html(implode(',', $post_tagmd));
|
||||
|
||||
$post_tag = safe_tag(implode(',', $post_tag));
|
||||
$post_tagmd = safe_html(implode(',', $post_tagmd));
|
||||
|
||||
} else {
|
||||
$post_tag = safe_tag(implode(',', $tag));
|
||||
$post_tagmd = safe_html(implode(',', $tag));
|
||||
}
|
||||
|
||||
$post_date = date('Y-m-d-H-i-s');
|
||||
$post_title = safe_html($title);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue