|
|
|
@ -59,7 +59,7 @@ function remove_accent($str) |
|
|
|
} |
|
|
|
|
|
|
|
// Edit blog posts
|
|
|
|
function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null) |
|
|
|
function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, $description = null, $date = null, $fi, $vid) |
|
|
|
{ |
|
|
|
$oldurl = explode('_', $oldfile); |
|
|
|
if ($date !== null) { |
|
|
|
@ -67,6 +67,8 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, |
|
|
|
} |
|
|
|
|
|
|
|
$post_title = $title; |
|
|
|
$post_fi = $fi; |
|
|
|
$post_vid = $vid; |
|
|
|
$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))); |
|
|
|
if ($description !== null) { |
|
|
|
@ -75,6 +77,7 @@ function edit_post($title, $tag, $url, $content, $oldfile, $destination = null, |
|
|
|
$post_description = ""; |
|
|
|
} |
|
|
|
$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; |
|
|
|
|
|
|
|
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { |
|
|
|
if (get_magic_quotes_gpc()) { |
|
|
|
@ -152,11 +155,13 @@ function edit_page($title, $url, $content, $oldfile, $destination = null, $descr |
|
|
|
} |
|
|
|
|
|
|
|
// Add blog post
|
|
|
|
function add_post($title, $tag, $url, $content, $user, $description = null) |
|
|
|
function add_post($title, $tag, $url, $content, $user, $description = null, $fi, $vid) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
$post_date = date('Y-m-d-H-i-s'); |
|
|
|
$post_title = $title; |
|
|
|
$post_fi = $fi; |
|
|
|
$post_vid = $vid; |
|
|
|
$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))); |
|
|
|
if ($description !== null) { |
|
|
|
@ -165,6 +170,7 @@ function add_post($title, $tag, $url, $content, $user, $description = null) |
|
|
|
$post_description = ""; |
|
|
|
} |
|
|
|
$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; |
|
|
|
|
|
|
|
if (!empty($post_title) && !empty($post_tag) && !empty($post_url) && !empty($post_content)) { |
|
|
|
if (get_magic_quotes_gpc()) { |
|
|
|
|