if ($subs) { $subs = implode(',', $subs); $from_where = "FROM sub_statuses, links WHERE sub_statuses.id in ({$subs}) AND status='{$status}' AND link_id = link"; } } if (empty($from_where)) { $from_where = "FROM sub_statuses, links WHERE id = {$site_id} AND status='{$status}' AND link_id = link"; } $order_by = " ORDER BY {$order_field} DESC "; $sql = "SELECT link_id {$from_where} {$order_by} LIMIT {$rows}"; } if (!empty($sql)) { $links = $db->get_col($sql); } if ($links) { list_all('links', $links, $false, $site_info); } } exit(0); function list_all($what, $ids, $title, $site_info) { global $globals; header('Content-Type: application/json; charset=utf-8'); $json = array(); if ($title) { $json['title'] = $title; } $json['url'] = $globals['scheme'] . '//' . get_server_name() . $globals['base_url'] . $site_info->name; // $json['logo'] = $globals['scheme'].'//'.get_static_server_name().$globals['base_url'].'img/mnm/eli-rss.png'; $json['objects'] = array(); foreach ($ids as $id) {
function member_block() { global $db, $module_prefix; if (isset($_GET['id'])) { $page_id = intval($_GET['id']); $page = $db->sql_ufetchrow("SELECT id, parent_id, title FROM " . $module_prefix . "_pages WHERE id={$page_id}"); $sub = list_all($page['id'], false); if (count($sub) > 0) { $page['sub'] = $sub; } unset($sub); $pages = list_all($page['parent_id'], false); for ($i = 0; $i < count($pages); $i++) { if ($pages[$i]['id'] == $page_id) { $pages[$i] = $page; } } $pages = go_up($page_id, $parents); } themesidebox('Wiki Content', $content, 10000); }
} $page_no = ''; $crumbs[] = '<a href="' . URL::index() . '">' . $module_name . '</a>'; if ($page['parent_id'] > 0) { $parents = array(); get_parents($page['parent_id'], $parents); foreach ($parents as $parent) { $page_no .= "{$parent['pos']}."; $crumbs[] = '<a href="' . URL::index('&id=' . $parent['id']) . '">' . $parent['title'] . '</a>'; } } $crumbs[] = $page['title']; $crumbs = implode(' ' . _BC_DELIM . ' ', $crumbs); $pagetitle = strip_tags($crumbs); $tree = $page; $tree['sub'] = list_all($page['id'], false); $tree = go_up($tree); require_once 'header.php'; $cpgtpl->assign_vars(array('G_ID' => '1', 'U_CRUMBS' => '<span style="float: left;">' . $crumbs . '</span>', 'U_ADDPAGE' => is_user() ? '<a href="' . URL::index('&file=manage') . '">Add new page</a>' : '', 'U_EDITPAGE' => isset($_GET['id']) ? ' | <a href="' . URL::index('&file=manage&id=' . intval($_GET['id'])) . '">Edit this page</a>' : '', 'U_TREE' => create_tree($page_id, $tree), 'S_PAGE' => $page_no, 'S_SUBPAGE' => $page['pos'], 'S_TITLE' => $page['title'], 'S_COMMENT' => $page['comment'], 'S_BODY' => $page['body'], 'S_AUTHOR' => 'Author: <a href="' . URL::index('Your_Account&profile=' . $page['user_id']) . '">' . $page['author'] . '</a>', 'S_CREATED' => 'Created: ' . formatDateTime($page['time'], _DATESTRING), 'S_UPDATED' => $page['supercede'] ? 'Last update: ' . formatDateTime($page['supercede'], _DATESTRING) . ' by <a href="' . URL::index('Your_Account&profile=' . $page['upd_user_id']) . '">' . $page['upd_author'] . '</a>' : '')); $cpgtpl->set_filenames(array('body' => 'wiki/index.html')); $cpgtpl->display('body'); } else { $pagetitle = $module_name; require_once 'header.php'; $cpgtpl->assign_vars(array('G_ID' => '', 'S_TITLE' => $sitename . ' Wiki', 'U_ADDPAGE' => is_user() ? '<a href="' . URL::index('&file=manage') . '">Add new page</a>' : '')); $result = $db->sql_query("SELECT * FROM " . $module_prefix . "_pages WHERE parent_id=0 ORDER BY pos"); if ($db->sql_numrows($result) > 0) { while ($row = $db->sql_fetchrow($result)) { $cpgtpl->assign_block_vars('pages', array('U_PAGE' => '<li><b><a href="' . URL::index("&id=" . $row['id']) . '">' . $row['title'] . '</a></b><br />' . $row['comment'] . '</li>')); } }
<html><body> <?php error_reporting(E_ALL); include_once "/var/www/includes/puzzles.php"; function list_all() { $c = new category(); $all = $c->get_all_categories(); foreach ($all as $cc) { echo $cc->get_cname() . "<BR/>"; } } $c = new category(); $c->remove_category(101); list_all(); ?> </body></html>