function show_list() { $data = get_page_data(); $metadata = array('page' => isset($_GET['page']) ? $_GET['page'] : 1, 'sort' => isset($_GET['sort']) ? $_GET['sort'] : ''); $response = getViewContent('Список товаров', $data['products'], $data['pagination'], $metadata); $view = build_view($response); _show($view); }
function query_database($start, $end, $seller_id, $state, $conn) { $sql = "SELECT * FROM web_wine\n\t\t\t\tWHERE seller_id = '{$seller_id}'\n\t\t\t\tAND state = '{$state}'\n\t\t\t\tORDER BY create_time DESC;"; if ($state == -1) { $sql = "SELECT * FROM web_wine\n\t\t\t\t\tWHERE seller_id = '{$seller_id}'\n\t\t\t\t\tORDER BY create_time DESC;"; } $results = $conn->query($sql); echo get_page_data($start, $start + 20, $results); }
function pugpig_get_page($key) { $nums = pugpig_get_edition_and_page_num_from_id($key); return get_page_data($nums['edition_num'], $nums['page_num']); }
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']); } }
if (PHP_NUM < 5) { include './stuff/inc/tmpl/php4-info.php'; die; } include './stuff/inc/mn-start.php'; if (!file_exists('./' . $file['users']) && file_exists('./install.php')) { header('location: ./install.php'); exit; } elseif (!file_exists('./' . $file['pages'])) { $p_dir = dir($dir['pages']); $pages = array(); while ($p_file = $p_dir->read()) { if (!is_file($dir['pages'] . $p_file)) { continue; } else { $var = get_page_data($p_file, false); if (isset($var['author']) && !empty($var['author'])) { $pages[$var['id']] = array('id' => $var['id'], 'timestamp' => $var['timestamp'], 'title' => $var['title'], 'friendly_url' => $var['friendly_url'], 'author' => $var['author'], 'parent_id' => 0, 'order' => $var['order']); } else { continue; } } } mn_put_contents($file['pages'], DIE_LINE . serialize($pages)); } $auth = user_auth('0'); if (!isset($conf['admin_update_check']) || $conf['admin_update_check'] == true) { if (isset($_GET['check-version']) || !isset($_COOKIE['mn_latest_version'])) { $latest_version = get_latest_version(); if (!empty($latest_version)) { setcookie('mn_latest_version', $latest_version, time() + 60 * 60 * 24 * MN_VERSION_CHECK);
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>'; } } } $admin_tmpl['list'] = true; if (isset($_GET['back']) && $_GET['back'] == 'added') { overall_header($lang['pages_pages'], $lang['pages_msg_page_added'], 'ok'); } elseif (isset($_GET['back']) && $_GET['back'] == 'deleted') {
function pugpig_get_page($key) { $data = null; if (is_search_page_id($key)) { $info = get_search_page_info($key); $data = get_search_page_data($info['page_id']); } else { $nums = pugpig_get_edition_and_page_num_from_id($key); $data = get_page_data($nums['edition_num'], $nums['page_num']); } return $data; }
function query_database($start, $end, $seller_id, $conn) { $sql = "SELECT * FROM web_notification\n\t\t\t\tWHERE uid = '{$seller_id}'\n\t\t\t\tORDER BY create_time DESC;"; $results = $conn->query($sql); echo get_page_data($start, $start + 20, $results); }
function page_tmpl($id, $template, $url) { global $dir, $file, $conf, $mn_users; $p = get_page_data($id); $tmpl_file = file_exists(MN_ROOT . $dir['templates'] . $template . '.html') ? file_get_contents(MN_ROOT . $dir['templates'] . $template . '.html') : file_get_contents(MN_ROOT . $dir['templates'] . DEFAULT_TMPL . '_11.html'); $tmpl_search = array('{AUTHOR}', '{FRIENDLY_URL}', '{PAGE_ID}', '{TEXT}', '{TITLE}'); $tmpl_replace = array('<a href="' . $url . 'mn_user='******'author'] . '">' . $mn_users[$p['author']] . '</a>', $p['friendly_url'], $p['id'], $p['text'], $p['title']); $result = str_ireplace($tmpl_search, $tmpl_replace, $tmpl_file); $result = preg_replace('#\\[mn_gallery=(.*?)\\]#ie', 'mn_gallery(\'$1\')', $result); $result = common_tmpl($p['timestamp'], $result); $result = xfields_tmpl('pages', $p['xfields'], $result); return $result; }
function home($id) { $data = get_page_data($id); $html = "<html><h1>{$data['title']}</h1></html>"; return $html; }