<script type="text/javascript"> $(document).ready(function () { $('#umsocs').DataTable(); $('#ussocs').DataTable(); $('#umsocs_wrapper').css({"padding":"10px"}); $('#ussocs_wrapper').css({"padding":"10px"}); }); </script> <?php $table = div(div(par("Societies you moderate"), "panel-heading"), "panel panel-primary"); $table["children"][] = make_table($msubs, ["society", "mod since"], "table", "umsocs", [], [0]); echo to_html($table); $table = div(div(par("Subscribed societies"), "panel-heading"), "panel panel-primary"); $table["children"][] = make_table($subs, ["society", "subbed since"], "table", "ussocs", [], [0]); echo to_html($table);
?> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="index.php">What can I do for Wikimedia Commons?</a> </div> </div> </nav> <?php if (isset($_GET['new']) && !empty($_GET['new'])) { echo "<div class=\"alert alert-warning alert-dismissible fade in\" role=\"alert\"> <a href=\"find.php?nextid=0\" type=\"button\" class=\"close\" \naria-label=\"Close\"><span aria-hidden=\"true\">×</span></a> <strong>New at Wikimedia Commons?</strong> You should probably read <a href=\"https://commons.wikimedia.org/wiki/Commons:Welcome\">Commons:Welcome</a> first! :-)</div>"; } ?> <div class="jumbotron"> <h2><?php par('data/find.txt'); ?> </h2> <br><br> <p> <a class="btn btn-lg btn-primary" href="find.php?nextid=<?php echo rand(111, 99999); ?> " role="button"><?php nb(); ?> »</a> </p> </div> <small><div style = "float: left;"><a href="index.php">home</a> | <a href="javascript:history.back()">back</a></div> <div style="text-align: right;"><?php help("<span class=\"caret\"></span> ");
<a href="#" class="btn" data-dismiss="modal">Cancel</a> </div> </form> </div> </div> </div> <?php if ($soc["status"] != "LOCKED" && !$status["banned"]) { echo "<p><a data-toggle=\"modal\" data-target=\"#new-post\" class=\"btn btn-primary btn-large\">New Post</a></p>"; } ?> </div> <!-- posts --> <div class="panel panel-default"> <div class="panel-heading">Posts</div> <div class="list-group panel-body"> <?php if (count($posts) == 0) { echo to_html(par("No posts yet.")); } else { foreach ($posts as $p) { echo "<div class=\"row\">"; echo to_html(post_summary($p, $soc["soc_name"])); echo "</div>"; echo "<hr>"; } } ?> </div> </div>
<?php include "funciones.php"; $n = $_POST["n"]; $serapar = par($n); if ($serapar == 0) { echo "par"; } else { echo "no es par"; } $seraprimo = primo($n); if ($seraprimo == 2) { echo "primo"; } else { echo "no es primo"; } $signo = positivo($n); if ($signo == 1) { echo "el numero es positivo"; } else { if ($igno == -1) { echo "el numero es negativo"; } else { if ($signo == 0) { echo "el numero es negativo"; } } } ?>
<script type="text/javascript"> $(document).ready(function () { $('#sreps').DataTable(); $('#sreps_wrapper').css({"padding":"10px"}); }); </script> <?php // user reports $table = div(div(par("Reports about societies"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($reps, ["society", "reported by", "time", "reason"], "table", "sreps", [1], [0]); echo to_html($table);
<script> $(document).ready(function() { $('#user_bans').DataTable(); $('#user_bans_wrapper').css({"padding":"10px"}); } ); </script> <?php // ban form $fdiv = div(div(par("Ban a user"), "panel-heading"), "panel panel-danger"); $form = make_form("admin_panel.php?view=bans", "post", "form-inline"); $form = add_field($form, "user_to_ban", "Username", true, "form-control"); $form = add_field($form, "ban_reason", "Reason for ban", true, "form-control"); $form = add_button($form, "Ban", "btn btn-default"); $fdiv["children"][] = div(div($form, "form-group"), "panel-body"); echo to_html($fdiv); // unban form $fdiv = div(div(par("Unban a user"), "panel-heading"), "panel panel-success"); $form = make_form("admin_panel.php?view=bans", "post", "form-inline"); $form = add_field($form, "user_to_unban", "Username", true, "form-control"); $form = add_field($form, "unban_reason", "Reason for unbanning", true, "form-control"); $form = add_button($form, "Unban", "btn btn-default"); $fdiv["children"][] = div(div($form, "form-group"), "panel-body"); echo to_html($fdiv); // banned users list $table = div(div(par("Banned Users"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($bans, ["username", "banned by", "time", "reason"], "table", "user_bans", [0, 1]); echo to_html($table);
<script type="text/javascript"> $(document).ready(function () { $('#del_comms').DataTable(); $('#del_comms_wrapper').css({"padding":"10px"}); }); </script> <?php // user reports $table = div(div(par("Deleted comments"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($comms, ["comment text", "deleted by", "time", "comment"], "table", "del_comms", [1]); echo to_html($table);
<script type="text/javascript"> $(document).ready(function () { $('#uphist').DataTable(); $('#uphist_wrapper').css({"padding":"10px"}); }); </script> <?php $table = div(div(par("Post history"), "panel-heading"), "panel panel-primary"); $table["children"][] = make_table($posts, ["title", "votes", "society", "time"], "table", "uphist", [], [2], [0]); echo to_html($table);
<?php include 'db.php'; $loginCount = scalar('SELECT COUNT(*) FROM users WHERE login="******"', $conn); if ($loginCount == 0) { insert('INSERT INTO users (login, pass) VALUES ("' . par('login') . '", "' . par('pass') . '")', $conn); $_SESSION['auth'] = '1'; echo 1; }
function comment($c, $mod) { $vb = comm_vote_buttons($c); $title = strong("\t(" . ($c["votes"] > 0 ? "+" : "") . $c["votes"] . ") " . $c["username"], "comm-title", "comm-title-" . $c["comm_id"]); $time = small("(" . $c["time"] . ")", "comm-time", "comm-time-" . $c["comm_id"]); $text = div(par($c["status"] == "DELETED" ? "[DELETED]" : $c["text"], "comm-text comm-text-deleted", "comm-text-" . $c["comm_id"]), "well"); if ($c["status"] != "DELETED") { // reply button $reply = a("", "btn btn-xs btn-link comm-reply"); $reply["data"] = "reply"; $reply["attribs"]["data-toggle"] = "modal"; $reply["attribs"]["data-target"] = "#new-comm"; $reply["attribs"]["value"] = $c["comm_id"]; // report button $rept = a("", "btn btn-xs btn-link comm-report"); $rept["data"] = "report"; $rept["attribs"]["data-toggle"] = "modal"; $rept["attribs"]["data-target"] = "#report-comm"; $rept["attribs"]["value"] = $c["comm_id"]; $rept["attribs"]["style"] = "float:right;"; // delete button $del = a("", "btn btn-xs btn-link comm-del"); $del["data"] = "delete"; $del["attribs"]["data-toggle"] = "modal"; $del["attribs"]["data-target"] = "#del-comm"; $del["attribs"]["value"] = $c["comm_id"]; $del["attribs"]["style"] = "float:right;"; // add buttons $text["children"][] = hr(); $text["children"][] = $reply; $text["children"][] = $mod ? $del : $rept; } $final = div($vb, "well" . ($c["anc_id"] != $c["comm_id"] ? " col-sm-offset-1" : "")); $final["children"][] = $title; $final["children"][] = $time; $final["children"][] = $text; return $final; }
<script> $(document).ready(function() { $('#soc_locks').DataTable(); $('#soc_locks_wrapper').css({"padding":"10px"}); } ); </script> <?php // lock form $fdiv = div(div(par("Lock a Society"), "panel-heading"), "panel panel-danger"); $form = make_form("admin_panel.php?view=locks", "post", "form-inline"); $form = add_field($form, "soc_to_lock", "socname", true, "form-control"); $form = add_field($form, "lock_reason", "Reason for lock", true, "form-control"); $form = add_button($form, "lock", "btn btn-default"); $fdiv["children"][] = div(div($form, "form-group"), "panel-body"); echo to_html($fdiv); // unlock form $fdiv = div(div(par("Unlock a Society"), "panel-heading"), "panel panel-success"); $form = make_form("admin_panel.php?view=locks", "post", "form-inline"); $form = add_field($form, "soc_to_unlock", "socname", true, "form-control"); $form = add_field($form, "unlock_reason", "Reason for unlocking", true, "form-control"); $form = add_button($form, "Unlock", "btn btn-default"); $fdiv["children"][] = div(div($form, "form-group"), "panel-body"); echo to_html($fdiv); // Soc related activities $table = div(div(par("Locked societies"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($locks, ["society", "admin name", "time", "comment"], "table", "soc_locks", [1], [0]); echo to_html($table);
<script> $(document).ready(function() { $('#mod_list').DataTable(); $('#mod_list_wrapper').css({"padding":"10px"}); } ); </script> <?php // promote form $fdiv = div(div(par("Promote a user to moderator"), "panel-heading"), "panel panel-success"); $form = make_form("mod_panel.php?soc=" . $soc["soc_name"] . "&view=mods", "post", "form-inline"); $form = add_field($form, "user_to_mod", "Username", true, "form-control"); $form = add_field($form, "mod_reason", "Reason for promotion", true, "form-control"); $form = add_button($form, "Mod", "btn btn-default"); $fdiv["children"][] = div(div($form, "form-group"), "panel-body"); echo to_html($fdiv); // demote form $fdiv = div(div(par("De-mod a user"), "panel-heading"), "panel panel-danger"); $form = make_form("mod_panel.php?soc=" . $soc["soc_name"] . "&view=mods", "post", "form-inline"); $form = add_field($form, "user_to_demod", "Username", true, "form-control"); $form = add_field($form, "demod_reason", "Reason for demotion", true, "form-control"); $form = add_button($form, "Demod", "btn btn-default"); $fdiv["children"][] = div(div($form, "form-group"), "panel-body"); echo to_html($fdiv); // mod list $table = div(div(par("Moderators"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($mods, ["mod name", "promoted by", "time", "reason"], "table", "mod_list", [0, 1]); echo to_html($table);
<script type="text/javascript"> $(document).ready(function () { $('#preps').DataTable(); $('#preps_wrapper').css({"padding":"10px"}); }); </script> <?php // user reports $table = div(div(par("Reports about posts"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($reps, ["title", "text", "reported by", "time", "reason"], "table", "preps", [2], [], [0]); echo to_html($table);
<script type="text/javascript"> $(document).ready(function () { $('#user_log').DataTable(); $('#post_log').DataTable(); $('#comm_log').DataTable(); $('#user_log_wrapper').css({"padding":"10px"}); $('#post_log_wrapper').css({"padding":"10px"}); $('#comm_log_wrapper').css({"padding":"10px"}); }); </script> <?php // User related activities $table = div(div(par("User related actions"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($log["user"], ["username", "mod name", "action", "time", "comment"], "table", "user_log", [0, 1]); echo to_html($table); // Post related activities $table = div(div(par("Post related actions"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($log["post"], ["title", "mod name", "action", "time", "comment"], "table", "post_log", [1]); echo to_html($table); // Comment related activities $table = div(div(par("Comment related actions"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($log["comm"], ["text", "mod name", "action", "time", "comment"], "table", "comm_log", [1]); echo to_html($table);
<?php include 'db.php'; $elements = select('SELECT login as label, login as value FROM users WHERE login LIKE "' . par('term') . '%" limit 0, 10', $conn); echo json_encode($elements);
<?php include 'db.php'; $rows = select('SELECT (SELECT "disabled" FROM subscribe WHERE fromid = ' . par('fromid') . ' AND toid = t.id) AS disabled, id, login FROM users t WHERE login LIKE "' . par('term') . '%" limit ' . par('first') . ', ' . (par('first') + 10), $conn); foreach ($rows as $row) { ?> <table style="width:100%; height: 200;"> <tr> <td> <?php echo $row['login']; ?> </td> <td> <input type="button" onclick="subscribe(this, <?php echo $row['id']; ?> )"value="Подписаться" <?php echo $row['disabled']; ?> > </td> </tr> </table> <?php }
?> <!-- Comment Section --> <div class="panel panel-default well"> <div class="panel-heading"> <?php echo "<h3>"; echo "Comments (" . $post["comments"] . ")" . "<br>"; echo "</h3>"; ?> <a data-toggle="modal" data-target="#new-comm" class="btn btn-default">Add Comment</a> </div> <div class="panel-body well-lg"> <?php if (count($comms) == 0) { echo to_html(par("No comments yet.")); } else { echo to_html(build_comment_tree($comms, $mod)); } ?> </div> </div> <script> $( document ).ready(function(){ $(".downvote-active").addClass("btn-danger"); $(".upvote-active").addClass("btn-success"); $(".post-upvote").click(function() { var hasVoted = $(this).hasClass("btn-success"); $.ajax({
<?php include "funcion.php"; $n = $_POST["n"]; $r = numeros($n); $pr = primo($n, $r); $per = perfecto($n, $r); $per2 = par($n, $r); //echo "La cantida de posicion es $r";
<script type="text/javascript"> $(document).ready(function () { $('#user_log').DataTable(); $('#soc_log').DataTable(); $('#user_log_wrapper').css({"padding":"10px"}); $('#soc_log_wrapper').css({"padding":"10px"}); }); </script> <?php // User related activities $table = div(div(par("User related actions"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($log["user"], ["username", "admin name", "action", "time", "comment"], "table", "user_log", [0, 1]); echo to_html($table); // Soc related activities $table = div(div(par("Society related actions"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($log["soc"], ["society", "admin name", "action", "time", "comment"], "table", "soc_log", [1], [0]); echo to_html($table);
<script type="text/javascript"> $(document).ready(function () { $('#uchist').DataTable(); $('#uchist_wrapper').css({"padding":"10px"}); }); </script> <?php $table = div(div(par("Comment history"), "panel-heading"), "panel panel-primary"); $table["children"][] = make_table($comms, ["text", "votes", "post", "society", "time"], "table", "uchist", [], [3], [2]); echo to_html($table);
<?php include 'db.php'; if (is_array($_FILES)) { if (is_uploaded_file($_FILES['userImage']['tmp_name'])) { $sourcePath = $_FILES['userImage']['tmp_name']; $targetPath = "upload/" . $_FILES['userImage']['name']; if (move_uploaded_file($sourcePath, $targetPath)) { insert('INSERT INTO images (name, owner) VALUES ("' . $targetPath . '", ' . par('owner') . ')', $conn); echo $targetPath; } } }
<script type="text/javascript"> $(document).ready(function () { $('#pms').DataTable(); $('#pms_wrapper').css({"padding":"10px"}); }); </script> <?php $table = div(div(par("Received Messages"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($pms, ["sender", "subject", "msg", "time"], "table", "pms", [0]); echo to_html($table);
<?php include 'db.php'; $rows = select('SELECT toid FROM subscribe WHERE fromid = ' . par('fromid'), $conn); $in = ""; foreach ($rows as $row) { $in .= $row['toid'] . ', '; } $in = rtrim($in, ', '); if ($in != "") { echo json_encode(select('SELECT * FROM images WHERE owner IN (' . $in . ') ORDER BY public DESC limit 0,10', $conn)); }
<?php include 'db.php'; $id = scalar('SELECT id FROM users WHERE login="******" AND pass="******"', $conn); if ($id != null) { $_SESSION['myid'] = $id; echo $id; }
<script> $(document).ready(function() { $('#admin_list').DataTable(); $('#admin_list_wrapper').css({"padding":"10px"}); } ); </script> <?php // promote form $fdiv = div(div(par("Promote a user to admin"), "panel-heading"), "panel panel-success"); $form = make_form("admin_panel.php?view=admins", "post", "form-inline"); $form = add_field($form, "user_to_admin", "Username", true, "form-control"); $form = add_field($form, "admin_reason", "Reason for promotion", true, "form-control"); $form = add_button($form, "Admin", "btn btn-default"); $fdiv["children"][] = div(div($form, "form-group"), "panel-body"); echo to_html($fdiv); // demote form $fdiv = div(div(par("De-admin a user"), "panel-heading"), "panel panel-danger"); $form = make_form("admin_panel.php?view=admins", "post", "form-inline"); $form = add_field($form, "user_to_deadmin", "Username", true, "form-control"); $form = add_field($form, "deadmin_reason", "Reason for demotion", true, "form-control"); $form = add_button($form, "Deadmin", "btn btn-default"); $fdiv["children"][] = div(div($form, "form-group"), "panel-body"); echo to_html($fdiv); // admin list $table = div(div(par("Admins"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($admins, ["admin name", "promoted by", "time", "reason"], "table", "admin_list", [0, 1]); echo to_html($table);
<?php include 'db.php'; $subscribe = scalar('SELECT 1 FROM subscribe WHERE fromid = ' . par('fromid') . ' AND toid = ' . par('toid'), $conn); if ($subscribe != 1) { insert('INSERT INTO subscribe (fromid, toid) VALUES (' . par('fromid') . ', ' . par('toid') . ')', $conn); } echo 1;
<script type="text/javascript"> $(document).ready(function () { $('#del_posts').DataTable(); $('#del_posts_wrapper').css({"padding":"10px"}); }); </script> <?php // user reports $table = div(div(par("Deleted posts"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($posts, ["title", "text", "deleted by", "time", "comment"], "table", "del_posts", [2], [], [0]); echo to_html($table);
<script type="text/javascript"> $(document).ready(function () { $('#pms').DataTable(); $('#pms_wrapper').css({"padding":"10px"}); }); </script> <?php $table = div(div(par("Sent Messages"), "panel-heading"), "panel panel-info"); $table["children"][] = make_table($pms, ["receiver", "subject", "msg", "time"], "table", "pms"); echo to_html($table);
?> <nav class="navbar navbar-default navbar-fixed-top"> <div class="container"> <div class="navbar-header"> <a class="navbar-brand" href="index.php">What can I do for Wikimedia Commons?</a> </div> </div> </nav> <?php if (isset($_GET['new']) && !empty($_GET['new'])) { echo "<div class=\"alert alert-warning alert-dismissible fade in\" role=\"alert\"> <a href=\"find.php?nextid=0\" type=\"button\" class=\"close\" \naria-label=\"Close\"><span aria-hidden=\"true\">×</span></a> <strong>New at Wikimedia Commons?</strong> You should probably read <a href=\"https://commons.wikimedia.org/wiki/Commons:Welcome\">Commons:Welcome</a> first! :-)</div>"; } ?> <div class="jumbotron"> <h2><?php par(); ?> </h2> <br><br> <p> <a class="btn btn-lg btn-primary" href="find.php?nextid=<?php echo rand(111, 99999); ?> " role="button"><?php nb(); ?> »</a> </p> </div> <small><div style = "float: left;"><a href="index.php">home</a> | <a href="javascript:history.back()">back</a></div> <div style="text-align: right;"><?php help("<span class=\"caret\"></span> ");