:</label> <input type="text" class="text" name="folder_name" id="folder_name" value="<?php echo @$var['folder_name']; ?> " /> <?php if (!empty($folders)) { echo '<p><label for="folder_parent">' . $lang['folders_parent'] . ':</label><select name="folder_parent" id="folder_parent" class="long"><option value="0">--- ' . $lang['folders_select_main_folder'] . ' ---</option>'; $parents = $folders_sorted = array(); foreach ($folders as $fId => $f) { if (isset($folders[$fId]['parent_id']) && $folders[$fId]['parent_id'] != 0) { $parents[$folders[$fId]['parent_id']] = $fId; } $folders_sorted[$fId] = $f['name']; } $folders_sorted = mn_natcasesort($folders_sorted); function show_folderss($folder_id = 0, $level = 0) { global $folders, $folders_sorted, $parents, $var; foreach ($folders_sorted as $fId => $f_name) { if ($folders[$fId]['parent_id'] == $folder_id) { if (isset($var['folder_parent']) && $var['folder_parent'] == $fId) { $sel = ' selected="selected"'; } elseif ($fId == @$var['folder_id']) { $sel = ' disabled="disabled"'; } else { $sel = ''; } echo '<option value="' . $fId . '"' . $sel . '>'; for ($i = 0; $i < $level; $i++) { echo '-- ';
$comment_links .= $var['status'] != 0 ? '<a href="./mn-comments.php?action=reply&post=' . $var['post_id'] . '" class="fancy">' . $lang['comm_reply'] . '</a> · <a href="./mn-comments.php?action=edit&post=' . $var['post_id'] . '&id=' . $var['comment_id'] . '">' . $lang['uni_edit'] . '</a> · ' . $showhide . ' · <a href="./mn-comments.php?a=m&s=0&f=' . $var['post_id'] . '&c=' . $var['comment_id'] . '&t=' . $_SESSION['mn_token'] . '&msg=' . $lang['comm_status0'] . '" class="ajaxcall trash">' . $lang['comm_trash'] . '</a>' : '<a href="./mn-comments.php?a=m&s=1&f=' . $var['post_id'] . '&c=' . $var['comment_id'] . '&t=' . $_SESSION['mn_token'] . '&from=trash&msg=' . $lang['comm_status1'] . '" class="restore ajaxcall">' . $lang['comm_restore'] . '</a> · <a href="./mn-comments.php?a=m&s=d&f=' . $var['post_id'] . '&c=' . $var['comment_id'] . '&t=' . $_SESSION['mn_token'] . '&from=trash" class="delete ajaxcall">' . $lang['comm_delete_permanently'] . '</a>'; if (isset($_GET['q']) && strlen($_GET['q']) > 2) { $var['comment_text'] = preg_replace('/' . $_GET['q'] . '/is', '<span class="mn-highlight">\\0</span>', $var['comment_text']); } $comments_result .= '<tr id="c' . $var['comment_id'] . '"><td><a href="./?p=' . $post['id'] . '#c-' . $var['comment_id'] . '">#</a> <strong>' . $var['author_name'] . '</strong>' . $profile_link . '<input type="hidden" name="posts[]" value="' . $var['post_id'] . '" /><input type="checkbox" name="comments[]" value="' . $var['comment_id'] . '" class="checkbox"' . $checked . ' /><br /><span class="trivial">' . date('d.m.Y H:i', $var['timestamp']) . '</span><br />' . $status . '<span class="info hide">IP: <a href="./mn-comments.php?i=' . $var['ip_address'] . '" class="tooltip" title="' . $lang['comm_filter_by_ip_address'] . ' ' . $var['ip_address'] . '">' . $var['ip_address'] . '</a> ' . $ip_info . '</span> </td><td><div class="comment-text">' . comment_format($var['comment_text']) . '</div> <span class="comment-links hide">' . $comment_links . '</span></td><td><a href="./?p=' . $post['id'] . '">' . $post['title'] . '</a></td></tr>'; $c_count++; } } } $posts = mn_natcasesort($posts); $posts = array_unique($posts); ksort($comments_timestamps); $comments_timestamps = array_unique($comments_timestamps); $c_authors = array_unique($c_authors); $c_ips = array_unique($c_ips); $c_ips = mn_natcasesort($c_ips); } if (isset($_GET['back']) && $_GET['back'] == 'added') { overall_header($lang['comm_comments'], $lang['comm_msg_comment_added'], 'ok'); } elseif (isset($_GET['back']) && $_GET['back'] == 'deleted') { overall_header($lang['comm_comments'], $lang['comm_msg_comment_deleted'], 'ok'); } elseif (isset($_GET['back']) && $_GET['back'] == 'bulk-deleted') { overall_header($lang['comm_comments'], $lang['comm_msg_selected_comments_deleted'], 'ok'); } elseif (isset($_GET['back']) && $_GET['back'] == 'bulk-status1') { overall_header($lang['comm_comments'], $lang['comm_msg_bulk_status1'], 'ok'); } elseif (isset($_GET['back']) && $_GET['back'] == 'trash') { overall_header($lang['comm_comments'], $lang['comm_msg_moved_to_trash'], 'ok'); } else { overall_header($lang['comm_comments'], $lang['comm_comments'] . (isset($_GET['trash']) ? ': ' . $lang['uni_trash'] : ''), 'main'); } $admin_tmpl['comments_list'] = true;
$page_result = page_tmpl($mn_page_int, $page_tmpl . '_11', $mn_url); echo encoding($page_result); } } echo '<!-- Powered by MNews: www.mnewscms.com -->'; } elseif (isset($_GET['mn_user']) && !empty($_GET['mn_user']) && !empty($mn_users[$_GET['mn_user']]) && (!isset($mn_lock) || $mn_lock == 'user')) { $user_tmpl = isset($mn_tmpl) && file_exists(MN_ROOT . $dir['templates'] . $mn_tmpl . '_13.html') ? $mn_tmpl : DEFAULT_TMPL; $user_result = user_tmpl($_GET['mn_user'], $user_tmpl . '_13', $mn_url); echo encoding($user_result); echo '<!-- Powered by MNews: www.mnewscms.com -->'; } elseif (file_exists(MN_ROOT . $file['posts'])) { # read posts file $p_file = file(MN_ROOT . $file['posts']); $posts = array(); array_shift($p_file); $p_file = mn_natcasesort($p_file); $p_file = array_reverse($p_file, true); # put posts to arrays - one array for IDs, one for timestamps foreach ($p_file as $p_line) { $post = get_values('posts', $p_line, false); # we want only actuall and approved posts if ($post['timestamp'] > mn_time()) { continue; } elseif (!isset($mn_author) && $post['status'] != '1') { continue; } elseif (isset($mn_author) && $post['status'] > '2') { continue; } else { # check other settings if (!empty($mn_cat) && !in_array($post['cat'], $mn_cats)) { continue;
continue; } if (isset($_GET['g']) && !empty($_GET['g']) && !in_array($_GET['g'], $var['galleries_array'])) { continue; } if (isset($_GET['d']) && !empty($_GET['d']) && date('Y-m', $temp_data[4]) != $_GET['d']) { continue; } else { $files[$temp_data[0]] = $temp_data[4] . DELIMITER . $temp_data[1] . DELIMITER . $temp_data[2] . DELIMITER . $temp_data[0] . DELIMITER . $temp_data[3] . DELIMITER . $temp_data[5] . DELIMITER . $temp_data[8] . DELIMITER . $temp_data[6] . DELIMITER . $temp_data[7] . DELIMITER . $temp_data[16] . DELIMITER . $temp_data[17] . DELIMITER . $temp_data[10]; } } $files = mn_natcasesort($files); $files = array_reverse($files); $timestamps = array_unique($timestamps); $uploaders = array_unique($uploaders); $uploaders = mn_natcasesort($uploaders); foreach ($files as $file_id => $temp_data) { $f_data = explode(DELIMITER, $temp_data); $file_image = '<img src="./stuff/img/icons/file-' . $ext_img[strtolower($f_data[2])] . '.png" alt="" title="' . $f_data[2] . '" class="tooltip" width="16" height="16" />'; $file_class = $f_data[5] == 'images' ? ' class="main-link fancyimg" rel="fancygal"' : ' class="main-link"'; $img_size = isset($f_data[7]) && is_numeric($f_data[7]) ? '<br><span class="trivial">' . $f_data[7] . ' × ' . $f_data[8] . '</span>' : ''; $tr_class = ''; if (isset($_GET['hl'])) { $hl_arr = explode(',', $_GET['hl']); if (in_array($f_data[3], $hl_arr)) { $tr_class = ' class="highlight"'; } } if (isset($_GET['ajaxcall'])) { if ($f_data[5] == 'images') { $file_img = '<img src="' . MN_ROOT . $dir['thumbs'] . '_' . $f_data[1] . '.' . $f_data[2] . '" alt="" />';
exit; } else { overal_header($lang['cats_categories'], $lang['users_msg_put_contents_error'], 'error'); } } else { $u_file = file($file['users']); array_shift($u_file); $users_result = ''; $users = array(); $groups = load_basic_data('groups'); $posts_count = get_posts_count('users'); foreach ($u_file as $single_line) { $temp_data = explode(DELIMITER, $single_line); $users[$temp_data[0]] = $temp_data[1] . DELIMITER . $temp_data[3] . DELIMITER . $temp_data[4]; } $users = mn_natcasesort($users); foreach ($users as $user_id => $temp_data) { $u_data = explode(DELIMITER, $temp_data); if (user_auth('1', true)) { $user_posts_count = !isset($posts_count[$user_id]) || empty($posts_count[$user_id]) ? '<span class="trivial">0</span>' : '<a href="./mn-posts.php?a=' . $user_id . '">' . $posts_count[$user_id] . '</a>'; } else { $user_posts_count = !isset($posts_count[$user_id]) || empty($posts_count[$user_id]) ? '0' : '' . $posts_count[$user_id] . ''; } $delete_link = $user_id == 1 || $user_id == $_SESSION['mn_user_id'] ? '' : ' · <a href="./mn-users.php?action=delete&id=' . $user_id . '" class="fancy">' . $lang['uni_delete'] . '</a>'; if (count($users) > 2) { $star = $user_id == $_SESSION['mn_user_id'] ? ' <img src="./stuff/img/icons/star.png" alt="" />' : ''; } else { $star = ''; } $users_result .= '<tr><td><a href="./mn-users.php?action=edit&id=' . $user_id . '" class="main-link">' . $u_data[0] . '</a>' . $star . '<br /> <span class="links hide"><a href="./mn-users.php?action=edit&id=' . $user_id . '">' . $lang['uni_edit'] . '</a>' . $delete_link . '</span></td><td>' . $u_data[1] . '</td><td>' . $groups[$u_data[2]] . '</td><td class="c cell-posts">' . $user_posts_count . '</td></tr>'; }
} else { $c_file = file($dir['comments'] . 'comments_' . $p_id . '.php'); array_shift($c_file); foreach ($c_file as $c_line) { $c_data = explode(DELIMITER, $c_line); if ($c_data[3] == 2) { $c_aprocess++; } elseif ($c_data[3] == 0) { continue; } $comments[] .= $c_line; } } } if (!empty($comments)) { $comments = mn_natcasesort($comments); $comments = array_reverse($comments); $comments_count = count($comments); $j_max = isset($widget_counts[1]) && is_numeric($widget_counts[1]) ? $widget_counts[1] : 5; $j_max = $comments_count < $j_max ? $comments_count : $j_max; for ($j = 0; $j < $j_max; $j++) { $c = get_values('comments', $comments[$j], false); $cp = get_post_data($c['post_id']); $c['timestamp'] = $c['timestamp'] + $conf['time_adj'] * 3600; if (mb_strlen($cp['title']) > 16) { $tooltip = ' title="' . $cp['title'] . '"'; $cp['title'] = mb_substr($cp['title'], 0, 15, 'utf-8') . '…'; } else { $cp['title']; $tooltip = ''; }
} if (isset($_GET['action']) && $_GET['action'] == 'reorder') { if ($temp_var['visible'] == '1') { $pages[$temp_var['id']] = $temp_var['order']; } else { continue; } } else { $pages[$temp_var['id']] = $temp_var['friendly_url']; $p_timestamps[$temp_var['timestamp']] = date('Y-m', $temp_var['timestamp']); } } } } if (!empty($pages)) { $pages = mn_natcasesort($pages); $p_timestamps = array_unique($p_timestamps); $author = load_basic_data('users'); $pages_result = ''; foreach ($pages as $key => $value) { $var = get_page_data($key); if (isset($_GET['action']) && $_GET['action'] == 'reorder') { $pages_result .= '<li id="item_' . $var['id'] . '">' . $var['title'] . '</li>'; } else { $pass_img = !empty($var['pass']) ? '<img src="./stuff/img/icons/key-gray.png" alt="" width="16" height="16" class="tooltip" title="' . $lang['pages_protected_page'] . '" />' : ''; $status_img = $var['visible'] == 1 ? '<img src="./stuff/img/icons/tick-gray.png" alt="" width="16" height="16" class="tooltip" title="' . $lang['uni_yes'] . '" />' : '<img src="./stuff/img/icons/cross-gray.png" alt="" width="16" height="16" class="tooltip" title="' . $lang['uni_no'] . '" />'; $order_num = $var['order'] > 0 ? $var['order'] : ''; $page_author = empty($author[$var['author']]) ? '<em class="trivial">' . $lang['uni_anonym'] . ' ' . $var['author'] . '</em>' : $author[$var['author']]; $pages_result .= '<tr><td class="c">' . $var['id'] . '</td><td><a href="./mn-pages.php?action=edit&id=' . $var['id'] . '" class="main-link">' . $var['title'] . '</a> ' . $pass_img . '<br /> <span class="links hide"><a href="./mn-pages.php?action=edit&id=' . $var['id'] . '">' . $lang['uni_edit'] . '</a> · <a href="./mn-pages.php?action=delete&id=' . $var['id'] . '" class="fancy">' . $lang['uni_delete'] . '</a></span></td><td>' . $page_author . '</td><td class="c">' . $status_img . '</td><td class="c">' . $order_num . '</td><td>' . date('d.m.Y', $var['timestamp']) . '<br />' . date('H:i', $var['timestamp']) . '</td></tr>'; } }
} } else { die; } } elseif (isset($_GET['action']) && $_GET['action'] == 'cat_order') { if (isset($_GET['categories-list']) && is_array($_GET['categories-list'])) { $order = array(); foreach ($_GET['categories-list'] as $n => $cat_id) { if (empty($cat_id)) { continue; } else { $order[$n] = $cat_id; } } } mn_natcasesort($order); mn_put_contents($file['categories_order'], serialize($order)); exit; } elseif (isset($_POST['action']) && $_POST['action'] == 'add') { if (isset($_POST['cat_name']) && !empty($_POST['cat_name'])) { if (file_exists($file['categories'])) { $cats_file = file($file['categories']); $cats_file_lines = ''; foreach ($cats_file as $single_line) { $cat_data = explode(DELIMITER, $single_line); if (substr($cat_data[0], 0, 2) == '<?') { $auto_increment_id = trim($cat_data[1]); } else { $cats_file_lines .= $single_line; } }
function get_unique_timestamps() { global $file; if (file_exists(MN_ROOT . $file['posts'])) { $p_file = file(MN_ROOT . $file['posts']); $timestamps = array(); array_shift($p_file); $p_file = mn_natcasesort($p_file); $p_file = array_reverse($p_file, true); foreach ($p_file as $p_line) { $p = get_values('posts', $p_line, false); if ($p['status'] != '1' || $p['timestamp'] > mn_time()) { continue; } else { $timestamps[$p['timestamp']] = date('Y-m', $p['timestamp']); } } ksort($timestamps); $timestamps = array_unique($timestamps); return $timestamps; } else { return NULL; } }