function list_format_atom($list) { // get display names, prune headers // (the atom watched list is always sorted by time, and has no // sections or read plans listed) foreach ($list as $i => $plan) { unset($displayname); unset($url); $plan = str_replace('http://', 'http//', trim($plan)); list($url, $displayname) = explode(':', str_replace('!', '', $plan), 2); if (!$displayname) { $displayname = $url; } $displayname = htmlspecialchars($displayname); $plans_list[$i] = trim(str_replace('http//', 'http://', $url)); $plans_list_display[$i] = $displayname; } $ptime = plan_get_last_update($plans_list); $lastview = plan_get_last_view($plans_list); array_multisort($ptime, SORT_DESC, $plans_list, $lastview, $plans_list_display); foreach ($plans_list as $i => $plan) { if ($lastview[$i] < $ptime[$i]) { $plantime = gmdate('Y-m-d\\TH:i:s+00:00', $ptime[$i]); $humantime = str_replace(" ", ' ', formattime($ptime[$i])); $items .= "\n<rdf:li rdf:resource='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/read/{$plan}'/>"; $watchlist .= "\n\t\t\t\t\t<entry>\n\t\t\t\t\t\t<title type='html'>{$plans_list_display[$i]} updated {$humantime}</title>\n\t\t\t\t\t\t<summary> {$humantime}</summary>\n\t\t\t\t\t\t<link rel=\"alternate\" href=\"http://planwatch.org/read/{$plan}\" type=\"text/html\"/>\n\t\t\t\t\t\t<updated>{$plantime}</updated>\n\t\t\t\t\t\t<id>http://planwatch.org/read/{$plan}</id>\n\t\t\t\t\t\t<author>\n\t\t\t\t\t\t\t<name>{$plans_list_display[$i]}</name>\n\t\t\t\t\t\t</author>\n\t\t\t\t\t</entry>\n\t\t\t\t"; } } $watchlist = "{$watchlist}"; return $watchlist; }
/** * Get customer list. * * @param string $mode * @param mix $param * @param string $relation client|provider * @param string $orderBy * @param object $pager * @access public * @return array */ public function getList($mode = 'all', $param = null, $relation = 'client', $orderBy = 'id_desc', $pager = null) { $customerIdList = $this->getCustomersSawByMe(); if (empty($customerIdList)) { return array(); } $this->app->loadClass('date', $static = true); $thisMonth = date::getThisMonth(); $thisWeek = date::getThisWeek(); if ($this->session->customerQuery == false) { $this->session->set('customerQuery', ' 1 = 1'); } $customerQuery = $this->loadModel('search', 'sys')->replaceDynamic($this->session->customerQuery); if (strpos($orderBy, 'id') === false) { $orderBy .= ', id_desc'; } return $this->dao->select('*')->from(TABLE_CUSTOMER)->where('deleted')->eq(0)->beginIF($relation == 'client')->andWhere('relation')->ne('provider')->beginIF($relation == 'provider')->andWhere('relation')->ne('client')->beginIF($mode == 'field')->andWhere('mode')->eq($param)->fi()->beginIF($mode == 'past')->andWhere('nextDate')->lt(helper::today())->fi()->beginIF($mode == 'today')->andWhere('nextDate')->eq(helper::today())->fi()->beginIF($mode == 'tomorrow')->andWhere('nextDate')->eq(formattime(date::tomorrow(), DT_DATE1))->fi()->beginIF($mode == 'thisweek')->andWhere('nextDate')->between($thisWeek['begin'], $thisWeek['end'])->fi()->beginIF($mode == 'thismonth')->andWhere('nextDate')->between($thisMonth['begin'], $thisMonth['end'])->fi()->beginIF($mode == 'public')->andWhere('public')->eq('1')->fi()->beginIF($mode == 'assignedTo')->andWhere('assignedTo')->eq($this->app->user->account)->fi()->beginIF($mode == 'query')->andWhere($param)->fi()->beginIF($mode == 'bysearch')->andWhere($customerQuery)->fi()->beginIF(strpos('all, bysearch, public, assignedTo, query', $mode) === false)->andWhere('nextDate')->ne('0000-00-00')->fi()->andWhere('id')->in($customerIdList)->orderBy($orderBy)->page($pager)->fetchAll('id'); }
/** * Get order list. * * @param string $mode * @param mix $param * @param string $orderBy * @param object $pager * @access public * @return array */ public function getList($mode = 'all', $param = null, $owner = '', $orderBy = 'id_desc', $pager = null) { $customerIdList = $this->loadModel('customer')->getCustomersSawByMe(); if (empty($customerIdList)) { return array(); } $products = $this->loadModel('product')->getPairs(); $this->app->loadClass('date', $static = true); $thisMonth = date::getThisMonth(); $thisWeek = date::getThisWeek(); /* Process search condition. */ if ($this->session->orderQuery == false) { $this->session->set('orderQuery', ' 1 = 1'); } $orderQuery = $this->loadModel('search', 'sys')->replaceDynamic($this->session->orderQuery); if (strpos($orderBy, 'status') !== false) { $orderBy .= ', closedReason'; } if (strpos($orderBy, 'id') === false) { $orderBy .= ', id_desc'; } $userList = $this->loadModel('user')->getSubUsers($this->app->user); $orders = $this->dao->select('o.*, c.name as customerName, c.level as level')->from(TABLE_ORDER)->alias('o')->leftJoin(TABLE_CUSTOMER)->alias('c')->on("o.customer=c.id")->where('o.deleted')->eq(0)->beginIF($userList != '')->andWhere()->markLeft(1)->where('o.assignedTo')->in($userList)->orWhere('o.createdBy')->in($userList)->orWhere('o.editedBy')->in($userList)->orWhere('o.signedBy')->in($userList)->markRight(1)->fi()->beginIF($mode == 'past')->andWhere('o.nextDate')->andWhere('o.nextDate')->lt(helper::today())->fi()->beginIF($mode == 'today')->andWhere('o.nextDate')->eq(helper::today())->fi()->beginIF($mode == 'tomorrow')->andWhere('o.nextDate')->eq(formattime(date::tomorrow(), DT_DATE1))->fi()->beginIF($mode == 'thisweek')->andWhere('o.nextDate')->between($thisWeek['begin'], $thisWeek['end'])->fi()->beginIF($mode == 'thismonth')->andWhere('o.nextDate')->between($thisMonth['begin'], $thisMonth['end'])->fi()->beginIF($mode == 'public')->andWhere('public')->eq('1')->fi()->beginIF($mode == 'assignedTo')->andWhere('o.assignedTo')->eq($this->app->user->account)->fi()->beginIF($mode == 'createdBy')->andWhere('o.createdBy')->eq($this->app->user->account)->fi()->beginIF($mode == 'signedBy')->andWhere('o.signedBy')->eq($this->app->user->account)->fi()->beginIF($mode == 'query')->andWhere($param)->fi()->beginIF($mode == 'bysearch')->andWhere($orderQuery)->fi()->andWhere('o.customer')->in($customerIdList)->orderBy($orderBy)->page($pager)->fetchAll('id'); foreach ($orders as $order) { $order->products = array(); $productList = explode(',', $order->product); foreach ($productList as $product) { if (isset($products[$product])) { $order->products[] = $products[$product]; } } } foreach ($orders as $order) { $productName = count($order->products) > 1 ? current($order->products) . $this->lang->etc : current($order->products); $order->title = sprintf($this->lang->order->titleLBL, $order->customerName, $productName, date('Y-m-d', strtotime($order->createdDate))); } return $orders; }
function plan_read_simplepie_rss($urls, $offset = 0, $item_count = 30) { if (IS_JOSH) { include_once 'simplepie.1.2.inc'; } else { include_once 'simplepie.inc'; } profile('rss_read'); $lastview = plan_get_last_view($urls); $multifeed = TRUE; if (is_string($urls)) { if (substr_count($urls, ",http") > 0) { $urls = explode(",http", $urls); foreach ($urls as $i => $url) { if (!strstr($url, 'http')) { $urls[$i] = "http" . $url; } } } else { $urls = array($urls); $multifeed = FALSE; } } preg_match("|\\/\\/(.*)@|", $urls[0], $match); if ($match[1]) { $_SERVER['DIGEST_USERINFO'] = $match[1]; $_SERVER['DIGEST_AUTH'] = TRUE; } profile("load feeds"); $feed = new SimplePie($urls); profile("load feeds"); $items = $feed->get_items(); usort($items, "plan_multifeed_sort_items"); $items = array_slice($items, $offset, $item_count); if (!is_object($items[0])) { // if(IS_JOSH) print_r($items); // do stuff to fix the url and try again preg_match("|.*://([^/]+)/|", $urls[0], $base_url_array); $base_link = "<a href='{$base_url_array['0']}'>{$base_url_array['1']}</a>"; if ($offset != "RECURSION") { $content = plan_read_simplepie_rss($base_url_array[0], "RECURSION"); } if (!$content) { $title = "Failed to read feed {$urls['0']}"; $content = "<h1>Plan Read Failed</h1> We tried <tt>{$urls['0']}</tt> and did not get a valid feed.<br />\n\t\t\tYou may want to try the site directly: {$base_link}<br />\n\t\t\tIf the feed address is incorrect, you can <a href='/lists/edit/watched'>edit your watched list</a> to correct it.<br /><br />\n\t\t\tStill have questions? Ask for <a href='mailto:help@planwatch.org'>help</a>."; $alternate_links = array_unique(array_merge(plan_feed_search(str_replace("http://", "http://www.", $base_url_array[0])), plan_feed_search($base_url_array[0]), plan_feed_search($urls[0]))); if ($alternate_links) { $content .= "<hr /><h2>Alternate Links</h2>Here are some possible alternate feed links:<ul>"; foreach ($alternate_links as $link) { $content .= "<li><a href='http://planwatch.org/read/{$link}'>{$link}</a></li>\n"; } } } } else { foreach ($items as $item) { unset($item_categories); $item_authors_string = ''; $entry_header = ''; $item_title = $item->get_title(); $item_link = $item->get_permalink(); $item_date = formattime($item->get_date('U')); $item_data = $item->get_content(); if ($item_category_list = $item->get_categories()) { foreach ($item_category_list as $category) { $item_categories .= " " . $category->get_label(); } } $item_authors = $item->get_authors(); $item_id = $item->get_id(); if ($item_authors) { foreach ($item_authors as $item_author) { if ($item_author->get_name()) { $item_authors_string .= "<a href='" . $item_author->get_link() . "'>" . $item_author->get_name() . "</a> "; } elseif ($item_author->get_email()) { $item_authors_string .= $item_author->get_email() . " "; } } } if ($item_title) { $feed = $item->get_feed(); $feed_title = $feed->get_title(); $feed_link = $feed->get_link(); $feed_url = $feed->feed_url; if ($multifeed) { $entry_header = "<a target='_self' href='/read/{$feed_url}'>{$feed_title}</a><br/><a target='_self' href='{$item_link}' class='entry_title'>{$item_title}</a>\n"; } else { $entry_header .= "<a target='_self' href='{$item_link}' class='entry_title'>{$item_title}</a>\n"; } } $entry_header .= "<span class='edit_links'>"; if ($item_categories) { $entry_header .= " {$item_categories}, "; } if ($item_date) { $entry_header .= " posted {$item_date} "; } if ($item_authors_string) { $entry_header .= "by {$item_authors_string} "; } $item_id_hash = md5($item_id); $entry_header .= "</span><br />\n"; //$entry_text=removeEvilTags($item_data); $entry_text = $item_data; $content .= "\n\t\t\t<div class='plan_entry' id='plan_entry_{$item_id_hash}'>\n\t\t\t{$entry_header}\n\t\t\t<div class='entry_content' id='entry_content_{$item_id_hash}'>"; $content .= str_replace("<a ", "<a target='_self' ", $entry_text); $content .= "\n\t\t\t</div>\n\t\t\t</div>\n\t\t\t"; } } if (!$multifeed && is_object($item)) { $feed = $item->get_feed(); $feed_title = $feed->get_title(); $feed_link = $feed->get_link(); $feed_description = $feed->get_description(); $content = "<h1><a href='{$feed_link}'>{$feed_title}</a></h1>{$feed_description}<br /><br />{$content}"; // if($urls[0]!=$feed_link) $content="<div class='message'><b>This feed is autodiscovered</b> based on the link you provided. It may keep working, but discovery is unpredictable. If you want to ".$content; } profile('rss_read'); return $content; }
if ($start >= $total) { $start = 0; } $queryhist = DB::run()->query("SELECT * FROM `banhist` WHERE `ban_user`=? ORDER BY `ban_time` DESC LIMIT " . $start . ", " . $config['listbanhist'] . ";", array($uz)); echo '<form action="banhist.php?act=del&start=' . $start . '&uid=' . $_SESSION['token'] . '" method="post">'; while ($data = $queryhist->fetch()) { echo '<div class="b">'; echo '<div class="img">' . user_avatars($data['ban_user']) . '</div>'; echo '<b>' . profile($data['ban_user']) . '</b> ' . user_online($data['ban_user']) . ' '; echo '<small>(' . date_fixed($data['ban_time']) . ')</small><br />'; echo '<input type="checkbox" name="del[]" value="' . $data['ban_id'] . '" /> '; echo '<a href="zaban.php?act=editban&uz=' . $data['ban_user'] . '">Изменить</a></div>'; 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>';
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; }
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';
?> bg_postion<?php echo $num; ?> fr"></span><?php } ?> </div> </div> </div> </div> <span id="qtime_<?php echo $vo["id"]; ?> " class="time f_9 fs_12"><?php echo formattime($vo["add_time"]); ?> </span></li><?php } } } else { echo ""; } ?> </ul> <div class="turn_page" id="page"> <div class='page'><?php echo $page; ?> </div> </div>
include_once '../themes/header.php'; $act = isset($_GET['act']) ? check($_GET['act']) : 'index'; show_title('Выдача кредитов'); if (is_user()) { switch ($act) { ############################################################################################ ## Главная страница ## ############################################################################################ case 'index': echo 'В наличии: ' . moneys($udata['users_money']) . '<br />'; echo 'В банке: ' . moneys(user_bankmoney($log)) . '<br /><br />'; // --------------------- Вычисление если долг ---------------------------// if ($udata['users_sumcredit'] > 0) { echo '<b><span style="color:#ff0000">Сумма долга составляет: ' . moneys($udata['users_sumcredit']) . '</span></b><br />'; if (SITETIME < $udata['users_timecredit']) { echo 'До истечения срока кредита осталось <b>' . formattime($udata['users_timecredit'] - SITETIME) . '</b><br /><br />'; } else { if ($udata['users_point'] >= 10) { $delpoint = 10; } else { $delpoint = $udata['users_point']; } echo '<b><span style="color:#ff0000">Внимание! Время погашения кредита просрочено!</span></b><br />'; echo 'Начислен штраф в сумме 1%, у вас списано ' . points($delpoint) . '<br /><br />'; DB::run()->query("UPDATE `users` SET `users_point`=`users_point`-?, `users_timecredit`=?, `users_sumcredit`=round(`users_sumcredit`*1.01) WHERE `users_login`=? LIMIT 1;", array($delpoint, SITETIME + 86400, $log)); } } echo '<div class="form">'; echo '<b>Операция:</b><br />'; echo '<form action="kredit.php?act=operacia" method="post">'; echo '<input type="text" name="gold" /><br />';
if ($a['vote'] == "1") { ?> agree<?php } else { ?> opposition<?php } ?> fl"></a> <p class="word_break"><?php echo $a["answer_cont"]; ?> </p> </div> <div class="remark_info fs_12"><span class="f_9"><?php echo formattime($a["answer_time"]); ?> </span> <?php if ($a['star_num'] > "0") { $num = $a['star_num'] > 3 ? $a['star_num'] - 3 : $a['star_num']; ?> <p class="fr f_6">已给<?php if ($a['star_num'] > "3") { ?> 差<?php } else { ?> 好<?php } ?>
if (isset($_GET['action'])) { $action = check($_GET['action']); } else { $action = ""; } echo '<img src="../images/img/partners.gif" alt="image" /> <b>Бан пользователя</b><br /><br />'; if (is_user()) { $time_ban = round($udata[38] - SITETIME); ############################################################################################ ## Главная страница ## ############################################################################################ if ($time_ban > 0) { if ($action == "") { echo '<img src="../images/img/error.gif" alt="image" /> <b>Вас забанили</b><br /><br />'; echo '<b><span style="color:#ff0000">Причина бана: ' . $udata[39] . '</span></b><br /><br />'; echo 'До окончания бана осталось <b>' . formattime($time_ban) . '</b>'; echo '<br /><br />Чтобы не терять время зря, рекомендуем вам ознакомиться с <b><a href="' . BASEDIR . 'pages/pravila.php?' . SID . '">Правилами сайта</a></b><br />'; echo '<br />Общее число строгих нарушений: <b>' . (int) $udata[64] . '</b><br />'; echo 'Внимание, максимальное количество нарушений: <b>5</b><br />'; echo 'При превышении лимита нарушений ваш профиль автоматически удаляется<br />'; echo 'Востановление профиля или данных после этого будет невозможным<br />'; echo 'Будьте внимательны, старайтесь не нарушать больше правил<br />'; //--------------------------------------------------// if ($config['addbansend'] == 1) { if ($udata[73] == 1) { echo '<br /><form method="post" action="ban.php?action=send&' . SID . '">'; echo 'Объяснение:<br />'; echo '<textarea cols="25" rows="3" name="msg"></textarea><br />'; echo '<input value="Отправить" name="do" type="submit" /></form><hr />'; echo 'Если модер вас забанил по ошибке или вы считаете, что бан не заслужен, то вы можете написать объяснение своего нарушения<br />'; echo 'В случае если ваше объяснение будет рассмотрено и удовлетворено, то возможно вас и разбанят<br />';
} else { $action = ""; } echo '<img src="../images/img/partners.gif" alt="image" /> <b>Выдача кредитов</b><br /><br />'; if (is_user()) { ############################################################################################ ## Главная страница ## ############################################################################################ if ($action == "") { echo 'В наличии: ' . moneys($udata[41]) . '<br />'; echo 'В банке: ' . moneys(user_bankmany($log)) . '<br />'; //--------------------- Вычисление если долг ---------------------------// if ($udata[53] != "" && $udata[54] > 0) { echo '<br /><b><span style="color:#ff0000">Сумма долга составляет: ' . moneys($udata[54]) . '</span></b><br />'; if (SITETIME < $udata[53]) { echo 'До истечения срока кредита осталось <b>' . formattime($udata[53] - SITETIME) . '</b><br />'; } else { echo '<b><span style="color:#ff0000">Внимание! Время погашения кредита просрочено!</span></b><br />'; echo 'Начислен штраф в сумме 1%, у вас списано 10 баллов активности, и 1 балл авторитета<br />'; change_profil($log, array(36 => $udata[36] - 10, 49 => $udata[49] - 1, 51 => $udata[51] + 1, 53 => SITETIME + 86400, 54 => $udata[54] + round($udata[54] / 100))); } } echo '<br /><b>Операция:</b>'; echo '<br /><form action="kredit.php?action=operacia&' . SID . '" method="post"><input name="gold" /><br />'; echo '<select name="oper">'; echo '<option value="1">Взять кредит</option><option value="2">Погасить кредит</option>'; echo '</select><br /><br />'; echo '<input type="submit" value="Продолжить" /></form><hr />'; echo 'Минимальная сумма кредита ' . moneys($config['minkredit']) . '<br />'; echo 'Максимальная сумма кредита равна ' . moneys($config['maxkredit']) . '<br /><br />'; echo '<b>Условия кредита</b><br />Независимо от суммы кредита банк берет ' . (int) $config['percentkredit'] . '% за операцию, кредит выдается на 3 дня<br />';
############################################################################################ ############################################################################################ ## Редактирование бана ## ############################################################################################ case 'editban': $user = DB::run()->queryFetch("SELECT * FROM `users` WHERE `users_login`=? LIMIT 1;", array($uz)); if (!empty($user)) { echo user_gender($user['users_login']) . ' <b>Профиль ' . profile($user['users_login']) . '</b> ' . user_visit($user['users_login']) . '<br /><br />'; if ($user['users_level'] < 101 || $user['users_level'] > 105) { if (!empty($user['users_ban']) && $user['users_timeban'] > SITETIME) { if (!empty($user['users_timelastban'])) { echo 'Последний бан: ' . date_fixed($user['users_timelastban'], 'j F Y / H:i') . '<br />'; echo 'Забанил: ' . profile($user['users_loginsendban']) . '<br />'; } echo 'Строгих нарушений: <b>' . $user['users_totalban'] . '</b><br />'; echo 'До окончания бана: ' . formattime($user['users_timeban'] - SITETIME) . '<br /><br />'; if ($user['users_timeban'] - SITETIME >= 86400) { $type = 'sut'; $file_time = round(($user['users_timeban'] - SITETIME) / 60 / 60 / 24, 1); } elseif ($user['users_timeban'] - SITETIME >= 3600) { $type = 'chas'; $file_time = round(($user['users_timeban'] - SITETIME) / 60 / 60, 1); } else { $type = 'min'; $file_time = round(($user['users_timeban'] - SITETIME) / 60); } echo '<div class="form">'; echo '<form method="post" action="zaban.php?act=changeban&uz=' . $uz . '&uid=' . $_SESSION['token'] . '">'; echo 'Время бана:<br /><input name="bantime" value="' . $file_time . '" /><br />'; $checked = $type == 'min' ? ' checked="checked"' : ''; echo '<input name="bantype" type="radio" value="min"' . $checked . ' /> Минут<br />';
function plan_update($edit = FALSE, $writer = FALSE) { if (!$writer) { $writer = $_SERVER['USER']; } if ($edit == 'tiny') { $tiny = TRUE; $edit = FALSE; } if ($tiny) { $content = "\n\t<style> textarea { font-size: 12pt; font-family: trebuchet ms; width: 300px; height: 300px; } </style>\n\t"; } // set dir for reading $plan_dir = "{$_SERVER['PWUSERS_DIR']}/{$writer}/plan"; // user_is_administrator() is here because admins can update the system plan // TODO(v5): add credentialing so people can easily write to multiple plans, multiple people can write to a given plan if (user_is_valid($writer, $_SERVER['USERINFO_ARRAY']['userpass']) || user_is_administrator() && $writer == 'system') { $journaling_test = plan_is_journaling($writer); if ($journaling_test) { $draft_links = plan_list_drafts(); } if (($journaling_test || $edit == 'header' || $edit == 'footer' || $edit == 'css') && $edit) { if ($edit == 'draft') { if ($_SERVER['URL_ARRAY'][4]) { $privateentry = ' CHECKED '; } if ($_SERVER['URL_ARRAY'][5]) { $nlb_check = ' CHECKED '; } if ($_SERVER['URL_ARRAY'][6]) { $markdown_check = ' CHECKED '; } if ($_SERVER['URL_ARRAY'][7]) { $nofeed_check = ' CHECKED '; } $plandata = stripslashes(file_get_contents("{$_SERVER['FILE_ROOT']}/temp/draft...{$writer}...{$_SERVER[URL_ARRAY][3]}...{$_SERVER[URL_ARRAY][4]}...{$_SERVER[URL_ARRAY][5]}...txt")); $edit = $_SERVER['URL_ARRAY'][3]; } elseif (file_exists("{$plan_dir}/plan{$edit}.txt") || file_exists("{$plan_dir}/plan{$edit}.txt.p") || file_exists("{$plan_dir}/draft{$edit}.txt")) { if (file_exists("{$plan_dir}/plan{$edit}.txt")) { $filename = "{$plan_dir}/plan{$edit}.txt"; } if (file_exists("{$plan_dir}/plan{$edit}.txt.p")) { $privateentry = ' CHECKED '; $filename = "{$plan_dir}/plan{$edit}.txt.p"; } if (file_exists("{$plan_dir}/draft{$edit}.txt")) { $filename = "{$plan_dir}/draft{$edit}.txt"; $draft_edit = $edit; } $plandata = stripslashes(file_get_contents($filename)); $plandata = preg_replace("|&(\\S+);|", "&\\1;", $plandata); if (strstr($plandata, '<!--markdown-->')) { $markdown_check = ' CHECKED '; $plandata = str_replace('<!--markdown-->', '', $plandata); } if (strstr($plandata, '<!--no feed-->')) { $nofeed_check = ' CHECKED '; $plandata = str_replace('<!--no feed-->', '', $plandata); } if (preg_match("|<!--title (.*)-->|", $plandata, $titlematches)) { $title = $titlematches[1]; $plandata = str_replace($titlematches[0], '', $plandata); } if (preg_match("|<!--tags (.*)-->|", $plandata, $tagmatches)) { $tags = $tagmatches[1]; $plandata = str_replace($tagmatches[0], '', $plandata); } } } elseif (!($journaling_test || $edit == 'header' || $edit == 'footer')) { $oldplan_fn = "{$_SERVER['PWUSERS_DIR']}/{$writer}/plan/plan.txt"; if (file_exists($oldplan_fn)) { $plandata = stripslashes(file_get_contents($oldplan_fn)); } else { // NOTE: the oldest nonjournaling plan entry will always be blank $plandata = ''; touch($oldplan_fn); } } if (strpos($plandata, 'nolinebreaks') !== FALSE) { $plandata = str_replace(array('<!--nolinebreaks-->', '#nolinebreaks#'), '', $plandata); $nlb_check = 'CHECKED'; } else { $nlb_check = ''; } if (!$edit) { $content .= "<h1><img src='{$GLOBALS['writeicon']}' /> Write a plan update</h1>"; } elseif (strpos($edit, 'er') || strpos($edit, 'ss')) { $content .= "<h1><img src='{$GLOBALS['writeicon']}' /> Edit your plan {$edit}</h1>"; } else { $content .= "<h1><img src='{$GLOBALS['writeicon']}' /> Edit your plan entry from " . formattime(substr($edit, 1)) . "</h1>"; } if (user_is_administrator() && $writer == 'system') { $content .= "{$_SERVER['USER']} editing the system plan.<br />"; } if ($_SERVER['OUTPUT_MODE'] != 'IPHONE' && $_SERVER['OUTPUT_MODE'] != 'MOBILE') { $formatlinks = "<script src='/resources/javascript/edit.js'></script>"; } $content .= "\n\t\t{$formatlinks}\n\t\t<form title='Write' selected='true' action='{$_SERVER['WEB_ROOT']}/scripts/plan_update.php' method='post' name='plan_update' enctype='multipart/form-data'>\n\n\t\t<textarea name='newplan' id='textbox' rows='12' cols='32'>" . trim($plandata . $autocontent) . "</textarea>\n\t\t<div class='settingsbox' >\n\t\t<div style='text-align: center;'>\n\t\t\t<input\n\t\t\t\t type = 'submit'\n\t\t\t\t name = 'update'\n\t\t\t\t value = 'Post'\n\t\t\t\t accesskey = 'x'\n\t\t\t\t style = 'font-size: 20px; font-family: {$GLOBALS['nfonts']}; background: {$GLOBALS['linkcolor']}; color: {$GLOBALS['planbgcolor']}; padding: 2px;'\n\t\t\t/>\n\t\t\t"; if ($journaling_test && $edit != 'divider' && $edit != 'header' && $edit != 'footer' && $edit != 'css') { if ($draft_edit) { $draft_time = str_replace(".", '', $draft_edit); } else { $draft_time = time(); $draft_edit = ".{$draft_time}"; } $_SERVER['PLAN_DRAFT_TIME'] = $draft_time; if (!$tiny) { $content .= "\n\t\t\t<input\n\t\t\t\t type = 'button'\n\t\t\t\t name = 'draft'\n\t\t\t\t value = 'Save'\n\t\t\t\t accesskey = 'd'\n\t\t\t\t onclick = \"loadXMLDoc('http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/scripts/plan_update.php','draft_time={$draft_time}&action=Autosave%20Ajax&newplan=' + escape(element('textbox').value),'autosave_alert',processReqChangePOST);\"\n\t\t\t\t style = 'font-size: 12px; font-family: {$GLOBALS['nfonts']}; background: {$GLOBALS['navlinkcolor']}; color: {$GLOBALS['listsbgcolor']}; padding: 2px;'\n\t\t\t/>\n\n\t\t\t<div id='autosave_alert'></div>\n\t\t\t</div>\n\n\t\t\t<div>Optional Info<br />\n\t\t\t\tTitle <input type='text' name='title' value='{$title}' style='width: 10%;' placeholder='Title'><br />\n\t\t\t\tTags <input type='text' name='tags' value='{$tags}' style='width: 10%;' placeholder='Private Tags'>\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\tprivacy<br/>\n\t\t\t\t<input type='checkbox' {$nofeed_check} name='nofeed' id='nofeed' value='<!--no feed-->' />\n\t\t\t\t<label for='nofeed'>not in feed</label>\n\t\t\t\t<a href='{$_SERVER['WEB_ROOT']}/help/writing#nofeed' target='_blank'>[?]</a><br />\n\t\t\t\t<input type='checkbox' name='private' id='private' value='.p' {$privateentry} onchange='if (this.checked) { document.getElementById(\"textbox\").style.background=\"#eeeeee\"; }'/>\n\t\t\t\t<label for='private'>private entry</label><br/>\n\t\t\t\t<a href='{$_SERVER['WEB_ROOT']}/help/privacy' target='_blank'>privacy help</a><br />\n\t\t\t\t<a href='{$_SERVER['WEB_ROOT']}/lists/edit/allowed' target='_blank'>edit allowed users</a><br />\n\t\t\t</div>\n\n\t\t\t<div>Attach a file<br /><input type='file' name='attached_file' style='width: 90px;' /></div>\n\t\t\t"; } else { $content .= "<br /><br /><br /><input type='checkbox' name='private' id='private' value='.p' {$privateentry} onchange='if (this.checked) { document.getElementById(\"textbox\").style.background=\"#eeeeee\"; }'/> <label for='private'>private</label> "; } } if (!strpos($edit, "er") && !strpos($edit, "ss")) { if (!$tiny) { $content .= "\n\t\t\t\t\t<div>\n\t\t\t\t\t\tdisplay<br/>\n\t\t\t\t\t\t<input type='checkbox' {$markdown_check} name='markdown' id='markdown' value='<!--markdown-->' />\n\t\t\t\t\t\t<label for='markdown'><a target='_blank' href='http://michelf.com/projects/php-markdown/concepts/'>markdown</a></label><br />\n\t\t\t\t\t\t<input type='checkbox' {$nlb_check} name='nolinebreaks' id='nolinebreaks' value='1' />\n\t\t\t\t\t\t<label for='nolinebreaks'>no line breaks</label>\n\t\t\t\t\t\t<a href='{$_SERVER['WEB_ROOT']}/help/writing#linebreaks' target='_blank'>[?]</a>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t</div>\n"; if ($edit == 'divider') { $content .= "\n\t\t\t\t\t<div style='font-size: 9px; font-family: sans-serif; width: 100px;'>\n\t\t\t\t\t\t<a href='{$_SERVER['WEB_ROOT']}/help/divider' target='_blank'><img src='{$_SERVER['WEB_ROOT']}{$GLOBALS['helpicon']}' alt='?' /> help customizing your divider</a>\n\t\t\t\t\t</div>\n\t\t\t\t\t"; } } else { $content .= "\n\t\t\t<input type='checkbox' {$markdown_check} name='markdown' id='markdown' value='<!--markdown-->' /> <label for='markdown'>markdown</label> <input type='checkbox' {$nofeed_check} name='nofeed' id='nofeed' value='<!--no feed-->' /> not in feed\n\t\t\t\t\t\t"; } } elseif (strstr($edit, 'er')) { $content .= "\n\t\t</div><div>\n\t\t<input type='checkbox' {$nlb_check} name='nolinebreaks' id='nolinebreaks' value='1' />\n\t\t<label for='nolinebreaks'>no line breaks</label>\n\t\t<a href='{$_SERVER['WEB_ROOT']}/help/writing#linebreaks' target='_blank'>[?]</a>\n\t\t<br />\n<input type='checkbox' {$markdown_check} name='markdown' id='markdown' value='<!--markdown-->' />\n<label for='markdown'><a target='_blank' href='http://michelf.com/projects/php-markdown/concepts/'>markdown</a></label>\n</div><div style='display: none;'>\n\t\t"; } elseif (strstr($edit, 'ss')) { $content .= "<br /><br /><a target='_blank' href='/help/formatting'>CSS formatting help</a> <br /><br /> <a href='/help/lynneformatting' target='_blank'>Lynne's CSS tips</a><br />\n\t\t<style>.CodeMirror-wrapping { width: 80% !important; float: left !important; clear: none !important; height: 350px !important; border: thin solid black !important; }</style>\n\t\t\n\t\t\t <script src='/resources/javascript/codemirror65/js/codemirror.js' type='text/javascript'></script>\n\t\t<script type='text/javascript'>\n\t\t var editor = CodeMirror.fromTextArea('textbox', {\n\t\t border: '1px solid black',\n\t\t parserfile: 'parsecss.js',\n\t\t stylesheet: '/resources/javascript/codemirror65/css/csscolors.css',\n\t\t path: '/resources/javascript/codemirror65/js/'\n\t\t });\n\t\t</script>\n\t\t"; } $content .= "\n\t\t\t<input type='hidden' id='draft_edit' name='draft_edit' value='{$draft_edit}'>\n\t\t\t<input type='hidden' name='writer' value='{$writer}'/>\n\t\t\t<input type='hidden' name='edit' value='{$edit}'/>\n\t\t\t<input type='hidden' name='fingerprint' value='" . $_COOKIE[$_SERVER['AUTH_COOKIE']] . "'/>\n\t\t\t<input type='hidden' name='sid' value='{$_SERVER['SESSION_ID']}'/>\n\t\t</div>"; if ($journaling_test || $edit == 'header' || $edit == 'footer') { $content .= "<input type='hidden' name='action' value='Update Journaling Plan' />\n"; } else { $content .= "<input type='hidden' name='action' value='Update Nonjournaling Plan' />\n"; } $content .= "</form><div id='draftList'></div>\n"; } else { $content = "<div class='alert'>Your attempt to update your plan failed because\n\tyou supplied an invalid username or password. Please login again, and mail\n\t<a href='mailto:help@planwatch.org'>help@planwatch.org</a> if you believe this message\n\tis in error.</div>"; } // if the form was actually presented, include the relevant javascript files to make it all work. if (!strpos($content, 'alert')) { $content .= "\n\n<script type='text/javascript' language='javascript'>document.getElementById('textbox').focus();</script>\n"; $content .= "\n\n<script language='javascript' type='text/javascript' src='{$_SERVER['WEB_ROOT']}/resources/javascript/setplan.js'></script>\n"; //$content.="<script language='javascript' type='text/javascript' src='$_SERVER[WEB_ROOT]/resources/javascript/speller/spellChecker.js'></script>\n\n"; } return $content; }
function getfeatures($threshhold = '2d', $sortby = FALSE, $sortdir = FALSE, $searchterm = FALSE) { if (!$searchterm) { exec("ls {$_SERVER['FILE_ROOT']}/features/*.feature", $featurelist); } else { exec("grep -il '{$searchterm}' {$_SERVER['FILE_ROOT']}/features/*.feature", $featurelist); } if (!$threshhold) { $threshhold = '2w'; } $thresh_url = $threshhold; if (strstr($threshhold, 'r')) { $threshhold = str_replace('r', '', $threshhold); $reverse = 1; } if (strstr($threshhold, 'w')) { $threshhold = time() - 604800 * str_replace('w', '', $threshhold); } if (strstr($threshhold, 'd')) { $threshhold = time() - 86400 * str_replace('d', '', $threshhold); } if (strstr($threshhold, 'h')) { $threshhold = time() - 3600 * str_replace('h', '', $threshhold); } if (strstr($threshhold, 'm')) { $threshhold = time() - 60 * str_replace('m', '', $threshhold); } if (!$sortby) { $sortby = 'featuretime'; } if (!$sortdir) { $sortdir = 'down'; } if (user_is_valid($_SERVER['USERINFO_ARRAY']['username'], $_SERVER['USERINFO_ARRAY']['userpass'])) { $watch_link = "[ <a href='{$_SERVER['WEB_ROOT']}/lists/add/watched/!http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/feature/atom:planbugs!'>add to your watched list</a> ]"; } $content .= stripslashes("\n\n<div align='center'>\n<h1>Planwatch.org Bugs</h1>\n<a style=' width: 250px; margin: auto; margin-bottom: 20px; display: block; background: #293; font-size: 20px; font-weight: bold; border-radius: 10px; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-left: 2px solid rgba(255,255,255,0.5); border-top: 2px solid rgba(255,255,255,0.5); border-right: 2px solid rgba(0,0,0,0.5); border-bottom: 2px solid rgba(0,0,0,0.5); color: white;' href='{$_SERVER['WEB_ROOT']}/feature/new'>Report a Bug!<br /><span style='font-size: 12px; font-weight: normal;'>(or request a feature)</span></a>\n\n<style type='text/css'>\n\tul { list-style: none; margin: 0px; padding: 0px; }\n\tli { text-align: left; margin-bottom: 5px; background: {$GLOBALS['listsbgcolor']}; color: {$GLOBALS['navtextcolor']}; }\n\tli h1 { font-size: 22px; margin: 0px; }\n\tli.fixed { opacity: 0.5; }\n\tli.fixed h1 { font-size: 14px; }\n\tli.testing { opacity: 0.7; background-color: {$GLOBALS['navtextcolor']}; color: {$GLOBALS['listsbgcolor']}; }\n\tli.testing a { color: {$GLOBALS['listsbgcolor']}; }\n\tli.testing h1 { font-size: 18px; }\n\tli.progress { opacity: 0.9; background-color: {$GLOBALS['navlinkcolor']}; color: {$GLOBALS['listsbgcolor']}; }\n\tli.progress a { color: {$GLOBALS['listsbgcolor']}; }\n\tli.progress h1 { font-size: 20px; }\n</style>\n<ul>"); if ($featurelist) { foreach ($featurelist as $i => $feature) { $feature = trim($feature); parse_str(file_get_contents($feature), $feature_array[$i]); $feature_array[$i]['featuretime'] = filemtime($feature); $feature_array[$i]['url_feature'] = basename($feature); $sort_array[$i] = $feature_array[$i][$sortby]; } if ($sortdir == 'down') { array_multisort($sort_array, SORT_DESC, $feature_array); } else { array_multisort($sort_array, SORT_ASC, $feature_array); } foreach ($feature_array as $i => $feature) { if ($feature['featuretime'] > $threshhold || $feature['status'] != "Verified Fixed" && stripslashes($feature['status']) != "Won't Fix" && $feature['status'] != "On Hold") { $somefeature = TRUE; if (!$feature['latest_responder']) { $feature['latest_responder'] = $feature['submitter']; } $lastresponse = "\n\t\t" . formattime($feature['featuretime']) . " by {$feature['latest_responder']} \n\t\t"; $class = ''; if ($feature['status'] == 'Verified Fixed') { $class = 'fixed'; } if ($feature['status'] == 'Testing') { $class = 'testing'; } if ($feature['status'] == 'In Progress') { $class = 'progress'; } $content .= "<li class='{$class}'><div style='float: right; width: 140px; text-align: right;'>{$feature['priority']}<br />{$feature['status']}</div><h1><a href='{$_SERVER['WEB_ROOT']}/feature/description/{$feature['url_feature']}'>{$feature['title']}</a></h1>from {$feature['submitter']} ∗ {$lastresponse}</li>"; } } } $content .= "<input type='search' id='searchinput' placeholder='search' style='width: 90%; font-size: 16px;' />"; $content .= "</ul>"; return $content; }
show_title('Вклады'); if (is_user()) { switch ($act) { ############################################################################################ ## Главная страница ## ############################################################################################ case 'index': $databank = DB::run()->queryFetch("SELECT * FROM `bank` WHERE `bank_user`=? LIMIT 1;", array($log)); if (!empty($databank)) { echo '<b>Выписка по счету</b><br />'; echo 'На руках: ' . moneys($udata['users_money']) . '<br />'; echo 'В банке: ' . moneys($databank['bank_sum']) . '<br /><br />'; if ($databank['bank_sum'] > 0) { if ($databank['bank_sum'] <= $config['maxsumbank']) { if ($databank['bank_time'] >= SITETIME) { echo '<b>До получения процентов осталось ' . formattime($databank['bank_time'] - SITETIME) . '</b><br />'; echo 'Будет получено с процентов: ' . moneys(percent_bank($databank['bank_sum'])) . '<br /><br />'; } else { echo '<b>Получение процентов</b> (' . moneys(percent_bank($databank['bank_sum'])) . ')<br />'; echo '<div class="form">'; echo '<form action="bank.php?act=prolong&uid=' . $_SESSION['token'] . '" method="post">'; echo '<select name="oper">'; echo '<option value="0">Получить на руки</option><option value="1">Положить в банк</option>'; echo '</select><br />'; echo 'Проверочный код:<br /> '; echo '<img src="/gallery/protect.php" alt="" /><br />'; echo '<input name="provkod" size="6" maxlength="6" /><br />'; echo '<input value="Получить" type="submit" /></form></div><br />'; } } else { echo '<b><span style="color:#ff0000">Внимание у вас слишком большой вклад</span></b><br />';
function list_format_rss($list, $sortby = 'time') { $sep = "\n"; $subkey = '#main'; foreach ($list as $z => $plan) { if ($th = strstr($plan, '!prune')) { $prune = TRUE; $threshhold = str_replace('!prune', '', $th); if (strstr($threshhold, 's')) { $threshhold = str_replace('s', '', $threshhold); } if (strstr($threshhold, 'm')) { $threshhold = str_replace('m', '', $threshhold) * 60; } if (strstr($threshhold, 'b')) { $threshhold = str_replace('b', '', $threshhold) * 86.40000000000001; } if (strstr($threshhold, 'h')) { $threshhold = str_replace('h', '', $threshhold) * 3600; } if (strstr($threshhold, 'd')) { $threshhold = str_replace('d', '', $threshhold) * 3600 * 24; } if (strstr($threshhold, 'w')) { $threshhold = str_replace('w', '', $threshhold) * 3600 * 24 * 7; } if (strstr($threshhold, 'n')) { $threshhold = str_replace('n', '', $threshhold) * 3600 * 24 * 30; } if (strstr($threshhold, 'y')) { $threshhold = str_replace('y', '', $threshhold) * 3600 * 24 * 365; } if (strstr($threshhold, 'k')) { $threshhold = str_replace('k', '', $threshhold) * 3600 * 24 * 365 * 10; } $threshhold = time() - $threshhold; } if ($plan == '!onlynew') { $onlynew = TRUE; } unset($displayname); unset($url); $plan = str_replace('http://', 'http//', trim($plan)); list($url, $displayname) = explode(':', str_replace('!', '', $plan), 2); if (!$displayname) { $displayname = $url; } $displayname = htmlspecialchars($displayname); if ($plan[0] == '#') { $subkey = $displayname; } if (trim($plan)) { $sublist[$subkey][] = str_replace('http//', 'http://', $url); $sublist_display[$subkey][] = $displayname; } } $items .= "\n<rdf:li rdf:resource='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/home'/>"; $watchlist .= "\n\t\t<item rdf:about='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/home'>\n\t\t\t<title>>> Planwatch Home</title>\n\t\t\t<link>http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/home</link>\n\t\t\t<description>Planwatch Home</description>\n\t\t</item>\n"; foreach ($sublist as $key => $list) { if (count($list) > 1) { $ptime = plan_get_last_update($list); $lastview = plan_get_last_view($list); $list_display = $sublist_display[$key]; if ($sortby == 'name') { array_multisort($list, SORT_ASC, $ptime, $lastview, $list_display); } if ($sortby == 'time') { array_multisort($ptime, SORT_DESC, $list, $lastview, $list_display); } if ($key != '#main') { $items .= "\n<rdf:li rdf:resource='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/{$key}'/>"; $watchlist .= "\n\t\t\t\t\t<item rdf:about='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/{$key}'>\n\t\t\t\t\t\t<title>__ " . str_replace('#', '', $key) . " __</title>\n\t\t\t\t\t\t<link>http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/</link>\n\t\t\t\t\t\t<description>category: " . str_replace('#', '', $key) . "</description>\n\t\t\t\t\t</item>\n"; } foreach ($list as $i => $plan) { $plantime = str_replace(' ', ' ', formattime($ptime[$i])); if ($plan[0] != '#' && $plan && ($ptime[$i] > $threshhold || !$threshhold)) { if ($lastview[$i] < $ptime[$i]) { $items .= "\n<rdf:li rdf:resource='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/read/{$plan}'/>"; $watchlist .= "\n\t\t\t\t\t<item rdf:about='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/read/{$plan}'>\n\t\t\t\t\t\t<link>http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/read/{$plan}</link>\n\t\t\t\t\t\t<title>*** {$list_display[$i]} {$plantime}</title>\n\t\t\t\t\t\t<description>read {$list_display[$i]}'s plan</description>\n\t\t\t\t\t</item>\n"; } elseif (!$onlynew) { $items .= "\n<rdf:li rdf:resource='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/read/{$plan}'/>"; $watchlist .= "\n\t\t\t\t\t<item rdf:about='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/read/{$plan}'>\n\t\t\t\t\t\t<title>{$list_display[$i]} {$plantime}</title>\n\t\t\t\t\t\t<link>http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/read/{$plan}</link>\n\t\t\t\t\t\t<description>read {$list_display[$i]}'s plan</description>\n\t\t\t\t\t</item>\n"; } } } } } $items .= "\n<rdf:li rdf:resource='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/look/{$_SERVER['FINGERPRINT']}'/>"; $watchlist .= "\n\t\t<item rdf:about='http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/look/{$_SERVER['FINGERPRINT']}'/>\n\t\t\t<title>>> Planwatch Look</title>\n\t\t\t<link>http://{$_SERVER['HTTP_HOST']}{$_SERVER['WEB_ROOT']}/look/{$_SERVER['FINGERPRINT']}</link>\n\t\t\t<description>Planwatch Look</description>\n\t\t</item>\n"; $watchlist = "{$items}\n<!-- FEED_DIVIDER -->\n{$watchlist}"; return $watchlist; }
function spiel_format_list_html() { $already_listed = array(); if (file_exists("{$_SERVER['PWUSERS_DIR']}/{$_SERVER['USER']}/spielslist.txt")) { $list = array_unique(file("{$_SERVER['PWUSERS_DIR']}/{$_SERVER['USER']}/spielslist.txt")); } if (is_array($list)) { foreach ($list as $item) { if (($item = trim($item)) && !in_array(trim($item), $already_listed)) { $content .= "<li><a href='{$_SERVER['WEB_ROOT']}/spiel/view/{$item}'>" . files_decode_safe_name($item) . "</a> " . formattime(spiel_get_last_update($item)) . " [ <a href='{$_SERVER['WEB_ROOT']}/spiel/ignore/{$item}'>x</a> ]\n </li>"; } $already_listed[] = trim($item); } } if ($content) { $content = "<li class='listheader'>Watched Spiels</li>\n {$content}"; } return $content; }
" class="unline fb_14" target="_blank" ><?php echo $t['username']; ?> </a></li> </ul> <div class="skill" style="width:570px;"> <dl class="know"> <dd class="clear default"> <div class="clear"> <p class="text_w"><span class="icon-title"></span><span class="simple f_3"><?php echo $t['title']; ?> </span></p> <p class="text_w2"><span class="fr f_6"><?php echo formattime($t['add_time']); ?> </span></p> </div> <div class="clear"> <p class="text_w"><span class="icon-desc"></span><span class="detail"><?php echo $t['content']; ?> </span></p> <p class="text_w2 js_text_w2" style="display:none;"><a href="javascript:void(0);" class="exchange_btn" onclick="show_answer_form(<?php echo $t['uid']; ?> ,<?php echo $t['tid']; ?> );">我要帮</a><a class="study_btn" target="_blank" href="<?php
$uz = empty($_GET['uz']) ? check($log) : check(strval($_GET['uz'])); switch ($act) { ############################################################################################ ## Главная страница ## ############################################################################################ case 'index': if ($data = user($uz)) { show_title(user_avatars($uz) . nickname($uz), user_visit($uz)); $config['newtitle'] = 'Анкета пользователя ' . nickname($data['users_login']); if ($data['users_confirmreg'] == 1) { echo '<b><span style="color:#ff0000">Внимание, аккаунт требует подтверждение регистрации!</span></b><br />'; } if ($data['users_ban'] == 1 && $data['users_timeban'] > SITETIME) { echo '<div class="form">'; echo '<b><span style="color:#ff0000">Внимание, юзер находится в бане!</span></b><br />'; echo 'До окончания бана осталось ' . formattime($data['users_timeban'] - SITETIME) . '<br />'; echo 'Причина: ' . bb_code($data['users_reasonban']) . '</div>'; } if ($data['users_level'] >= 101 && $data['users_level'] <= 105) { echo '<div class="info">Должность: <b>' . user_status($data['users_level']) . '</b></div>'; } if (!empty($data['users_picture']) && file_exists(BASEDIR . '/upload/photos/' . $data['users_picture'])) { echo '<a class="pull-right" href="/upload/photos/' . $data['users_picture'] . '">'; echo resize_image('upload/photos/', $data['users_picture'], $config['previewsize'], array('alt' => nickname($data['users_login']), 'class' => 'img-responsive img-rounded')) . '</a>'; } else { echo '<img src="/images/img/photo.jpg" alt="Фото" class="pull-right img-responsive img-rounded" />'; } echo 'Cтатус: <b><a href="statusfaq.php">' . user_title($data['users_login']) . '</a></b><br />'; echo user_gender($data['users_login']) . 'Пол: '; echo $data['users_gender'] == 1 ? 'Мужской <br />' : 'Женский<br />'; echo 'Логин: <b>' . $data['users_login'] . '</b><br />';
if ($total > 0) { if ($start < 0 || $start > $total) { $start = 0; } if ($total < $start + $config['banlist']) { $end = $total; } else { $end = $start + $config['banlist']; } for ($i = $start; $i < $end; $i++) { $data = explode("|", $file[$i]); echo '<div class="b"><img src="../images/img/user.gif" alt="image" /> <b><a href="../pages/anketa.php?uz=' . $data[1] . '&' . SID . '">' . nickname($data[1]) . '</a></b> '; echo '(Забанен: ' . date_fixed($data[4]) . ')</div>'; echo '<div>'; if ($data[2] - SITETIME > 0) { echo 'До окончания бана осталось ' . formattime($data[2] - SITETIME) . '<br />'; } else { echo '<b>Срок бана уже истек</b><br />'; } echo 'Забанил: <b>' . nickname($data[5]) . '</b><br />'; echo 'Причина: ' . $data[3] . '<br />'; echo '<img src="../images/img/edit.gif" alt="image" /> <a href="zaban.php?action=edit&users=' . $data[1] . '&' . SID . '">Разбанить</a></div>'; } page_jumpnavigation('banlist.php?', $config['banlist'], $start, $total); page_strnavigation('banlist.php?', $config['banlist'], $start, $total); echo '<br /><br />Всего забанено: <b>' . (int) $total . '</b><br />'; } else { echo '<img src="../images/img/error.gif" alt="image" /> <b>Пользователей еще нет!</b><br />'; } } else { echo '<img src="../images/img/error.gif" alt="image" /> <b>Пользователей еще нет!</b><br />';
function snitch_read($owner, $threshhold) { if (!$threshhold) { $threshhold = '2dr'; } $writer = $_SERVER['USER']; if ($_SERVER['USER'] == $owner) { if ($threshhold == 'r' . $_SERVER['USERINFO_ARRAY']['snitch_default_days'] . 'd') { $mode = 'NORMAL'; } if ($threshhold == 'r2h') { $mode = 'BRIEF'; } $last_plan_update = plan_get_last_update($_SERVER['USER']); if (strpos($threshhold, 'r') !== FALSE) { $newest_first = 'SELECTED'; } else { $oldest_first = 'SELECTED'; } if (strpos($threshhold, 'w') !== FALSE) { $weeks_selected = 'SELECTED'; } elseif (strpos($threshhold, 'h') !== FALSE) { $hours_selected = 'SELECTED'; } elseif (strpos($threshhold, 'm') !== FALSE) { $minutes_selected = 'SELECTED'; } else { $days_selected = 'SELECTED'; } $threshvalue = str_replace(array('d', 'r', 'w', 'd', 'h', 'm'), '', $threshhold); if ($threshhold == 'sidebar') { $threshhold = '1d'; $reverse = 'true'; $sidebar = 1; } if (strstr($threshhold, 'r')) { $reverse = 'true'; $threshhold = str_replace('r', '', $threshhold); } $threshhold = time_calculate_threshhold($threshhold); $threshhold = time() - $threshhold; profile('snitch_read'); $snitch_fn = "{$_SERVER['USER_ROOT']}/stats/planlog.txt"; if (file_exists($snitch_fn)) { if ($mode == 'NORMAL') { exec("tail -n 200 {$snitch_fn}", $snitch_array); } if ($mode == 'BRIEF') { exec("tail -n 30 {$snitch_fn}", $snitch_array); } else { $snitch_array = explode("\n", file_get_contents($snitch_fn)); } } else { $snitch_array = array(); } profile('snitch_read'); if ($reverse) { $snitch_array = array_reverse($snitch_array); } foreach ($snitch_array as $k => $snitch_entry) { list($blah, $snitch_user, $blah) = explode(',', $snitch_entry); $snitch_users[] = $snitch_user; } if (is_array($snitch_users)) { $snitch_users = array_unique($snitch_users); } else { $snitch_users = 'No snitch'; } if ($mode) { $lastview = plan_get_last_view($snitch_users); } if ($mode) { $lastupdate = plan_get_last_update($snitch_users); } profile('snitch_format_begin'); foreach ($snitch_array as $k => $snitch_entry) { unset($style); unset($class); $snitch_entry = explode(',', $snitch_entry); if ($snitch_entry[0] > $threshhold) { if ($snitch_entry[0] < $last_plan_update) { $content .= "<li style='margin: 15px;'>" . str_replace(' ', ' ', formattime($last_plan_update)) . " Last Plan Update</li>"; $last_plan_update = 0; } $su_key = array_search($snitch_entry[1], $snitch_users); $snitchday = date('d', $snitch_entry[0]); if ($last_snitchday && $snitchday != $last_snitchday) { $style = "margin-top: 15px;"; } $time_string = str_replace(' ', ' ', formattime($snitch_entry[0])); if (strlen(date('g', $snitch_entry[0])) == 1) { $time_string .= " "; } if ($lastupdate[$su_key] > 0 && $lastupdate[$su_key] > $lastview[$su_key]) { $class = "unread"; } else { $class = 'read'; } if (strpos($snitch_entry[1], 'Anon') !== FALSE) { $snitch_ip = str_replace("Anonymous Coward from ", '', $snitch_entry[1]); if ($snitch_ip == 'livejournal.com') { $snitch_entry[1] = "LiveJournal"; } elseif (strstr($snitch_ip, 'facebook.com')) { $snitch_entry[1] = "Facebook"; } else { if (strpos($_SERVER['REQUEST_URI'], '/snitch') === 0 && $_SERVER['OUTPUT_MODE'] != 'IPHONE') { $ac = "Anonymous Coward "; } else { $ac = "AC "; } $numerical_ip = gethostbyname($snitch_ip); $snitch_entry[1] = "{$ac} from {$snitch_ip}"; if ($ac != 'AC ') { $snitch_entry[1] .= " <a href='{$_SERVER['WEB_ROOT']}/trace/{$snitch_ip}'>trace</a> | <a href='{$_SERVER['WEB_ROOT']}/lists/add/blocked/{$numerical_ip}'>block</a>\n"; } } } if (strpos($snitch_entry[2], 'archives') !== FALSE) { preg_match("|archives \\( (r.*d) 3(.*) \\)|", $snitch_entry[2], $matches); $length = $matches[1]; $timecode = $matches[2]; $url = date("Y/m/d/h:i", $timecode); $snitch_entry[2] = str_replace($matches[0], "<a href='/read/{$_SERVER['USER']}/{$length}/{$url}'>archives ({$length} from " . date("F jS Y g:ia", $timecode) . ")</a>", $snitch_entry[2]); } if (strpos($snitch_entry[1], 'RSS') !== FALSE) { $snitch_ip = str_replace("RSS Reader from ", '', $snitch_entry[1]); if (strstr($_SERVER['REQUEST_URI'], 'snitch')) { $rr = "RSS Reader "; } else { $rr = "RSS "; } $snitch_entry[1] = "{$rr} <span class='edit_links'>from {$snitch_ip}"; if ($rr != 'RSS ') { $snitch_entry[1] .= "[ <a href='{$_SERVER['WEB_ROOT']}/trace/{$snitch_ip}'>trace</a> | <a href='{$_SERVER['WEB_ROOT']}/lists/add/blocked/{$ip}'>block</a> ]</span>\n"; } } if (!strstr($snitch_entry[1], 'AC ') && !strstr($snitch_entry[1], 'Anon') && !strstr($snitch_entry[1], 'RSS') && !strstr($snitch_entry[1], 'LiveJournal') && !strstr($snitch_entry[1], 'Facebook')) { $content .= "<li class='{$class}' style='{$style}'><a href='{$_SERVER['WEB_ROOT']}/read/{$snitch_entry['1']}'>{$time_string} {$snitch_entry['1']}</a> {$snitch_entry['2']}</li>"; } elseif ($sidebar != 1) { $content .= "<li class='{$class}' style='{$style}'>{$time_string} {$snitch_entry['1']} {$snitch_entry['2']}</li>\n"; } else { $content .= "<li class='{$class}' style='{$style}'>{$time_string} AC {$snitch_entry['2']}</li>\n"; } $last_snitchday = $snitchday; } else { $k += 10000; } } profile('snitch_format_end'); } else { $content = "<li class='alert'>you are not the owner of {$owner}'s plan. you are {$user}. please re-login if this is an error.</li>"; } return $content; }
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><?php echo htmlspecialchars(formatdate($event_row[$k])); ?> </li> <?php } elseif ($k == 6) { ?> <li><?php echo htmlspecialchars(formattime($event_row[$k])); ?> - <?php } elseif ($k == 7) { ?> <?php echo htmlspecialchars(formattime($event_row[$k])); ?> </li> <?php } elseif ($k == 9) { ?> <li class="descr">"<?php echo htmlspecialchars($event_row[$k]); ?> "</li> <?php } else { ?> <li><?php echo htmlspecialchars($event_row[$k]); ?>
echo '<img src="../images/img/partners.gif" alt="image" /> <b>Банк</b><br /><br />'; if (is_user()) { ############################################################################################ ## Главная страница ## ############################################################################################ if ($action == "") { $string = search_string(DATADIR . "bank.dat", $log, 1); if ($string) { echo 'В наличии: ' . moneys($udata[41]) . '<br />'; echo 'В банке: ' . moneys($string[2]) . '<br /><br />'; if ($string[2] > $config['maxsumbank']) { echo '<b><span style="color:#ff0000">Внимание у вас слишком большой вклад</span></b><br />'; } if ($string[2] > 0 && $string[2] < $config['maxsumbank']) { if ($string[3] >= SITETIME) { echo 'До получения процентов осталось ' . formattime($string[3] - SITETIME) . '<br />'; } else { $stavka = 12; if ($string[2] >= 100000) { $stavka = 6; } if ($string[2] >= 250000) { $stavka = 3; } if ($string[2] >= 500000) { $stavka = 2; } if ($string[2] >= 1000000) { $stavka = 1; } $percent = round($string[2] * $stavka / 100);
$timestamp += (double) $jrun['runtime']; } XMLaddnode($run, 'judged', 'True'); XMLaddnode($run, 'status', 'done'); XMLaddnode($run, 'result', $result_map[$jdata['result']]); if ($jdata['result'] == 'correct') { XMLaddnode($run, 'solved', 'True'); XMLaddnode($run, 'penalty', 'False'); } else { XMLaddnode($run, 'solved', 'False'); if ($compile_penalty == 0 && $jdata['result'] == 'compiler-error') { XMLaddnode($run, 'penalty', 'False'); } else { XMLaddnode($run, 'penalty', 'True'); } } } } // We don't support a finalize attribute in DOMjudge master branch, so // just output some fake data if the contest has finished. if (difftime(now(), $cdata['endtime']) >= 0) { $node = XMLaddnode($root, 'finalized'); XMLaddnode($node, 'timestamp', formattime($cdata['endtime'])); XMLaddnode($node, 'last-gold', 0); XMLaddnode($node, 'last-silver', 0); XMLaddnode($node, 'last-bronze', 0); XMLaddnode($node, 'comment', 'Automatically finalized by DOMjudge'); } header('Content-Type: text/xml; charset=' . DJ_CHARACTER_SET); $xmldoc->formatOutput = true; echo $xmldoc->saveXML();
$act = check($_GET['act']); } else { $act = 'index'; } show_title('Бан пользователя'); if (is_user()) { if ($udata['users_ban'] == 1) { if ($udata['users_timeban'] > SITETIME) { switch ($act) { ############################################################################################ ## Главная страница ## ############################################################################################ case 'index': echo '<img src="/images/img/error.gif" alt="image" /> <b>Вас забанили</b><br /><br />'; echo '<b><span style="color:#ff0000">Причина бана: ' . bb_code($udata['users_reasonban']) . '</span></b><br /><br />'; echo 'До окончания бана осталось <b>' . formattime($udata['users_timeban'] - SITETIME) . '</b><br /><br />'; echo 'Чтобы не терять время зря, рекомендуем вам ознакомиться с <b><a href="/pages/rules.php">Правилами сайта</a></b><br /><br />'; echo 'Общее число строгих нарушений: <b>' . $udata['users_totalban'] . '</b><br />'; echo 'Внимание, максимальное количество нарушений: <b>5</b><br />'; echo 'При превышении лимита нарушений ваш профиль автоматически удаляется<br />'; echo 'Востановление профиля или данных после этого будет невозможным<br />'; echo 'Будьте внимательны, старайтесь не нарушать больше правил<br /><br />'; // --------------------------------------------------// if ($config['addbansend'] == 1 && $udata['users_explainban'] == 1) { echo '<div class="form">'; echo '<form method="post" action="ban.php?act=send">'; echo 'Объяснение:<br />'; echo '<textarea cols="25" rows="5" name="msg"></textarea><br />'; echo '<input value="Отправить" name="do" type="submit" /></form></div><br />'; echo 'Если модер вас забанил по ошибке или вы считаете, что бан не заслужен, то вы можете написать объяснение своего нарушения<br />'; echo 'В случае если ваше объяснение будет рассмотрено и удовлетворено, то возможно вас и разбанят<br /><br />';
function list_format_iphone($list = FALSE, $sortby = FALSE) { profile('list_format_html', 'begin'); profile("prelist"); if ($_SERVER['USER_ROOT'] && is_dir("{$_SERVER['USER_ROOT']}/sends/")) { // echo $_SERVER['USER_ROOT']; $new_sends = files_list("{$_SERVER['USER_ROOT']}/sends/", "*..new"); } if ($new_sends) { $watchlist .= "<option value='/send'>sends</option>"; foreach ($new_sends as $new_send) { $sender = files_decode_safe_name(str_replace("..new", '', $new_send)); $watchlist .= "<option value='/send/{$sender}'>{$sender}</option>\n"; } } if (!$list) { $list_fn = "{$_SERVER['USER_ROOT']}/watchedlist.txt"; // reads in the user's watched list if (file_exists($list_fn)) { $list = file($list_fn); if ($list[0] == "sort by time\n") { $sortby = 'time'; } elseif ($list[0] == "sort by name\n") { $sortby = 'name'; } elseif ($list[0] == "sort by none\n") { $sortby = 'inorder'; } else { $sortby = 'inorder'; } if (strpos($list[0], 'sort by ') !== FALSE) { unset($list[0]); } } else { $list = array(); } $list = array_merge(array("#Watched Plans"), $list); } profile("prelist"); profile('list_format_html_prep', 'begin'); $ptime = plan_get_last_update($list); $lastview = plan_get_last_view($list); $ordinal = 0; foreach ($list as $z => $plan) { $plan = urldecode($plan); if (strstr($plan, '!!!')) { $prune = TRUE; $plan = ''; } if (strstr($plan, '!prune')) { // $prune=TRUE; $threshhold = str_replace('!prune', '', $plan); $threshhold = time_calculate_threshhold($threshhold); $threshhold = time() - $threshhold; $plan = ''; } if (trim($plan) == '!onlynew') { $onlynew = TRUE; } if (trim($plan) == '!alwaysnew') { $alwaysnew = TRUE; } $plan = str_replace(array('!alwaysnew', '!onlynew'), '', $plan); $alias_array = explode(':', str_replace('!', '', $plan)); $displayname = end($alias_array); $url = $alias_array[0]; if ($alias_array[1][0] == '/') { $url .= ":{$alias_array['1']}"; } if (!is_string($displayname) || $displayname == $url) { if (strstr($url, '@')) { list($username, $host) = explode("@", $url); $displayname = "{$username} <span style='font-size: smaller;'>@{$host}</span>"; } else { $displayname = $url; } } // else echo $displayname; if ($displayname[0] == '#') { $groupname = htmlentities(str_replace('#', '', $displayname)); $grouplist[] = $groupname; } if (trim($plan)) { if ($plan[0] != '#') { if (file_exists("{$_SERVER['USER_ROOT']}/send/" . files_encode_safe_name($url) . "..new")) { $send = "<a href='/send/{$url}'>SEND</a>"; } else { $send = ''; } $biglist[$ordinal] = array("group" => $groupname, "url" => trim($url), "name" => $displayname, "updated" => $ptime[$z], "viewed" => $lastview[$z], "send" => $send); $timelist[$ordinal] = $ptime[$z]; $namelist[$ordinal] = $displayname; $ordinal++; } } if (!is_array($grouplist)) { $grouplist = array(''); } } profile('list_format_html_prep', 'end'); if (!$prune) { $onlynew = FALSE; $alwaysnew = FALSE; $threshhold = 0; } profile("buildlist"); if ($sortby == 'inorder') { foreach ($biglist as $i => $plan_details) { $plan_details = $biglist[$i]; if ($plan_details['updated'] > $plan_details['viewed']) { $class = '* '; } else { $class = ''; } if ($plan_details['updated'] > $threshhold || !$prune || $alwaysnew && $class == 'unread') { $plan_details['updated'] = formattime($plan_details['updated']); $outputlist[$plan_details['group']] .= "<option value='/read/{$plan_details['url']}'>{$class}{$plan_details['name']}: {$plan_details['updated']}</option>\n"; } } } if ($sortby == 'name') { asort($namelist); foreach ($namelist as $i => $name) { $plan_details = $biglist[$i]; if ($plan_details['updated'] > $plan_details['viewed']) { $class = '* '; } else { $class = ''; } if ($plan_details['updated'] > $threshhold || !$prune || $alwaysnew && $class == 'unread') { $plan_details['updated'] = formattime($plan_details['updated']); $outputlist[$plan_details['group']] .= "<option value='/read/{$plan_details['url']}'>{$class}{$plan_details['name']}: {$plan_details['updated']}</option>\n"; } } } if ($sortby == 'time') { arsort($timelist); foreach ($timelist as $i => $time) { $plan_details = $biglist[$i]; if ($plan_details['updated'] > $plan_details['viewed']) { $class = '* '; } else { $class = ''; } if ($plan_details['updated'] > $threshhold || !$prune || $alwaysnew && $class == 'unread') { $plan_details['updated'] = formattime($plan_details['updated']); $outputlist[$plan_details['group']] .= "<option value='/read/{$plan_details['url']}'>{$class}{$plan_details['name']}: {$plan_details['updated']}</option>\n"; } } } foreach ($grouplist as $groupname) { $jsgroupname = trim(str_replace(" ", "_", $groupname)); if ($outputlist[$groupname] || strtolower($groupname) == 'watched plans') { $watchlist .= "\n\t\t<option value=''>---</option><option value='/look/group/" . urlencode(trim($groupname)) . "'>[{$groupname}]</option>\n{$outputlist[$groupname]}"; } } profile("buildlist"); profile('list_format_html', 'end'); return $watchlist; }
function dispscore($sc) { global $torecord; if ($torecord == 't') { return formattime($sc); } else { if ($torecord == 'cc') { return $sc . ' correct'; } else { return $sc . ' attempts'; } } }
function send_display($correspondent, $form = TRUE, $offset = 0) { $correspondent = str_replace("@planwatch.org", '', $correspondent); $send_dir = "{$_SERVER['USER_ROOT']}/sends"; if (!is_dir($send_dir)) { umask(0); mkdir($send_dir, 0755); } $sendlist = files_list($send_dir, files_encode_safe_name($correspondent) . "*message*"); if (is_array($sendlist)) { foreach ($sendlist as $i => $send) { $send_fn = basename($send); $send = str_replace("@planwatch.org", '', files_decode_safe_name($send_fn)); list($recipient, $time, $direction) = explode("..", $send); if ($direction == 'messagefrom') { $from = $correspondent; $style = ' class="send_from" '; } else { $from = $_SERVER['USER']; $style = ' class="send_to" '; } if (IS_JOSH) { $sendarray[$time] = "<div {$style}>" . smart_nl2br(removeEvilTags(file_get_contents($send_dir . "/{$send_fn}"))) . "<div style='text-align: right; font-size: 70%; font-weight: normal;'>— {$from} <span style='font-size: 70%; font-weight: normal;'>(" . formattime($time) . ")</span></div> </div>\n"; } else { $sendarray[$time] = "<div {$style}> {$from} (" . formattime($time) . "): " . smart_nl2br(removeEvilTags(file_get_contents($send_dir . "/{$send_fn}"))) . "</div>\n"; } } krsort($sendarray); if (IS_JOSH) { $firstmessage = reset($sendarray); unset($sendarray[key($sendarray)]); } if (OUTPUT_MODE == 'MOBILE') { $sendarray = array_slice($sendarray, $offset, 20); } else { $sendarray = array_slice($sendarray, $offset, 100); } $latest_time = array_shift(array_keys($sendarray)); // if ($latest_time < time() - 600 && $_SERVER['OUTPUT_MODE']=='AJAX') $content="IGNORE.NULL"; //else $content = implode("\n", $sendarray); if (file_exists("{$send_dir}/" . files_encode_safe_name("{$correspondent}..new"))) { unlink("{$send_dir}/" . files_encode_safe_name("{$correspondent}..new")); } if (file_exists("{$send_dir}/" . files_encode_safe_name("{$correspondent}@planwatch.org..new"))) { unlink("{$send_dir}/" . files_encode_safe_name("{$correspondent}@planwatch.org..new")); } } $content = hyperlink($content); if ($form) { if (browser_is_modern() && $_SERVER['OUTPUT_MODE'] != 'IPHONE' && $_SERVER['OUTPUT_MODE'] != 'MOBILE') { $sendbutton = "<input type='button' onclick='sendMessage();' value='Send' style='font-size: 20px; color: white; background: {$GLOBALS['linkcolor']}; font-family: {$GLOBALS['pfont']},{$GLOBALS['pfonts']}; font-weight: bold; ' />"; } else { $sendbutton = "<input type=\"submit\" value='Send' class='whiteButton' href=\"#\" style='' />"; } if (!$offset) { if (IS_JOSH) { $content = "\n\t\t\t\t{$firstmessage}<br clear='all' />\n\t\t\t\t<form action='{$_SERVER['WEB_ROOT']}/scripts/send.php' style='margin: 0px; display: block; ' method='post' class='panel'>\n\t\t\t\t<textarea id='textbox' name='sendmessage' style='width: 90%; font-size: 16px; height: 40px;' onfocus='this.style.height=\"200px;\"' onblur='this.style.height=\"40px;\"'></textarea>\n\t\t\t\t{$sendbutton}<br clear='all' />\n\n\t\t\t\t<hr />\n\t\t\t\t<h2>previously...</h2>\n\t\t\t\t<input type='hidden' name='action' value='send'/>\n\t\t\t\t<input type='hidden' id='recipient' name='recipient' value='{$correspondent}'/>\n\t\t\t\t<input type='hidden' id='sender' name='sender' value='{$_SERVER['USER']}'/>\n\t\t\t\t</form>\n\t\t\t\t<div id='send_div'>\n\t\t\t\t{$content}\n\t\t\t\t</div>\n\t\t\t\t<script type='text/javascript'>\tsetInterval(\"send_refresh();\",9757);</script>\n\n\t\t\t\t"; return $content; } if ($_SERVER['OUTPUT_MODE'] == 'HTML') { $content = "\n\t\t\t\t<form action='{$_SERVER['WEB_ROOT']}/scripts/send.php' style='margin: 0px;' method='post' class='panel'>\n\t\t\t\t<h1>Send with <a href='/read/{$correspondent}'>{$correspondent}</a></h1>\n\t\t\t\t<div id='send_div' style='overflow: auto; height: 200px; margin-bottom: 30px; width: 80%;'>\n\t\t\t\t{$content}\n\t\t\t\t</div>\n<!--\t\t\t\t<script src='/resources/javascript/edit.js'></script>-->\n\t\t\t\t<textarea id='textbox' name='sendmessage'></textarea>\n\t\t\t\t{$sendbutton}\n\t\t\t\t<input type='hidden' name='action' value='send'/>\n\t\t\t\t<input type='hidden' id='recipient' name='recipient' value='{$correspondent}'/>\n\t\t\t\t<input type='hidden' id='sender' name='sender' value='{$_SERVER['USER']}'/>\n\t\t\t\t</form>\n<!--\t\t\t\t<a href='/send/{$correspondent}/" . ($offset + 100) . "'>more...</a>-->\n\t\t\t\t<script type='text/javascript'>\tsetInterval(\"send_refresh();\",9757);</script>\n"; } if ($_SERVER['OUTPUT_MODE'] == 'IPHONE' || $_SERVER['OUTPUT_MODE'] == 'MOBILE') { $content = "\n\t\t\t\t<style type='text/css'>.send_from { background-color: #ffc; }</style>\n\t\t\t\t<form action='{$_SERVER['WEB_ROOT']}/scripts/send.php' style='margin: 0px;' method='post' class='panel'>\n\t\t\t\t<h3>Send with <a href='/read/{$correspondent}'>{$correspondent}</a></h3>\n<!--\t\t\t\t<script src='/resources/javascript/edit.js'></script>-->\n\t\t\t\t<textarea id='textbox' name='sendmessage' style='width: 300px; font-size: 16px;'></textarea>\n<!--\t\t\t\t<textarea id='sendmessage' style='width: 300px; height: 80px;' name='sendmessage'></textarea>-->\n\t\t\t\t{$sendbutton}<br clear='all' />\n\t\t\t\t<input type='hidden' name='action' value='send'/>\n\t\t\t\t<input type='hidden' id='recipient' name='recipient' value='{$correspondent}'/>\n\t\t\t\t<input type='hidden' id='sender' name='sender' value='{$_SERVER['USER']}'/>\n\t\t\t\t</form>\n\t\t\t\t<div id='send_div'>\n\t\t\t\t{$content}\n\t\t\t\t</div>\n\t\t\t\t<a target='_replace' href='/send/{$correspondent}/" . ($offset + 20) . "'>more...</a>\n\t\t\t\t<script type='text/javascript'>\tsetInterval(\"send_refresh();\",9757);</script>\n"; } } else { output("send from {$correspondent} starting at {$offset}", $content); } } return $content; }