function get_title() { global $dir, $lang, $mn_categories, $mn_users; if (isset($_GET['mn_post'])) { if (is_numeric($_GET['mn_post']) && file_exists(MN_ROOT . $dir['posts'] . 'post_' . $_GET['mn_post'] . '.php')) { $mn_post_id = $_GET['mn_post']; } else { $post_slugs = get_post_slugs(); if (in_array(check_text($_GET['mn_post'], true), $post_slugs)) { $mn_post_id = array_search(check_text($_GET['mn_post'], true), $post_slugs); } else { $mn_post_id = 0; } } $p = get_post_data($mn_post_id); return encoding($p['title']); } elseif (isset($_GET['mn_page'])) { if (is_numeric($_GET['mn_page']) && file_exists(MN_ROOT . $dir['pages'] . 'page_' . $_GET['mn_page'] . '.php')) { $mn_page_id = $_GET['mn_page']; } else { $pages_dir = dir(MN_ROOT . $dir['pages']); $mn_page_id = ''; while ($p_file = $pages_dir->read()) { if (!is_file(MN_ROOT . $dir['pages'] . $p_file)) { continue; } else { $temp_var = get_page_data($p_file, false); if ($temp_var['friendly_url'] == $_GET['mn_page']) { $mn_page_id = $temp_var['id']; } else { continue; } } } } $p = get_page_data($mn_page_id); return encoding($p['title']); } elseif (isset($_GET['mn_cat']) && !empty($_GET['mn_cat'])) { return encoding($lang['cats_category'] . ': ' . $mn_categories[$_GET['mn_cat']]['name']); } elseif (isset($_GET['mn_user']) && !empty($_GET['mn_user'])) { return encoding($lang['users_user'] . ': ' . $mn_users[$_GET['mn_user']]); } else { return encoding($lang['posts_posts']); } }
# find out timestamp and status of new article $timestamp = $_POST['date'] == 'specific' ? mktime($_POST["date_hour"], $_POST["date_min"], 0, $_POST["date_month"], $_POST["date_day"], $_POST["date_year"]) : mn_time(); $status = $auth == '3' && $_POST['status'] == '1' ? 4 : $_POST['status']; if ($status == '3' && $_POST['date'] != 'specific') { $timestamp = '9999999999'; } $post_tags = !empty($_POST['tags']) ? implode(',', $_POST['tags']) : ''; # we need to find out new ID, which will be assign to this article (an = active news) $id = trim(file_get_contents($file['id_posts'])); if (isset($_POST['slug']) && !empty($_POST['slug'])) { $slug = $_POST['slug']; } else { $slug = friendly_url($_POST['title']); } # create friendly url $post_slugs = get_post_slugs(); if (in_array($slug, $post_slugs)) { $i = 2; $post_friendly_url = $slug; while (in_array($post_friendly_url, $post_slugs) && $i < 100) { $post_friendly_url = $slug . '-' . $i; $i++; } } else { $post_friendly_url = $slug; } # short story & full story $short_story = str_replace($conf['admin_url'], '{%MN_URL%}', $_POST['short_story']); $full_story = str_replace($conf['admin_url'], '{%MN_URL%}', $_POST['full_story']); if (isset($conf['posts_image']) && $conf['posts_image'] && isset($_FILES['image']['name']) && is_image($_FILES['image']['name'])) { $source_file = pathinfo_utf($_FILES['image']['name']);