function profileDispatch($op) { if (isset($_POST['undo'])) { $op = 'profile'; } switch ($op) { case "profile": profile(); break; case "modprofile": modprofile(); break; case "saveprofile": saveprofile(); break; case "newavatar": newavatar(); break; case "upavatar": upavatar(); break; case "renewalpwd": renewalpwd(); break; } }
function edit() { save_url(); // Luu current_url vao session $user = check_login12(1, 2); $data = array('user' => $user, 'meta_title' => 'Manage Profile', 'template' => 'home/edit'); $user_info = $this->mprofile->search_user($user['id']); if (!$user_info) { $data['error'] = 'User not found in database.'; $data['template'] = 'home/notify'; $this->load->view('home/frontend/layouts/home', isset($data) ? $data : NULL); return; } $data['user_info'] = $user_info; if ($this->input->post('submit')) { profile(); if ($this->form_validation->run() == TRUE) { $u_info = info_user(); $u_info['id'] = $user['id']; $this->mprofile->updateuser($u_info); $data['success'] = 'Cập nhật thông tin tài khoản thành công'; $data['template'] = 'home/notify'; $this->load->view('home/frontend/layouts/home', isset($data) ? $data : NULL); return; } } $this->load->view('home/frontend/layouts/home', isset($data) ? $data : NULL); }
function content($page, $count = 0) { global $langmessage, $menu, $message, $prefix, $out; $out = ""; if ($message != "") { $out .= "<div class=\"LNE_message\">" . $message . "</div>\n"; } switch ($_GET['do']) { case "search": $out .= "<h2 class=\"LNE_title\">{$langmessage['66']}</h2>\n"; search(true); break; case "profile": $out .= profile(); break; case "sitemap": $out .= showsitemap($langmessage, 1); break; case "login": $out .= loginform(); break; default: $result = dbquery('SELECT * FROM ' . $prefix . 'paginas WHERE page="' . $page . '"'); $row = fetch_array($result); if ($row['restricted'] != 0 && $row['restricted'] > $_SESSION['adminlevel']) { $out .= restrictedpage($row['restricted']); } else { $out .= markers(stripslashes(html_entity_decode($row['content']))); } } print $out; }
function home($twig) { global $normalPages; global $mandatoryLogin; $allPages = $normalPages + $mandatoryLogin; if (isset($_GET['page']) && !in_array($_GET['page'], $allPages)) { echo $twig->render('404.twig'); } else { if (isset($_GET['page']) && in_array($_GET['page'], $mandatoryLogin) && !isset($_SESSION['name'])) { echo $twig->render('500.twig'); } else { if (isset($_SESSION['name'])) { profile($twig); } else { echo $twig->render('homepage.twig'); } } } }
############################################################################################ ############################################################################################ ## Просмотр всех ссылок ## ############################################################################################ case 'all': $config['newtitle'] = 'Список всех ссылок'; $total = DBM::run()->count('rekuser', array('rek_time' => array('>', SITETIME))); if ($total > 0) { if ($start >= $total) { $start = 0; } $reklama = DBM::run()->select('rekuser', array('rek_time' => array('>', SITETIME)), $config['rekuserpost'], $start, array('rek_time' => 'DESC')); foreach ($reklama as $data) { echo '<div class="b">'; echo '<img src="/images/img/online.gif" alt="image" /> '; echo '<b><a href="' . $data['rek_site'] . '">' . $data['rek_name'] . '</a></b> (' . profile($data['rek_user']) . ')</div>'; echo 'Истекает: ' . date_fixed($data['rek_time']) . '<br />'; if (!empty($data['rek_color'])) { echo 'Цвет: <span style="color:' . $data['rek_color'] . '">' . $data['rek_color'] . '</span>, '; } else { echo 'Цвет: нет, '; } if (!empty($data['rek_bold'])) { echo 'Жирность: есть<br />'; } else { echo 'Жирность: нет<br />'; } } page_strnavigation('reklama.php?act=all&', $config['rekuserpost'], $start, $total); echo 'Всего ссылок: <b>' . $total . '</b><br /><br />'; } else {
function output_build_reader_toolbar_mobile($content) { if ($_SERVER['URL_ARRAY'][3] == 'bio') { $is_bio = TRUE; } elseif ($_SERVER['URL_ARRAY'][1] == 'send') { $is_send = TRUE; } elseif (in_array('archives', $_SERVER['URL_ARRAY'])) { $is_archives = TRUE; } else { $is_plan = TRUE; } $planwatchlist = file_get_contents("{$_SERVER['USER_ROOT']}/watchedlist.txt"); if ($is_send) { $_SERVER['PLANOWNER'] = $_SERVER['URL_ARRAY'][2]; plan_get_owner_info($_SERVER['PLANOWNER']); } if (user_is_valid($_SERVER['USERINFO_ARRAY']['username'], $_SERVER['USERINFO_ARRAY']['userpass']) && $_SERVER['PLANOWNER'] && !strstr($content, '<h1>Plan Read Failed</h1>')) { profile('reader_toolbar', 'begin'); if ($is_plan || $is_bio || $is_archives || $is_send && $_SERVER['URL_ARRAY'][2]) { // bio if ((file_exists("{$_SERVER['PWUSERS_DIR']}/{$_SERVER['PLANOWNER']}/bio.txt") || (strpos($_SERVER['PLANOWNER_REAL_LOCATION'], 'diaryland') || strpos($_SERVER['PLANOWNER_REAL_LOCATION'], 'livejournal'))) && !$is_bio) { $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['PLANOWNER_REAL_LOCATION']}/bio'>bio</a>"; } // send if ((strpos($_SERVER['PLANOWNER_REAL_LOCATION'], 'planworld.net') || strpos($_SERVER['PLANOWNER_REAL_LOCATION'], 'amherst.edu') || plan_is_local($_SERVER['PLANOWNER'])) && $_SERVER['PLANOWNER'] != $_SERVER['USER'] && !$is_send) { $send_files = files_list("{$_SERVER['USER_ROOT']}/sends", files_encode_safe_name("{$_SERVER['PLANOWNER']}") . "*"); if (is_array($send_files)) { $lastsend = formattime(filemtime("{$_SERVER['USER_ROOT']}/sends/" . end($send_files))); if (strstr(end($send_files), '.new')) { $lastsend .= " <b>NEW</b>"; } $lastsend = "({$lastsend})"; } $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/send/{$_SERVER['PLANOWNER_REAL_LOCATION']}/'>send</a>"; } // planread if ($is_send || $is_bio) { $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['PLANOWNER_REAL_LOCATION']}/'>plan</a>"; } // archives if (plan_has_archives($_SERVER['PLANOWNER_REAL_LOCATION'])) { if (!$is_archives) { $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['PLANOWNER']}/archives' >archives</a>"; } else { $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/read/{$_SERVER['PLANOWNER']}' >plan</a>"; } } // If the reader isn't watching the writer, offer the option if (!stristr($planwatchlist, $_SERVER['PLANOWNER']) && $is_plan) { $readertoolbar[] = "<span id='watch_link'><a href=\"javascript:loadXMLDoc('{$_SERVER['WEB_ROOT']}/lists/add_ajax/watched/!{$_SERVER['PLANOWNER_REAL_LOCATION']}:{$_SERVER['PLANOWNER_DISPLAY_NAME']}!',null,'planwatch');void(null);\" title='add {$_SERVER['PLANOWNER_DISPLAY_NAME']} to your watched list' >watch</a></span>"; } // if writer isn't a blog or the same as reader, offer the option of // blocking, unblocking, allowing, or disallowing access to reader's plan if ($_SERVER['PLANOWNER'] != $_SERVER['USER'] && !strpos($_SERVER['PLANOWNER'], '://')) { // offer administrators a link to masquerade as writer // this is so it's easy to follow up on plan-reported bugs if (user_is_administrator() && file_exists("{$_SERVER['PWUSERS_DIR']}/{$_SERVER['PLANOWNER']}/userinfo.dat")) { $readertoolbar[] = "<a href='{$_SERVER['WEB_ROOT']}/masq/on/{$_SERVER['PLANOWNER']}'>masq</a>"; } if ($is_plan) { $readertoolbar[] = "<a href='/lists/unread/{$_SERVER['PLANOWNER']}'>unread</a>"; } if ($is_send) { $readertoolbar[] = "<a href='/send/{$_SERVER['PLANOWNER']}/unread'>unread</a>"; } } // make the links into a string for output. $readertoolbar = "<li class='toolbutton'>" . implode("</li><li class='toolbutton'>", $readertoolbar) . "</li>\n"; $readertoolbar = str_replace("<li class='toolbutton'></li>", "", $readertoolbar); if (($lasttime = plan_get_last_update($_SERVER['PLANOWNER'])) && $is_plan) { $readertoolbar = "<li class='plan_data_block'>Last Update: " . formattime($lasttime) . "</li>" . $readertoolbar; } if ($lastlogin = plan_get_last_login($_SERVER['PLANOWNER'])) { if ($lastlogin > 1) { $readertoolbar = "<li class='plan_data_block' id='lastaction'>Last Action: " . formattime($lastlogin) . "</li>" . $readertoolbar; } } } profile('reader_toolbar', 'end'); } return $readertoolbar; }
echo '<div>'; if (!empty($data['ban_type'])) { echo 'Причина: ' . bb_code($data['ban_reason']) . '<br />'; echo 'Срок: ' . formattime($data['ban_term']) . '<br />'; } switch ($data['ban_type']) { case '1': $stat = '<span style="color:#ff0000">Забанил</span>:'; break; case '2': $stat = '<span style="color:#ffa500">Изменил</span>:'; break; default: $stat = '<span style="color:#00cc00">Разбанил</span>:'; } echo $stat . ' ' . profile($data['ban_send']) . '<br />'; echo '</div>'; } echo '<br /><input type="submit" value="Удалить выбранное" /></form>'; page_strnavigation('banhist.php?act=view&uz=' . $uz . '&', $config['listbanhist'], $start, $total); echo 'Всего действий: <b>' . $total . '</b><br /><br />'; } else { show_error('Истории банов еще нет!'); } } else { show_error('Ошибка! Данный пользователь не найден!'); } echo '<img src="/images/img/back.gif" alt="image" /> <a href="banhist.php">Вернуться</a><br />'; break; ############################################################################################ ## Удаление банов ##
$action = $_REQUEST['action']; switch ($action) { case 'players': echo json_encode(players()); break; case 'update': echo json_encode(updateStats(time(), $_REQUEST['team1'], $_REQUEST['team2'], $_REQUEST['scores'])); break; case 'reset': resetStats(); break; case 'ranking': echo json_encode(ranking()); break; case 'history': echo json_encode(history()); break; case 'log': echo json_encode(gameLog()); break; case 'match': if (isset($_REQUEST['team2'])) { echo json_encode(match($_REQUEST['team1'], $_REQUEST['team2'])); } else { echo json_encode(bestMatch($_REQUEST['team1'])); } break; case 'profile': echo json_encode(profile($_REQUEST['id'])); break; }
function snoop_list($source = FALSE) { profile('snoop_list'); $snoop_filename = "{$_SERVER['USER_ROOT']}/stats/snoop.txt"; if ($source == 'planwatch' || $source == 'homesnoop') { $ignore = "ignore_ajax"; } else { $ignore = "ignore"; } if (file_exists($snoop_filename)) { $snoop_a = file($snoop_filename); foreach ($snoop_a as $i => $snoop) { $snoop = trim($snoop); list($snooper, $snooptime) = explode(':', $snoop); if ($snooper != $_SERVER['USER'] && trim($snooper)) { if ($snooptime > $snoop_times[$snooper]) { $snoop_times[$snooper] = $snooptime; } } } if (is_array($snoop_times)) { $snoopers_lastview = plan_get_last_view(array_keys($snoop_times)); arsort($snoop_times); // for very old snoops, we test them once a day to make sure they're // still valid // TODO:(v4.5) improve and re-enable the snoop test // if (filemtime("$_SERVER[USER_ROOT]/stats/snoop_lastcheck") < (time()-24*3600)) // { // $test_snoops=TRUE; // file_put_contents("$_SERVER[USER_ROOT]/stats/snoop_lastcheck",time()); // } foreach ($snoop_times as $snooper => $snooptime) { // the actual validity test gets called here // if (($snooptime < (time()-(72*3600))) && $test_snoops) // { // $valid_snoop=snoop_test($snoopers[$j]); // } // else $valid_snoop=TRUE; // if everything's OK, add it to the list if ($snooptime) { $snooptime_display = formattime($snooptime); if (strstr($snooper, '@')) { list($username, $host) = explode("@", $snooper); $displayname = "{$username} <span style='font-size: 60%;'>@{$host}</span>"; } else { $displayname = $snooper; } if ($snoopers_lastview[$snooper] < $snooptime) { $read_status = 'unread'; } else { $read_status = 'read'; } if ($ignore == "ignore") { $content .= "<li><a class='tool' target='_self' href='{$_SERVER['WEB_ROOT']}/snoop/{$ignore}/{$snooper}/{$source}'>☒</a>\n\t\t\t\t\t\t<a class='{$read_status}' href='{$_SERVER['WEB_ROOT']}/read/{$snooper}'>{$displayname}</a> <span style='font-size: 80%;'>{$snooptime_display}\n" . " </span>\n" . "</li>\n"; } else { $content .= "<li><a class='tool' target='_self' href='javascript:loadXMLDoc(\"{$_SERVER['WEB_ROOT']}/snoop/{$ignore}/{$snooper}/{$source}\",null,\"{$source}\");'>☒</a>\n\t\t\t\t\t\t\t<a class='{$read_status}' href='{$_SERVER['WEB_ROOT']}/read/{$snooper}'>{$displayname} <span class='updatetime'>{$snooptime_display}\n</span></a>\n" . "</li>\n"; } } } } else { $content .= "<li class='unread'>no snoops found</li>\n"; } } profile('snoop_list'); return $content; }
<li><a href="../index.php"><img src="../image/hoome.png" height="30px"><span>Beranda</span></a></li> <li><a href="profile.php"><img src="../image/about.png" height="30px"><span style="display: block; opacity: 1; top: -40px;">Profile</span></a></li> <li><a href="help.php"><img src="../image/help.png" height="30px"><span>Bantuan</span></a></li> </ul> </div> </div><br/><br/> <div id="gambar_full"> <img src="../profile/rini.jpg" width="400"/> </div> <div id="gambar_overlay"></div> <div id="badan_program"> <div id="bada_program_kiri"><br/> <?php profile(); ?> </div> <div id="bada_program_kanan"> <br/> <div id="title_program"> <h2>Data Master Supplier</h2> </div> <br/> <!-- Back !--> <div id="kmbl"> <img src="../image/kmbli.png" height="30px" onclick="kembali()" /> </div> <!-- sarching !--> <div id='search-box'> <form id="cari" name="cari">
<img src="/images/img/edit.gif" alt="image" /> <b><?php echo profile($post['guest_user']); ?> </b> <small>(<?php echo date_fixed($post['guest_time']); ?> )</small><br /><br /> <div class="form"> <form action="index.php?act=editpost&id=<?php echo $id; ?> &start=<?php echo $start; ?> &uid=<?php echo $_SESSION['token']; ?> " method="post"> <textarea id="markItUp" cols="25" rows="5" name="msg"><?php echo $post['guest_text']; ?> </textarea><br /> <input value="Редактировать" type="submit" /> </form> </div><br />
{ static $times; $len = []; switch ($display) { case false: $times[] = microtime(true); break; case true: $start_total = array_shift($times); foreach ($times as $stop) { $stop_total = $stop; $len[] = $stop_total - $start_total; } unset($times); return $len; break; } } register_tick_function('profile'); declare (ticks=1) { foreach ($_SERVER['argv'] as $arg) { "{$arg}:" . strlen($arg) . "\n"; } } // (profile ( true ) ); print "---\n"; $i = 0; foreach (profile(true) as $time) { $i++; print "Line {$i}:{$time}\n"; }
if ($total > 0) { if ($start >= $total) { $start = 0; } $queryban = DB::run()->query("SELECT * FROM `spam` WHERE `spam_key`=? ORDER BY `spam_addtime` DESC LIMIT " . $start . ", " . $config['spamlist'] . ";", array(6)); echo '<form action="spam.php?act=del&ref=blog&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">'; echo '<div class="form">'; echo '<input type="checkbox" id="all" onchange="var o=this.form.elements;for(var i=0;i<o.length;i++)o[i].checked=this.checked" /> <b><label for="all">Отметить все</label></b>'; echo '</div>'; while ($data = $queryban->fetch()) { echo '<div class="b">'; echo '<input type="checkbox" name="del[]" value="' . $data['spam_id'] . '" /> '; echo '<img src="/images/img/files.gif" alt="image" /> <b>' . profile($data['spam_login']) . '</b> <small>(' . date_fixed($data['spam_time'], "d.m.y / H:i:s") . ')</small></div>'; echo '<div>Сообщение: ' . bb_code($data['spam_text']) . '<br />'; echo '<a href="' . $data['spam_link'] . '">Перейти к сообщению</a><br />'; echo 'Жалоба: ' . profile($data['spam_user']) . ' (' . date_fixed($data['spam_addtime']) . ')</div>'; } echo '<br /><input type="submit" value="Удалить выбранное" /></form>'; page_strnavigation('spam.php?act=blog&', $config['spamlist'], $start, $total); if (is_admin(array(101, 102))) { echo '<img src="/images/img/error.gif" alt="image" /> <a href="spam.php?act=clear&uid=' . $_SESSION['token'] . '">Очистить</a><br />'; } } else { show_error('Жалоб еще нет!'); } break; ############################################################################################ ## Удаление сообщений ## ############################################################################################ ############################################################################################ ## Удаление сообщений ##
<?php function profile() { return array(1, '田中', '1988年8月8日', '埼玉県'); } $deta = profile(); foreach ($deta as $key => $value) { if ($key == 0) { continue; } } //echo $deta[1].$deta[2].$deta[3]; echo $value;
switch ($act) { ############################################################################################ ## Главная страница ## ############################################################################################ case 'index': $total = DB::run()->querySingle("SELECT count(*) FROM `contact` WHERE `contact_user`=?;", array($log)); if ($total > 0) { if ($start >= $total) { $start = last_page($total, $config['contactlist']); } $querycontact = DB::run()->query("SELECT * FROM `contact` WHERE `contact_user`=? ORDER BY `contact_time` DESC LIMIT " . $start . ", " . $config['contactlist'] . ";", array($log)); echo '<form action="contact.php?act=del&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">'; while ($data = $querycontact->fetch()) { echo '<div class="b">'; echo '<div class="img">' . user_avatars($data['contact_name']) . '</div>'; echo '<b>' . profile($data['contact_name']) . '</b> <small>(' . date_fixed($data['contact_time']) . ')</small><br />'; echo user_title($data['contact_name']) . ' ' . user_online($data['contact_name']) . '</div>'; echo '<div>'; if (!empty($data['contact_text'])) { echo 'Заметка: ' . $data['contact_text'] . '<br />'; } echo '<input type="checkbox" name="del[]" value="' . $data['contact_id'] . '" /> '; echo '<a href="/pages/private.php?act=submit&uz=' . $data['contact_name'] . '">Написать</a> | '; echo '<a href="/pages/perevod.php?uz=' . $data['contact_name'] . '">Перевод</a> | '; echo '<a href="/pages/contact.php?act=note&id=' . $data['contact_id'] . '">Заметка</a>'; echo '</div>'; } echo '<br /><input type="submit" value="Удалить выбранное" /></form>'; page_strnavigation('contact.php?', $config['contactlist'], $start, $total); echo 'Всего в контактах: <b>' . (int) $total . '</b><br />'; } else {
function getContent($pageId, $action, $userId, $permission, $recursed = 0) { if ($action == "login") { if ($userId == 0) { ///Commented the requirement of login.lib.php because it is already included in /index.php //require_once("login.lib.php"); $newUserId = login(); if (is_numeric($newUserId)) { return getContent($pageId, "view", $newUserId, getPermissions($newUserId, $pageId, "view"), 0); } else { return $newUserId; } ///<The login page } else { displayinfo("You are logged in as " . getUserName($userId) . "! Click <a href=\"./+logout\">here</a> to logout."); } return getContent($pageId, "view", $userId, getPermissions($userId, $pageId, "view"), $recursed = 0); } if ($action == "profile") { if ($userId != 0) { require_once "profile.lib.php"; return profile($userId); } else { displayinfo("You need to <a href=\"./+login\">login</a> to view your profile.!"); } } if ($action == "logout") { if ($userId != 0) { $newUserId = resetAuth(); displayinfo("You have been logged out!"); global $openid_enabled; if ($openid_enabled == 'true') { displaywarning("If you logged in via Open ID, make sure you also log out from your Open ID service provider's website. Until then your session in this website will remain active !"); } return getContent($pageId, "view", $newUserId, getPermissions($newUserId, $pageId, "view"), 0); } else { displayinfo("You need to <a href=\"./+login\">login</a> first to logout!"); } } if ($action == "search") { require_once "search.lib.php"; $ret = getSearchBox(); if (isset($_POST['query'])) { $ret .= getSearchResultString($_POST['query']); } elseif (isset($_GET['query'])) { $ret .= getSearchResultString($_GET['query']); } return $ret; } if (isset($_GET['subaction']) && $_GET['subaction'] == 'getchildren') { if (isset($_GET['parentpath'])) { global $urlRequestRoot; require_once 'menu.lib.php'; $pidarr = array(); parseUrlReal(escape($_GET['parentpath']), $pidarr); $pid = $pidarr[count($pidarr) - 1]; $children = getChildren($pid, $userId); $response = array(); $response['path'] = escape($_GET['parentpath']); $response['items'] = array(); foreach ($children as $child) { $response['items'][] = array($urlRequestRoot . '/home' . escape($_GET['parentpath']) . $child[1], $child[2]); } //echo json_encode($response); exit; } } if ($permission != true) { if ($userId == 0) { $suggestion = "(Try <a href=\"./+login\">logging in?</a>)"; } else { $suggestion = ""; } displayerror("You do not have the permissions to view this page. {$suggestion}<br /><input type=\"button\" onclick=\"history.go(-1)\" value=\"Go back\" />"); return ''; } if ($action == "admin") { require_once "admin.lib.php"; return admin($pageId, $userId); } ///default actions also to be defined here (and not outside) /// Coz work to be done after these actions do involve the page $pagetype_query = "SELECT page_module, page_modulecomponentid FROM " . MYSQL_DATABASE_PREFIX . "pages WHERE page_id='" . escape($pageId) . "'"; $pagetype_result = mysql_query($pagetype_query); $pagetype_values = mysql_fetch_assoc($pagetype_result); if (!$pagetype_values) { displayerror("The requested page does not exist."); return ""; } $moduleType = $pagetype_values['page_module']; $moduleComponentId = $pagetype_values['page_modulecomponentid']; if ($action == "settings") { ///<done here because we needed to check if the page exists for sure. require_once "pagesettings.lib.php"; return pagesettings($pageId, $userId); } if ($action == "widgets") { return handleWidgetPageSettings($pageId); } if ($recursed == 0) { $pagetypeupdate_query = "UPDATE " . MYSQL_DATABASE_PREFIX . "pages SET page_lastaccesstime=NOW() WHERE page_id='" . escape($pageId) . "'"; $pagetypeupdate_result = mysql_query($pagetypeupdate_query); if (!$pagetypeupdate_result) { return '<div class="cms-error">Error No. 563 - An error has occured. Contact the site administators.</div>'; } } if ($moduleType == "link") { return getContent($moduleComponentId, $action, $userId, true, 1); } if ($action == "grant") { return grantPermissions($userId, $pageId); } if ($moduleType == "menu") { return getContent(getParentPage($pageId), $action, $userId, true, 1); } if ($moduleType == "external") { $query = "SELECT `page_extlink` FROM `" . MYSQL_DATABASE_PREFIX . "external` WHERE `page_modulecomponentid` =\n\t\t\t\t\t(SELECT `page_modulecomponentid` FROM `" . MYSQL_DATABASE_PREFIX . "pages` WHERE `page_id`= '" . escape($pageId) . "')"; $result = mysql_query($query); $values = mysql_fetch_array($result); $link = $values[0]; header("Location: {$link}"); } global $sourceFolder; global $moduleFolder; require_once $sourceFolder . "/" . $moduleFolder . "/" . $moduleType . ".lib.php"; $page = new $moduleType(); if (!$page instanceof module) { displayerror("The module \"{$moduleType}\" does not implement the inteface module</div>"); return ""; } $createperms_query = " SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action = 'create' AND page_module = '" . $moduleType . "'"; $createperms_result = mysql_query($createperms_query); if (mysql_num_rows($createperms_result) < 1) { displayerror("The action \"create\" does not exist in the module \"{$moduleType}\"</div>"); return ""; } $availableperms_query = "SELECT * FROM " . MYSQL_DATABASE_PREFIX . "permissionlist where perm_action != 'create' AND page_module = '" . $moduleType . "'"; $availableperms_result = mysql_query($availableperms_query); $permlist = array(); while ($value = mysql_fetch_assoc($availableperms_result)) { array_push($permlist, $value['perm_action']); } array_push($permlist, "view"); $class_methods = get_class_methods($moduleType); foreach ($permlist as $perm) { if (!in_array("action" . ucfirst($perm), $class_methods)) { displayerror("The action \"{$perm}\" does not exist in the module \"{$moduleType}\"</div>"); return ""; } } if ($action == "pdf") { if (isset($_GET['depth'])) { $depth = $_GET['depth']; } else { $depth = 0; } if (!is_numeric($depth)) { $depth = 0; } global $TITLE; global $sourceFolder; require_once "{$sourceFolder}/modules/pdf/html2fpdf.php"; $pdf = new HTML2FPDF(); $pdf->setModuleComponentId($moduleComponentId); $pdf->AddPage(); $pdf->WriteHTML($page->getHtml($userId, $moduleComponentId, "view")); $cp = array(); $j = 0; if ($depth == -1) { $cp = child($pageId, $userId, $depth); if ($cp[0][0]) { for ($i = 0; $cp[$i][0] != NULL; $i++) { require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php"; $page1 = new $cp[$i][2](); $modCompId = $cp[$i][5]; $pdf->setModuleComponentId($modCompId); $pdf->AddPage(); $pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view")); } } } else { if ($depth > 0) { $cp = child($pageId, $userId, $depth); --$depth; while ($depth > 0) { $count = count($cp); for ($j; $j < $count; $j++) { $cp = array_merge((array) $cp, (array) child($cp[$j][0], $userId, $depth)); } --$depth; } if ($cp[0][0]) { for ($i = 0; isset($cp[$i]); $i++) { require_once $sourceFolder . "/" . $moduleFolder . "/" . $cp[$i][2] . ".lib.php"; $page1 = new $cp[$i][2](); $modCompId = $cp[$i][5]; $pdf->setModuleComponentId($modCompId); $pdf->AddPage(); $pdf->WriteHTML($page1->getHtml($userId, $modCompId, "view")); } } } } $filePath = $sourceFolder . "/uploads/temp/" . $TITLE . ".pdf"; while (file_exists($filePath)) { $filePath = $sourceFolder . "/uploads/temp/" . $TITLE . "-" . rand() . ".pdf"; } $pdf->Output($filePath); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: private", false); header("Content-Type: application/pdf"); header("Content-Disposition: attachment; filename=\"" . basename($filePath) . "\";"); header("Content-Transfer-Encoding: binary"); header("Content-Length: " . filesize($filePath)); @readfile("{$filePath}"); unlink($filePath); } return $page->getHtml($userId, $moduleComponentId, $action); }
$start = 0; } $is_admin = is_admin(); if ($is_admin) { echo '<form action="wall.php?act=del&uz=' . $uz . '&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">'; } elseif ($uz == $log) { echo '<form action="wall.php?act=delete&uz=' . $uz . '&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">'; } $querywall = DB::run()->query("SELECT * FROM `wall` WHERE `wall_user`=? ORDER BY `wall_time` DESC LIMIT " . $start . ", " . $config['wallpost'] . ";", array($uz)); while ($data = $querywall->fetch()) { echo '<div class="b">'; echo '<div class="img">' . user_avatars($data['wall_login']) . '</div>'; if ($is_admin || $uz == $log) { echo '<span class="imgright"><input type="checkbox" name="del[]" value="' . $data['wall_id'] . '" /></span>'; } echo '<b>' . profile($data['wall_login']) . '</b> <small>(' . date_fixed($data['wall_time']) . ')</small><br />'; echo user_title($data['wall_login']) . ' ' . user_online($data['wall_login']) . '</div>'; if ($uz == $log && $log != $data['wall_login']) { echo '<div class="right">'; echo '<a href="private.php?act=submit&uz=' . $data['wall_login'] . '">Приват</a> / '; echo '<a href="wall.php?uz=' . $data['wall_login'] . '">Стена</a> / '; echo '<noindex><a href="wall.php?act=spam&id=' . $data['wall_id'] . '&start=' . $start . '&uid=' . $_SESSION['token'] . '" onclick="return confirm(\'Вы подтверждаете факт спама?\')" rel="nofollow">Спам</a></noindex></div>'; } echo '<div>' . bb_code($data['wall_text']) . '</div>'; } if ($is_admin || $uz == $log) { echo '<span class="imgright"><input type="submit" value="Удалить выбранное" /></span></form>'; } page_strnavigation('wall.php?uz=' . $uz . '&', $config['wallpost'], $start, $total); } else { show_error('Записок еще нет!');
function getProfileViewRegistrantsForm() { if (isset($_GET['subsubaction'])) { if ($_GET['subsubaction'] == 'editregistrant' && (isset($_GET['useremail']) || isset($_POST['useremail']))) { $email = isset($_GET['useremail']) ? escape($_GET['useremail']) : escape($_POST['useremail']); return profile(getUserIdFromEmail($email), true); } elseif ($_GET['subsubaction'] == 'deleteregistrant' && isset($_GET['useremail'])) { deleteUserAccount(getUserIdFromEmail(escape($_GET['useremail']))); } } return getProfileRegistrantsList($_GET['subaction'] == 'editsiteregistrants'); }
echo ' (<a href="/blog/blog.php?cid=' . $cid . '&start=' . $start . '">Обзор</a>)'; echo '<hr />'; $total = DB::run()->querySingle("SELECT count(*) FROM `blogs` WHERE `blogs_cats_id`=?;", array($cid)); if ($total > 0) { if ($start >= $total) { $start = 0; } $queryblog = DB::run()->query("SELECT * FROM `blogs` WHERE `blogs_cats_id`=? ORDER BY `blogs_time` DESC LIMIT " . $start . ", " . $config['blogpost'] . ";", array($cid)); echo '<form action="blog.php?act=delblog&cid=' . $cid . '&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">'; while ($data = $queryblog->fetch()) { echo '<div class="b"><img src="/images/img/edit.gif" alt="image" /> '; echo '<b><a href="/blog/blog.php?act=view&id=' . $data['blogs_id'] . '">' . $data['blogs_title'] . '</a></b> (' . format_num($data['blogs_rating']) . ')<br />'; echo '<input type="checkbox" name="del[]" value="' . $data['blogs_id'] . '" /> '; echo '<a href="blog.php?act=editblog&cid=' . $cid . '&id=' . $data['blogs_id'] . '&start=' . $start . '">Редактировать</a> / '; echo '<a href="blog.php?act=moveblog&cid=' . $cid . '&id=' . $data['blogs_id'] . '&start=' . $start . '">Переместить</a></div>'; echo '<div>Автор: ' . profile($data['blogs_user']) . ' (' . date_fixed($data['blogs_time']) . ')<br />'; echo 'Просмотров: ' . $data['blogs_read'] . '<br />'; echo '<a href="/blog/blog.php?act=comments&id=' . $data['blogs_id'] . '">Комментарии</a> (' . $data['blogs_comments'] . ')<br />'; echo '</div>'; } echo '<br /><input type="submit" value="Удалить выбранное" /></form>'; page_strnavigation('blog.php?act=blog&cid=' . $cid . '&', $config['blogpost'], $start, $total); } else { show_error('В данном разделе еще нет статей!'); } } else { show_error('Ошибка! Данного раздела не существует!'); } echo '<img src="/images/img/reload.gif" alt="image" /> <a href="blog.php">Категории</a><br />'; break; ############################################################################################
$total = DB::run()->querySingle("SELECT count(*) FROM `commphoto` WHERE `commphoto_user`=?;", array($uz)); if ($total > 0) { if ($start >= $total) { $start = last_page($total, $config['postgallery']); } $page = floor(1 + $start / $config['postgallery']); $config['newtitle'] = 'Список всех комментариев ' . nickname($uz) . ' (Стр. ' . $page . ')'; $querycomm = DB::run()->query("SELECT `commphoto`.*, `photo_title` FROM `commphoto` LEFT JOIN `photo` ON `commphoto`.`commphoto_gid`=`photo`.`photo_id` WHERE `commphoto_user`=? ORDER BY `commphoto_time` DESC LIMIT " . $start . ", " . $config['postgallery'] . ";", array($uz)); while ($data = $querycomm->fetch()) { echo '<div class="b"><img src="/images/img/balloon.gif" alt="image" /> <b><a href="comments.php?act=viewcomm&gid=' . $data['commphoto_gid'] . '&cid=' . $data['commphoto_id'] . '">' . $data['photo_title'] . '</a></b>'; if (is_admin()) { echo ' — <a href="comments.php?act=del&id=' . $data['commphoto_id'] . '&uz=' . $uz . '&start=' . $start . '&uid=' . $_SESSION['token'] . '">Удалить</a>'; } echo '</div>'; echo '<div>' . bb_code($data['commphoto_text']) . '<br />'; echo 'Написал: ' . profile($data['commphoto_user']) . '</b> <small>(' . date_fixed($data['commphoto_time']) . ')</small><br />'; if (is_admin() || empty($config['anonymity'])) { echo '<span class="data">(' . $data['commphoto_brow'] . ', ' . $data['commphoto_ip'] . ')</span>'; } echo '</div>'; } page_strnavigation('comments.php?act=comments&uz=' . $uz . '&', $config['postgallery'], $start, $total); } else { show_error('Комментариев еще нет!'); } break; ############################################################################################ ## Переход к сообщение ## ############################################################################################ ############################################################################################ ## Переход к сообщение ##
echo $data['blogs_title']; ?> </a></b> (<?php echo format_num($data['blogs_rating']); ?> ) </div> <div> Категория: <a href="blog.php?cid=<?php echo $data['blogs_cats_id']; ?> "><?php echo $data['cats_name']; ?> </a><br /> Просмотров: <?php echo $data['blogs_read']; ?> <br /> Добавил: <?php echo profile($data['blogs_user']); ?> (<?php echo date_fixed($data['blogs_time']); ?> ) </div> <?php }
<?php function profile() { $num1 = 'id'; $num2 = 'name'; $num3 = 'sei'; $num4 = 'address'; return array($num1, $num2, $num3, $num4); } $my = profile(); foreach ($my as $value) { if ($value == 'id') { continue; } echo $value . '<br>'; }
show_error('Зарегистированных пользователей нет!'); } echo '<div class="b"><b>Поздравляем именинников:</b></div>'; $queryuser = DB::run()->query("SELECT `users_login` FROM `users` WHERE substr(`users_birthday`,1,5)=?;", array($montime)); $arrhappy = $queryuser->fetchAll(PDO::FETCH_COLUMN); $total = count($arrhappy); if ($total > 0) { foreach ($arrhappy as $key => $value) { $comma = empty($key) ? '' : ', '; echo $comma . user_gender($value) . '<b>' . profile($value) . '</b>'; } echo '<br />Всего именниников: ' . $total . ' чел.<br /><br />'; } else { show_error('Сегодня именинников нет!'); } // ---------------------------------------------------------------------------------// echo '<div class="b"><b>Приветствуем новичков:</b></div>'; $queryuser = DB::run()->query("SELECT `users_login` FROM `users` WHERE `users_joined`>?;", array(SITETIME - 86400)); $arrnovice = $queryuser->fetchAll(PDO::FETCH_COLUMN); $total = count($arrnovice); if ($total > 0) { foreach ($arrnovice as $key => $value) { $comma = empty($key) ? '' : ', '; echo $comma . user_gender($value) . '<b>' . profile($value) . '</b>'; } echo '<br />Всего новичков: ' . $total . ' чел.<br /><br />'; } else { show_error('Новичков пока нет!'); } echo '<img src="/images/img/users.gif" alt="image" /> <a href="who.php">Kто-где?</a><br />'; include_once '../themes/footer.php';
if ($deldate >= 180) { $deltime = $deldate * 24 * 3600; $queryusers = DB::run()->query("SELECT users_login FROM users WHERE users_timelastlogin<? AND users_point<=?;", array(SITETIME - $deltime, $point)); $users = $queryusers->fetchAll(PDO::FETCH_COLUMN); $total = count($users); if ($total > 0) { echo 'Будут удалены пользователи не посещавшие сайт более <b>' . $deldate . '</b> дней <br />'; echo 'И имеющие в своем активе не более ' . points($point) . '<br /><br />'; echo '<b>Список:</b> '; foreach ($users as $key => $value) { if ($key == 0) { $comma = ''; } else { $comma = ', '; } echo $comma . ' ' . profile($value); } echo '<br /><br />Будет удалено пользователей: <b>' . $total . '</b><br /><br />'; echo '<img src="/images/img/error.gif" alt="image" /> <b><a href="delusers.php?act=del&deldate=' . $deldate . '&point=' . $point . '&uid=' . $_SESSION['token'] . '">Удалить пользователей</a></b><br /><br />'; } else { show_error('Пользователи для удаления отсутсвуют!'); } } else { show_error('Ошибка! Указанно недопустимое время для удаления!'); } echo '<img src="/images/img/back.gif" alt="image" /> <a href="delusers.php">Вернуться</a><br />'; break; ############################################################################################ ## Удаление пользователей ## ############################################################################################ ############################################################################################
echo '<img src="/images/img/reload.gif" alt="image" /> <a href="index.php">К голосованиям</a><br />'; break; ############################################################################################ ## Голосование ## ############################################################################################ ############################################################################################ ## Голосование ## ############################################################################################ case 'voters': show_title('Последние проголосовавшие'); $votes = DB::run()->queryFetch("SELECT * FROM `vote` WHERE `vote_id`=? LIMIT 1;", array($id)); if (!empty($votes)) { $config['newtitle'] = $votes['vote_title']; echo '<img src="/images/img/stat.gif" alt="image" /> <b>' . $votes['vote_title'] . '</b> (Голосов: ' . $votes['vote_count'] . ')<br /><br />'; $querypoll = DB::run()->query("SELECT `poll_user`, `poll_time` FROM `votepoll` WHERE `poll_vote_id`=? ORDER BY `poll_time` DESC LIMIT 20;", array($id)); $polls = $querypoll->fetchAll(); foreach ($polls as $poll) { echo user_gender($poll['poll_user']) . profile($poll['poll_user']) . ' (' . date_fixed($poll['poll_time']) . ')<br />'; } echo '<br />'; } else { show_error('Ошибка! Данного голосования не существует!'); } echo '<img src="/images/img/back.gif" alt="image" /> <a href="index.php?act=poll&id=' . $id . '">Вернуться</a><br />'; echo '<img src="/images/img/reload.gif" alt="image" /> <a href="index.php">К голосованиям</a><br />'; break; default: redirect("index.php"); } echo '<img src="/images/img/luggage.gif" alt="image" /> <a href="history.php">Архив голосований</a><br />'; include_once '../themes/footer.php';
} echo '<a href="newload.php?act=deldown&del=' . $new['downs_id'] . '&uid=' . $_SESSION['token'] . '" onclick="return confirm(\'Вы подтверждаете удаление файла?\')">Удалить файл</a><hr />'; $folder = $new['folder'] ? $new['folder'] . '/' : ''; if (!empty($new['downs_link'])) { echo '<img src="/images/img/download.gif" alt="image" /> <b><a href="/load/files/' . $folder . $new['downs_link'] . '">' . $new['downs_link'] . '</a></b> (' . read_file(BASEDIR . '/load/files/' . $folder . $new['downs_link']) . ') (<a href="newload.php?act=delfile&id=' . $id . '" onclick="return confirm(\'Вы действительно хотите удалить данный файл?\')">Удалить</a>)<br />'; } else { echo '<img src="/images/img/download.gif" alt="image" /> <b>Не загружен</b><br />'; } if (!empty($new['downs_screen'])) { echo '<img src="/images/img/gallery.gif" alt="image" /> <b><a href="/load/screen/' . $folder . $new['downs_screen'] . '">' . $new['downs_screen'] . '</a></b> (' . read_file(BASEDIR . '/load/screen/' . $folder . $new['downs_screen']) . ') (<a href="newload.php?act=delscreen&id=' . $id . '" onclick="return confirm(\'Вы действительно хотите удалить данный скриншот?\')">Удалить</a>)<br /><br />'; echo resize_image('load/screen/' . $folder, $new['downs_screen'], $config['previewsize']) . '<br />'; } else { echo '<img src="/images/img/gallery.gif" alt="image" /> <b>Не загружен</b><br />'; } echo '<br /><b><big>Редактирование</big></b><br /><br />'; echo 'Добавлено: <b>' . profile($new['downs_user']) . '</b> ' . user_visit($new['downs_user']) . '<br />'; echo 'Время последнего изменения: (' . date_fixed($new['downs_time']) . ')<br /><br />'; echo '<div class="form">'; echo '<form action="newload.php?act=edit&id=' . $id . '&uid=' . $_SESSION['token'] . '" method="post">'; echo 'Категория*:<br />'; $output = array(); foreach ($downs as $row) { $i = $row['cats_id']; $p = $row['cats_parent']; $output[$p][$i] = $row; } echo '<select name="cid">'; foreach ($output[0] as $key => $data) { $selected = $new['downs_cats_id'] == $data['cats_id'] ? ' selected="selected"' : ''; $disabled = !empty($data['closed']) ? ' disabled="disabled"' : ''; echo '<option value="' . $data['cats_id'] . '"' . $selected . $disabled . '>' . $data['cats_name'] . '</option>';
{ $stmt = $connection->prepare("select firstName,lastName,score,followed,following,battles from users where id=?"); $stmt->bind_param("i", $id_user); $stmt->execute(); $result = $stmt->get_result(); $row = $result->fetch_array(MYSQLI_ASSOC); return $row; } header('Content-Type: text/xml'); echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>'; $connection = connectDB(); $visited = $_POST['visited']; //$sess_usr=$_SESSION['id']; $id_user = 1; $sess_usr = 12; $row = profile($connection, $visited); echo '<user>'; echo '<f_name>'; echo $row['firstName']; echo '</f_name>'; echo '<l_name>'; echo $row['lastName']; echo '</l_name>'; echo '<score>'; echo $row['score']; echo '</score>'; echo '<followed>'; echo $row['followed']; echo '</followed>'; echo '<following>'; echo $row['following'];
require_once '../includes/start.php'; require_once '../includes/functions.php'; require_once '../includes/header.php'; include_once '../themes/header.php'; $start = isset($_GET['start']) ? abs(intval($_GET['start'])) : 0; show_title('Кто-где'); $total = DB::run()->querySingle("SELECT count(*) FROM `visit`;"); if ($total > 0) { if ($total > $config['lastusers']) { $total = $config['lastusers']; } if ($start >= $total) { $start = 0; } $queryvisit = DB::run()->query("SELECT * FROM `visit` ORDER BY `visit_nowtime` DESC LIMIT " . $start . ", " . $config['showuser'] . ";"); while ($data = $queryvisit->fetch()) { if (SITETIME - $data['visit_nowtime'] < 600) { $lastvisit = '<span style="color:#00ff00">Oнлайн</span>'; } else { $lastvisit = formattime(SITETIME - $data['visit_nowtime'], 0) . ' назад'; } echo '<div class="b">' . user_gender($data['visit_user']) . ' <b>' . profile($data['visit_user']) . '</b> (' . $lastvisit . ')</div>'; $position = !empty($data['visit_page']) ? $data['visit_page'] : 'Не определено'; echo '<div>Находится: ' . $position . '<br />'; echo 'Переходов: ' . $data['visit_count'] . '</div>'; } page_strnavigation('who.php?', $config['showuser'], $start, $total); } else { show_error('Пользователей еще нет!'); } include_once '../themes/footer.php';
public function name_objects_match($name_object_1, $name_object_2) { profile("starting name match"); $genus_match = $this->match_genera($name_object_1->genus, $name_object_2->genus); profile("match_genera"); $epithets_match = $this->match_species_epithets($name_object_1->species, $name_object_2->species); profile("match_species_epithets"); $total_length = strlen($name_object_1->genus) + strlen($name_object_1->species) + strlen($name_object_2->genus) + strlen($name_object_2->species); $match = $this->match_matches($genus_match, $epithets_match); profile("match_matches"); if ($match['match']) { $author_match_score = $this->compare_authorities($name_object_1->authors_years, $name_object_2->authors_years); profile("compare_authorities"); if (!$author_match_score) { $match['match'] = false; } } return $this->match_response_to_float($match, $total_length); }
echo '<img src="/images/img/error.gif" alt="Закрыто" /> <b><span style="color:#ff0000">Закрыто</span></b>'; break; default: echo '<img src="/images/img/faq.gif" alt="Под вопросом" /> <b><span style="color:#ffa500">Под вопросом</span></b>'; } echo '</div>'; echo '<div class="right"><a href="offers.php?act=edit&id=' . $id . '">Редактировать</a> / '; echo '<a href="offers.php?act=reply&id=' . $id . '">Ответить</a></div>'; echo '<div>' . bb_code($queryoff['offers_text']) . '<br />'; echo 'Добавлено: ' . profile($queryoff['offers_user']) . ' (' . date_fixed($queryoff['offers_time']) . ')<br />'; echo '<a href="/pages/offers.php?act=comments&id=' . $id . '">Комментарии</a> (' . $queryoff['offers_comments'] . ') '; echo '<a href="/pages/offers.php?act=end&id=' . $id . '">»</a></div><br />'; if (!empty($queryoff['offers_text_reply'])) { echo '<div class="b"><b>Официальный ответ</b></div>'; echo '<div class="q">' . bb_code($queryoff['offers_text_reply']) . '<br />'; echo profile($queryoff['offers_user_reply']) . ' (' . date_fixed($queryoff['offers_time_reply']) . ')</div><br />'; } } else { show_error('Ошибка! Данного предложения или проблемы не существует!'); } echo '<img src="/images/img/back.gif" alt="image" /> <a href="offers.php?type=' . $type . '">Вернуться</a><br />'; break; ############################################################################################ ## Ответ на предложение ## ############################################################################################ ############################################################################################ ## Ответ на предложение ## ############################################################################################ case 'reply': $queryoff = DB::run()->queryFetch("SELECT * FROM `offers` WHERE `offers_id`=? LIMIT 1;", array($id)); if (!empty($queryoff)) {