function filltext($x)
{
    global $fill;
    if ($fill) {
        return html_safe(stripslashes($_POST[$x]));
    }
}
Example #2
0
function create_birth_or_death_data($bd, $sql_row)
{
    $res = '<date year="' . $sql_row[$bd . 'year'] . '" month="' . $sql_row[$bd . 'month'] . '" day="' . $sql_row[$bd . 'day'];
    if ($sql_row[$bd . 'comments'] != '') {
        $res .= '" comments="' . html_safe($sql_row[$bd . 'comments']);
    }
    $res .= "\" />\n";
    return $res;
}
Example #3
0
 function decode_line($type, $result, $inputtype)
 {
     $res = "<tr><td class='colFit'>" . $type . "</td><td>";
     if ($inputtype == 'input') {
         $res .= "<input type='text' value='" . html_safe($result) . "' ondblclick='this.select();'>";
     } else {
         $res .= "<textarea style='height:80px;min-height:80px;' ondblclick='this.select();'>" . html_safe($result) . "</textarea>";
     }
     return $res;
 }
function make_output()
{
    $out .= '$' . ssqs($_SESSION['quiz_data']['quiz_id']) . " = new Quiz(\n";
    $out .= ' "' . ssqs($_SESSION['quiz_data']['quiz_id']) . "\",\n";
    $out .= ' _("' . ssqs($_SESSION['quiz_data']['quiz_name']) . "\"),\n";
    $out .= ' _("' . ssqs($_SESSION['quiz_data']['short_quiz_name']) . "\"),\n";
    $out .= ' _("' . ssqs($_SESSION['quiz_data']['description']) . "\"),\n";
    global $forums_url;
    if ($_SESSION['quiz_data']['thread'] != '') {
        $_SESSION['quiz_data']['thread'] = str_replace($forums_url, '$forums_url', $_SESSION['quiz_data']['thread']);
    }
    $out .= ' "' . ssqs($_SESSION['quiz_data']['thread']) . "\",\n";
    $out .= " array(\n";
    $pages = array();
    foreach ($_SESSION['quiz_data']['pages'] as $quiz_page_id => $details) {
        $pages[] = '  _("' . ssqs($details) . '") => "' . ssqs($quiz_page_id) . "\"";
    }
    $out .= implode(",\n", $pages);
    $out .= "),\n";
    $out .= " array(\n  'maximum_age' => 15778463) // 6 months\n);\n";
    return html_safe($out);
}
            echo "<td>{$qd->comment}</td>\n";
        }
        echo "</tr>\n";
        $rownum++;
    }
    echo "</table>\n";
    echo "<br>\n";
} else {
    $qd = mysql_fetch_object(mysql_query("\n        SELECT *\n        FROM queue_defns\n        WHERE round_id='{$round_id}' AND name='{$name}'\n    "));
    if (!$qd) {
        die(html_safe("No such release queue '{$name}' in {$round_id}."));
    }
    $cooked_project_selector = cook_project_selector($qd->project_selector);
    $comment = $qd->comment;
    //// TRANSLATORS: %s is the name of this release queue.
    $title = sprintf(_("\"%s\" Release Queue"), html_safe($name));
    $title = preg_replace('/(\\\\)/', "", $title);
    // Unescape apostrophes, etc.
    // Suppress stats since this page is very wide
    output_header($title, NO_STATSBAR);
    echo "<br><h2>{$title}</h2>";
    if ($user_can_see_queue_settings) {
        echo "<h4>", _("project_selector"), ": {$qd->project_selector}</h4>\n\n";
        if ($cooked_project_selector != $qd->project_selector) {
            echo "({$cooked_project_selector})\n\n";
        }
        echo "<h4>{$comment}</h4>\n";
    }
    // Add Back to to Release Queues link
    echo "<p><a href='" . $code_url . "/stats/release_queue.php?round_id={$round_id}'>" . _("Back to Release Queues") . "</a></p>\n";
    $comments_url1 = mysql_escape_string("<a href='{$code_url}/project.php?id=");
Example #6
0
include_once 'menu.inc';
require_login();
$title = _("Manage biographies");
output_header($title);
abort_if_not_authors_db_manager();
if ($_SERVER['QUERY_STRING'] == '') {
    echo "<script language='JavaScript'><!--\nlocation.href='?reload';\n";
    echo "document.open();\ndocument.write('Please <a href=\"?reload\">continue</a>.');\ndocument.close();\n--></script>\n";
    echo '<noscript>Please note that you need to have JavaScript turned on in order to use this page.</noscript>';
    exit;
}
echo_menu();
echo "<h2 align='center'>{$title}</h2>";
$message = @$_GET['message'];
if (isset($message)) {
    echo '<center>' . html_safe($message) . '</center><br />';
}
if (isset($_POST) && count($_POST) > 0) {
    // find out what to do -- store in different 'queues'
    $delete_bios = array();
    $move_bios = array();
    $delete_authors = array();
    $enable_author_values = array();
    $enable_author_ids = array();
    if (isset($_POST['move_to_author'])) {
        $moveTo = $_POST['move_to_author'];
    }
    // loop through posted data, see what the field names start with, save ids in arrays
    reset($_POST);
    while (list($key, $val) = each($_POST)) {
        if (strpos($key, 'delete_bio_') !== false) {
Example #7
0
function do_postcomments()
{
    global $project, $code_url;
    if ($project->state != PROJ_POST_FIRST_CHECKED_OUT) {
        return;
    }
    $projectid = $project->projectid;
    if ($project->PPer_is_current_user) {
        echo "<h4>" . _("Post-Processor's Comments") . "</h4>";
        echo_postcomments_instructions();
        echo "<form name='pp_update' method='post' action='{$code_url}/tools/post_proofers/postcomments.php'>\n";
        echo "<textarea name='postcomments' cols='60' rows='6'>\n";
        echo html_safe($project->postcomments);
        echo "</textarea>\n";
        echo "<input type='hidden' name='projectid' value='{$projectid}' />\n";
        echo "<br /><input type='submit' value='" . attr_safe(_('Update comment and project status')) . "'/>";
        echo "</form>\n";
    }
}
Example #8
0
function dropdown_select_values_and_labels($field_name, $current_value, $values, $labels, $on_change = '')
{
    global $event_id, $window_onload_event;
    $function_name = 'event' . ++$event_id;
    $jscode = "var f=document.forms[0];\nvar t=f.{$field_name};\n{$on_change}";
    echo "<script type='text/javascript'><!--\nfunction {$function_name}() { {$jscode} }\n--></script>\n";
    echo "<select name='{$field_name}' ID='{$field_name}' onChange=\"{$function_name}()\">";
    for ($i = 0; $i < count($values); $i++) {
        echo "<option value='{$values[$i]}'";
        if ($current_value == $values[$i]) {
            echo " SELECTED";
        }
        echo ">" . html_safe($labels[$i]) . "</option>";
    }
    echo "</select>";
    $window_onload_event .= "{$function_name}();\n";
}
function confirm_is_local($type, $item_name)
{
    global $curr_abspath, $hce_curr_displaypath;
    assert($type == 'F' || $type == 'D' || $type == 'FD');
    // NB this catches $item_name == NULL too
    if ($item_name == '') {
        fatal_error(_("Item name must not be empty."));
    }
    if (strpos($item_name, '/') !== FALSE) {
        fatal_error(_("Item name must not contain a slash character"));
    }
    $src_path = "{$curr_abspath}/{$item_name}";
    // Note that 'file_exists', despite the name, doesn't require
    // that its arg identify a file (as opposed to a directory).
    if (!file_exists($src_path)) {
        fatal_error(sprintf(_('folder %1$s does not have an item named %2$s'), $hce_curr_displaypath, html_safe($item_name)));
    }
    if ($type == 'FD') {
        return;
    }
    if ($type == 'F') {
        $exists = is_file($src_path);
        $msg = _("%s exists, but is not a file");
    } else {
        if ($type == 'D') {
            $exists = is_dir($src_path);
            $msg = _("%s exists, but is not a folder");
        } else {
            assert(FALSE);
        }
    }
    if (!$exists) {
        fatal_error(sprintf($msg, html_safe($item_name)));
    }
}
if (isset($_POST["username"]) && $_POST["username"] != "---") {
    $username = mysql_real_escape_string($_POST["username"]);
    $filter = "`username`='" . $username . "'";
    $smarty->assign("username_checked", $username);
}
if (isset($_POST["action"]) && $_POST["action"] != "---") {
    $action = mysql_real_escape_string($_POST["action"]);
    $filter .= $filter ? " AND " : "";
    $filter .= "`action`='" . $action . "'";
    $smarty->assign("action_checked", $action);
}
$logs = sql_get_logs($filter);
$smarty->assign("logs", $logs);
//get all usernames
$query = mysql_query("SELECT * FROM `" . $config->db_prefix . "_logs` GROUP BY `username` ORDER BY `id`") or die(mysql_error());
$usernames["---"] = "---";
while ($result = mysql_fetch_object($query)) {
    if ($result->username != "") {
        $usernames[html_safe($result->username)] = html_safe($result->username);
    }
}
$smarty->assign("usernames", $usernames);
//get all actions
$query = mysql_query("SELECT * FROM `" . $config->db_prefix . "_logs` GROUP BY `action` ORDER BY `id`") or die(mysql_error());
$actions["---"] = "---";
while ($result = mysql_fetch_object($query)) {
    if ($result->action != "") {
        $actions[html_safe($result->action)] = html_safe($result->action);
    }
}
$smarty->assign("actions", $actions);
Example #11
0
<?php

$error = @ob_get_contents();
$error_html = !empty($error) ? "<pre class='phpError border'>" . str_replace("\n\n", "\n", html_safe($error)) . "</pre>" : "";
@ob_end_clean();
error_reporting(0);
@ini_set('display_errors', '0');
?>
<!doctype html>
<html>
<head>
<title><?php 
echo $GLOBALS['title'] . " " . $GLOBALS['ver'];
?>
</title>
<meta charset='utf-8'>
<meta name='robots' content='noindex, nofollow, noarchive'>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, user-scalable=0">
<link rel='SHORTCUT ICON' href='<?php 
echo get_resource('b374k');
?>
'>
<style type="text/css">
<__CSS__>
#navigation{position:fixed;left:-16px;top:46%;}
#totop,#tobottom,#toggleBasicInfo{background:url('<?php 
echo get_resource('arrow');
?>
');width:32px;height:32px;opacity:0.30;margin:18px 0;cursor:pointer;}
#totop:hover,#tobottom:hover{opacity:0.80;}
#toggleBasicInfo{display:none;float:right;margin:0;}
 /**
  * @param string $new_tag
  */
 private function flushGroup($new_tag)
 {
     if ($this->group !== '') {
         if ($this->tag == 'ins') {
             $this->line .= "<ins{$this->insClass}>" . html_safe($this->group) . '</ins>';
         } elseif ($this->tag == 'del') {
             $this->line .= "<del{$this->delClass}>" . html_safe($this->group) . '</del>';
         } else {
             $this->line .= html_safe($this->group);
         }
     }
     $this->group = '';
     $this->tag = $new_tag;
 }
Example #13
0
            $query = "INSERT INTO authors " . "(last_name, other_names, byear, bmonth, bday, dyear, dmonth, dday, bcomments, dcomments, enabled)\n" . "VALUES('{$last_name}', '{$other_names}', {$date_fields_str} '', '', 'no')";
            if ($simulating) {
                echo "<font color='red'>    " . _("The following query would have been run:") . "\n      " . str_replace("\n", "\n      ", html_safe($query)) . "</font>\n";
                $author_id = '#new author id#';
            } else {
                $store_result = mysql_query($query);
                if (!$store_result) {
                    echo '    ' . _("An error occurred while saving the author:") . ' ' . mysql_error() . "\n";
                    exit;
                }
                $author_id = mysql_insert_id();
                echo '    ' . sprintf(_("The author was inserted into the database with the id %d."), $author_id) . "\n";
            }
            $query = "INSERT INTO biographies " . "(author_id, bio) " . "VALUES({$author_id}, '{$bio}');";
            if ($simulating) {
                echo "<font color='blue'>    " . _("The following query would have been run:") . "\n      " . str_replace("\n", "\n      ", html_safe($query)) . "</font>\n";
            } else {
                $store_result = mysql_query($query);
                if (!$store_result) {
                    echo '    ' . _("An error occurred while saving the biography:") . ' ' . mysql_error() . "\n";
                    exit;
                }
                echo '    ' . sprintf(_("The biography was inserted into the database with the id %d."), mysql_insert_id()) . "\n\n";
            }
        }
    }
    echo "\n" . _("Done. All projects searched.");
}
function ensure_digits($digits_or_question_mark)
{
    return $digits_or_question_mark == '?' ? 0 : $digits_or_question_mark;
Example #14
0
        output($counter);
    }
    output('error');
} elseif (isset($p['viewFileorFolder'])) {
    $entry = $p['viewFileorFolder'];
    if (is_file($entry)) {
        output('file');
    } elseif (is_dir($entry)) {
        output('folder');
    }
    output('error');
} elseif (isset($p['terminalInput'])) {
    output(html_safe(execute($p['terminalInput'])));
} elseif (isset($p['evalInput']) && isset($p['evalType'])) {
    $evalInput = $p['evalInput'];
    $evalOptions = isset($p['evalOptions']) ? $p['evalOptions'] : "";
    $evalArguments = isset($p['evalArguments']) ? $p['evalArguments'] : "";
    $evalType = $p['evalType'];
    error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
    @ini_set('html_errors', '0');
    @ini_set('display_errors', '1');
    @ini_set('display_startup_errors', '1');
    $res = eval_go($evalType, $evalInput, $evalOptions, $evalArguments);
    if ($res === false) {
        $res == "error";
    }
    output(html_safe($res));
} elseif (isset($p['evalGetSupported'])) {
    $res = eval_get_supported();
    output($res);
}
    echo html_safe($row['display_name']) . "</a>";
    echo "</td>\n";
    echo "<td style='background-color: #" . $row['color'] . ";'>";
    echo "<div title=\"" . html_safe($row['comment']) . "\">";
    echo html_safe($row['comment']) . "</div></td>\n";
    echo "<td class='center'>";
    if ($current_month != 0) {
        echo html_safe($row['open_day']);
    } else {
        echo _("N/A");
    }
    // Translators: N/A = "Not applicable"
    echo "</td>\n";
    echo "<td>";
    echo "<a href='" . $row['info_url'] . "'>";
    echo html_safe($row['info_url']) . "</a></td>\n";
    echo "</tr>\n";
}
echo "</table>";
echo "<br>\n";
// =============================================================================
function output_column_headers()
{
    echo "<tr>";
    echo "<th>" . _("Name") . "</th>";
    echo "<th>" . _("Comment") . "</th>";
    echo "<th>" . _("Start Day") . "</th>";
    echo "<th>" . _("More Info") . "</th>";
    echo "</tr>\n";
}
// vim: sw=4 ts=4 expandtab
            $smsg = "";
        }
    }
}
//save server settings
if (isset($_POST["save"])) {
    $query = mysql_query("UPDATE `" . $config->db_prefix . "_serverinfo` SET \n\t\t\t\t\t`rcon`='" . sql_safe($_POST["rcon"]) . "',\n\t\t\t\t\t`amxban_motd`='" . sql_safe($_POST["amxban_motd"]) . "',\n\t\t\t\t\t`motd_delay`='" . (int) $_POST["motd_delay"] . "',\n\t\t\t\t\t`amxban_menu`='" . (int) $_POST["amxban_menu"] . "',\n\t\t\t\t\t`reasons`='" . (int) $_POST["reasons"] . "',\n\t\t\t\t\t`timezone_fixx`='" . (int) $_POST["timezone_fixx"] . "'\n\t\t\t\t\tWHERE `id`=" . $sid . " LIMIT 1") or die(mysql_error());
    $user_msg = '_SERVERSAVED';
    log_to_db("Server config", "Edited server: " . html_safe($_POST["sidname"]));
}
//delete server from db
if (isset($_POST["del"])) {
    $query = mysql_query("DELETE FROM `" . $config->db_prefix . "_serverinfo` WHERE `id`=" . $sid . " LIMIT 1") or die(mysql_error());
    $query = mysql_query("DELETE FROM `" . $config->db_prefix . "_admins_servers` WHERE `server_id`=" . $sid) or die(mysql_error());
    $user_msg = '_SERVERDELETED';
    log_to_db("Server config", "Deleted server: " . html_safe($_POST["sidname"]));
}
//get servers
$servers = sql_get_server();
//get reason sets
$query = mysql_query("SELECT * FROM `" . $config->db_prefix . "_reasons_set` ORDER BY `setname` ASC") or die(mysql_error());
$reasons_values = array("");
$reasons_choose = array("");
while ($result = mysql_fetch_object($query)) {
    $reasons_values[] = $result->id;
    $reasons_choose[] = $result->setname;
}
$timezone_values = array(-12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12);
$timezone_output = array("-12", "-11", "-10", "-9", "-8", "-7", "-6", "-5", "-4", "-3", "-2", "-1", "0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+10", "+11", "+12");
$delay_choose = array(2, 3, 4, 5, 7, 10);
$menu_choose = array(0, 1);
            $line_wrap = $userP['v_twrap'];
        } else {
            $font_face_i = $userP['h_fntf'];
            $font_size_i = $userP['h_fnts'];
            $line_wrap = $userP['h_twrap'];
        }
        $font_face = $proofreading_font_faces[$font_face_i];
        $font_size = $proofreading_font_sizes[$font_size_i];
        // Since this page doesn't have a vertical layout version,
        // we'll use their horizontal prefs for textarea size
        $n_cols = $userP['h_tchars'];
        $n_rows = $userP['h_tlines'];
        echo "<textarea\n            name='text_data'\n            id='text_data'\n            cols='{$n_cols}'\n            rows='{$n_rows}'\n            style='";
        if ($font_face != '') {
            echo "font-family: {$font_face};";
            echo " ";
        }
        if ($font_size != '') {
            echo "font-size: {$font_size};";
        }
        echo "padding-left: 0.25em;' ";
        if (!$line_wrap) {
            echo "wrap='off' ";
        }
        echo ">\n";
        echo html_safe($data);
        echo "</textarea>";
    }
    exit;
}
// vim: sw=4 ts=4 expandtab
 /**
  * Writes all lines to the output buffer, each enclosed in <tr>.
  *
  * @param string[] $lines
  */
 protected function context($lines)
 {
     foreach ($lines as $line) {
         echo '<tr>' . $this->contextLine(html_safe($line)) . $this->contextLine(html_safe($line)) . "</tr>\n";
     }
 }
function _project_link($projectid, $title)
{
    global $code_url;
    return "<a href=\"{$code_url}/project.php" . "?id={$projectid}\" target='_blank'>" . html_safe($title) . "</a>\n";
}
Example #20
0
                     }
                     $res .= "</tr>";
                     while ($rows = sql_fetch_data($type, $query_query)) {
                         $res .= "<tr>";
                         foreach ($rows as $r) {
                             if (empty($r)) {
                                 $r = " ";
                             }
                             $res .= "<td>" . html_safe($r) . "</td>";
                         }
                         $res .= "</tr>";
                     }
                     $res .= "</table>";
                 }
             } else {
                 $res .= "<p>" . html_safe($query) . ";&nbsp;&nbsp;&nbsp;<span class='strong'>[</span> error <span class='strong'>]</span></p>";
             }
         }
     }
 } else {
     if ($type != 'pdo' && $type != 'odbc') {
         if ($type == 'mysql') {
             $showdb = "SHOW DATABASES";
         } elseif ($type == 'mssql') {
             $showdb = "SELECT name FROM master..sysdatabases";
         } elseif ($type == 'pgsql') {
             $showdb = "SELECT schema_name FROM information_schema.schemata";
         } elseif ($type == 'oracle') {
             $showdb = "SELECT USERNAME FROM SYS.ALL_USERS ORDER BY USERNAME";
         } elseif ($type == 'sqlite3' || $type == 'sqlite') {
             $showdb = "SELECT \"" . $host . "\"";
Example #21
0
        }
        return false;
    }
}
if (isset($p['mailFrom']) && isset($p['mailTo']) && isset($p['mailSubject']) && isset($p['mailContent'])) {
    $mailFrom = trim($p['mailFrom']);
    $mailTo = trim($p['mailTo']);
    $mailSubject = trim($p['mailSubject']);
    $mailContent = trim($p['mailContent']);
    $mailAttachment = trim($p['mailAttachment']);
    $mailAttachment = !empty($mailAttachment) ? explode("{[|b374k|]}", $p['mailAttachment']) : array();
    if (empty($mailTo)) {
        output("Please specify at least one recipient");
    }
    if (!empty($mailFrom)) {
        $mailFrom = "From: " . $mailFrom . "\r\nReply-To: " . $mailFrom . "\r\n";
    }
    foreach ($mailAttachment as $file) {
        $file = trim($file);
        if (empty($file)) {
            continue;
        }
        if (!is_file($file)) {
            output("No such file : " . $file);
        }
    }
    if (send_email($mailFrom, $mailTo, $mailSubject, $mailContent, $mailAttachment)) {
        output("Mail sent to " . html_safe($mailTo));
    }
    output("Failed to send mail");
}
Example #22
0
    $packetContent = $p['packetContent'];
    if (ctype_xdigit($packetContent)) {
        $packetContent = @pack("H*", $packetContent);
    } else {
        $packetContent = str_replace(array("\r", "\n"), "", $packetContent);
        $packetContent = str_replace(array("\\r", "\\n"), array("\r", "\n"), $packetContent);
    }
    $res = "";
    $sock = fsockopen($packetHost, $packetPort, $errNo, $errStr, $packetTimeout);
    if (!$sock) {
        $res .= "<div class='weak'>";
        $res .= html_safe(trim($errStr)) . " (error " . html_safe(trim($errNo)) . ")</div>";
    } else {
        stream_set_timeout($sock, $packetSTimeout);
        fwrite($sock, $packetContent . "\r\n\r\n");
        $counter = 0;
        $maxtry = 1;
        $bin = "";
        do {
            $line = fgets($sock, 1024);
            if (trim($line) == "") {
                $counter++;
            }
            $bin .= $line;
        } while ($counter < $maxtry);
        fclose($sock);
        $res .= "<table class='boxtbl'><tr><td><textarea style='height:140px;min-height:140px;'>" . html_safe($bin) . "</textarea></td></tr>";
        $res .= "<tr><td><textarea style='height:140px;min-height:140px;'>" . bin2hex($bin) . "</textarea></td></tr></table>";
    }
    output($res);
}
Example #23
0
function show_path($dir)
{
    echo '<a href="?gallery=/" title="Index">Index</a>';
    $link = '';
    $full_path = '';
    if ($dir != '') {
        $path = explode('/', $dir);
        foreach ($path as $step) {
            $link .= $step . '/';
            // last step, assemble and apply gallery_link
            $full_path .= ' / <a href="?gallery=' . link_safe(gallery_link($link)) . '" title="' . link_safe($step) . '">' . html_safe($step) . '</a>';
        }
    }
    echo $full_path;
}
 function show_processes()
 {
     $output = '';
     $wcount = 11;
     if (is_win()) {
         $cmd = "tasklist /V /FO csv";
         $wexplode = "\",\"";
     } else {
         $cmd = "ps aux";
         $wexplode = " ";
     }
     $res = execute($cmd);
     if (trim($res) == '') {
         return false;
     } else {
         $output .= "<table id='psTable' class='dataView sortable'>";
         if (!is_win()) {
             $res = preg_replace('#\\ +#', ' ', $res);
         }
         $psarr = explode("\n", $res);
         $fi = true;
         $tblcount = 0;
         $check = explode($wexplode, $psarr[0]);
         $wcount = count($check);
         foreach ($psarr as $psa) {
             if (trim($psa) != '') {
                 if ($fi) {
                     $fi = false;
                     $psln = explode($wexplode, $psa, $wcount);
                     $output .= "<tr><th class='col-cbox sorttable_nosort'><div class='cBoxAll'></div></th><th class='sorttable_nosort'>action</th>";
                     foreach ($psln as $p) {
                         $output .= "<th>" . trim(trim(strtolower($p)), "\"") . "</th>";
                     }
                     $output .= "</tr>";
                 } else {
                     $psln = explode($wexplode, $psa, $wcount);
                     $pid = trim(trim($psln[1]), "\"");
                     $tblcount = 0;
                     $output .= "<tr data-pid='" . $pid . "'>";
                     foreach ($psln as $p) {
                         if (trim($p) == "") {
                             $p = " ";
                         }
                         $p = trim(trim($p), "\"");
                         $p = html_safe($p);
                         if ($tblcount == 0) {
                             $output .= "<td><div class='cBox'></div></td><td><a class='kill'>kill</a></td><td>" . $p . "</td>";
                             $tblcount++;
                         } else {
                             $tblcount++;
                             if ($tblcount == count($psln)) {
                                 $output .= "<td style='text-align:left;'>" . $p . "</td>";
                             } else {
                                 $output .= "<td style='text-align:center;'>" . $p . "</td>";
                             }
                         }
                     }
                     $output .= "</tr>";
                 }
             }
         }
         $colspan = count($psln) + 1;
         $colspanAll = $colspan + 1;
         $output .= "<tfoot><tr><td><div class='cBoxAll'></div></td><td colspan=" . $colspan . " style='text-align:left;'><span class='button' onclick='kill_selected();' style='margin-right:8px;'>kill selected</span><span class='button' onclick='show_processes();'>refresh</span><span class='psSelected'></span></td></tr></tfoot></table>";
     }
     return $output;
 }
Example #25
0
}
if ($prev_next_links != '') {
    echo "<p align='center'>{$prev_next_links}</p>";
}
// table of search results
echo '<table align="center" border="1"><tr>';
// print headers
// links to allow (asc/desc) sorting
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_author_id) . "'>" . _("ID") . "</a></th>\n";
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_last_name) . "'>" . _("Last name") . "</a></th>\n";
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_other_names) . "'>" . _("Other name(s)") . "</a></th>\n";
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_born) . "'>" . _("Born") . "</a></th>\n";
echo "<th><a href='listing.php?{$query}" . $sortUtility->getQueryStringForSortableValue($sort_dead) . "'>" . _("Deceased") . "</a></th>\n";
if ($can_edit) {
    echo "<th>" . _("Edit") . "</th>\n";
}
echo "\n";
$count = $browseUtility->getRowCountToList();
$i = 0;
while ($i++ < $count && ($row = @mysql_fetch_array($result))) {
    $id = $row['author_id'];
    echo "<tr><td>{$id}</td><td><a href=\"author.php?author_id={$id}\">" . html_safe($row['last_name']) . "</a></td><td>" . html_safe($row['other_names']) . "</td><td>" . format_date_from_array($row, 'b') . '</td><td>' . format_date_from_array($row, 'd') . '</td>' . ($can_edit ? "<td><a href='add.php?author_id={$id}'>" . _('Edit') . '</a></td>' : '') . "</tr>\n";
}
echo '</table>';
if ($prev_next_links != '') {
    echo "<p align='center'>{$prev_next_links}</p>";
}
echo '<br />';
$browseUtility->echoCountSelectionList();
echo_menu();
// vim: sw=4 ts=4 expandtab
     if (in_array($word, $project_bad_words)) {
         $notes[] = _("On project BWL");
     }
     if (in_array($word, $project_good_words)) {
         $notes[] = _("On project GWL");
     }
     if (count($notes)) {
         $word_notes[$word] = implode(", ", $notes);
     }
 }
 $context_array["[[TITLE]]"] = _("Show Context");
 $word_notes["[[TITLE]]"] = _("Notes");
 $word_checkbox = build_checkbox_array($words_w_freq);
 $checkbox_form["projectid"] = $projectid;
 $checkbox_form["freqCutoff"] = $freqCutoff;
 $checkbox_form["queryWordText"] = html_safe($queryWordText);
 echo_checkbox_form_start($checkbox_form);
 echo "<p>" . _("Words can be added to either the Good or the Bad word list. Select which of the project's lists to add the words to.") . "</p>";
 echo "<input type='radio' name='wordlisttarget' value='good'";
 if ($wordListTarget == "good") {
     echo " checked";
 }
 echo "> ";
 echo _("Good Words List") . "<br>";
 echo "<input type='radio' name='wordlisttarget' value='bad'";
 if ($wordListTarget == "bad") {
     echo " checked";
 }
 echo "> ";
 echo _("Bad Words List") . "<br>";
 echo_checkbox_selects(count($words_w_freq));
Example #27
0
 function comment_box($id)
 {
     global $action;
     if ($action == SHOW_BLANK_ENTRY_FORM) {
         $text = '';
     } else {
         if ($action == HANDLE_ENTRY_FORM_SUBMISSION) {
             $text = $_POST[$id];
         }
     }
     $esc_text = html_safe($text);
     return "" . "<textarea rows='4' cols='67' name='{$id}' id='{$id}' wrap='hard'>{$esc_text}</textarea>" . "<br />" . "<div class='shrinker'>" . "<a onclick='grow_textarea(\"{$id}\")'>+</a>" . "&nbsp;" . "<a onclick='shrink_textarea(\"{$id}\")'>&minus;</a>" . "</div>";
 }
        $name = mysql_real_escape_string($_POST["username"]);
        //add new amxxadmin to db
        $query = mysql_query("INSERT INTO `" . $config->db_prefix . "_amxadmins` \n\t\t\t\t\t\t\t(`username`,`password`,`access`,`flags`,`steamid`,`nickname`,`ashow`,`created`,`expired`,`days`) \n\t\t\t\t\t\t\tVALUES (\n\t\t\t\t\t\t\t'" . $username . "',\n\t\t\t\t\t\t\t'" . $password . "',\n\t\t\t\t\t\t\t'" . $access . "',\n\t\t\t\t\t\t\t'" . $flags . "',\n\t\t\t\t\t\t\t'" . $steamid . "',\n\t\t\t\t\t\t\t'" . $nickname . "',\n\t\t\t\t\t\t\t" . (int) $_POST["ashow"] . ",\n\t\t\t\t\t\t\tUNIX_TIMESTAMP(),\n\t\t\t\t\t\t\t" . $exp . "\n\t\t\t\t\t\t\t" . $days . "\n\t\t\t\t\t\t\t)") or die(mysql_error());
        //add as admin to selected servers
        $adminid = mysql_insert_id();
        $addtoserver = $_POST["addtoserver"];
        $sban = mysql_real_escape_string($_POST["staticbantime"]);
        if (is_array($addtoserver)) {
            foreach ($addtoserver as $k => $v) {
                $query = mysql_query("INSERT INTO `" . $config->db_prefix . "_admins_servers` \n\t\t\t\t\t\t\t(`admin_id`,`server_id`,`custom_flags`,`use_static_bantime`) \n\t\t\t\t\t\t\tVALUES \n\t\t\t\t\t\t\t('" . $adminid . "','" . $v . "','','" . $sban . "')\n\t\t\t\t\t\t\t") or die(mysql_error());
            }
        }
        $user_msg[] = '_AMXADMINADDED';
        log_to_db("AMXXAdmin config", "Added admin: " . $name);
    } else {
        $input = array("username" => html_safe($username), "password" => $password, "access" => $access, "flags" => $flags, "steamid" => $steamid, "nickname" => html_safe($nickname), "ashow" => (int) $_POST["ashow"], "days" => $_POST["days"], "moredays" => (int) $_POST["moredays"], "noend" => isset($_POST["noend"]) ? 1 : 0);
        $smarty->assign("input", $input);
    }
}
//amxadmins holen
$admins = sql_get_amxadmins();
//server holen
$servers = sql_get_server();
if (is_array($servers)) {
    foreach ($servers as $k => $v) {
        $svalues[] = $v["sid"];
        $soutput[] = $v["hostname"];
    }
}
$smarty->assign("yesno_choose", array("yes", "no"));
$smarty->assign("yesno_output", array("_YES", "_NO"));
    foreach ($word_suggestions as $suggestion) {
        list($time, $round, $page, $proofer, $words) = $suggestion;
        // get a context string
        list($context_strings, $totalLines) = _get_word_context_on_page($projectid, $page, $round, $word);
        # If the word was suggested on a page, but then changed before
        # being saved, let the PM know about it.
        if (!count($context_strings)) {
            echo "<p>" . sprintf(_('The word was suggested in round %1$s for page %2$s, but no longer exists in the saved text for that round.'), $round, $page) . "</p>";
            continue;
        }
        echo "<p><b>" . _("Date") . "</b>: " . strftime($datetime_format, $time) . "<br>";
        echo "<b>" . _("Round") . "</b>: {$round} &nbsp; | &nbsp; ";
        echo "<b>" . _("Proofreader") . "</b>: " . private_message_link($proofer) . "<br>";
        echo "<b>" . _("Page") . "</b>: <a href='displayimage.php?project={$projectid}&amp;imagefile={$page}&amp;showreturnlink=0' target='imageframe'>{$page}</a><br>";
        foreach ($context_strings as $lineNum => $context_string) {
            $context_string = _highlight_word(html_safe($context_string, ENT_NOQUOTES), $word);
            echo "<b>" . _("Line") . "</b>: ", sprintf(_('~%1$d of %2$d'), $lineNum, $totalLines), " &nbsp; | &nbsp; ";
            echo "<b>" . _("Context") . "</b>:<br><span class='mono'>{$context_string}</span><br>";
        }
        echo "</p>";
        echo "<hr>";
    }
    exit;
}
if ($frame == "right") {
    slim_header(_("Image Frame"));
    echo "<p>" . _("Select one of the page links to view the page image (scan).") . "</p>";
    exit;
}
function _get_word_context_on_page($projectid, $page, $round, $word)
{
Example #30
0
function show_item_editor($news_page_id)
{
    if (isset($_GET['action']) && $_GET['action'] == "edit") {
        $item_id = get_integer_param($_GET, 'item_id', null, null, null);
        $result = mysql_query("SELECT * FROM news_items WHERE id={$item_id}");
        $initial_content = mysql_result($result, 0, "content");
        $action_to_request = "edit_update";
        $submit_button_label = _("Edit News Item");
    } else {
        $item_id = "";
        $initial_content = "";
        $action_to_request = "add";
        $submit_button_label = _("Add News Item");
    }
    echo "<form action='sitenews.php?news_page_id={$news_page_id}&action={$action_to_request}' method='post'>";
    echo "<center>";
    echo "<textarea name='content' cols='80' rows='8'>" . html_safe($initial_content) . "</textarea>";
    echo "<br>\n";
    echo "<input type='submit' value='{$submit_button_label}' name='submit'>";
    echo "</center>";
    echo "<br>\n";
    echo "<br>\n";
    echo "<input type='hidden' name='item_id' value='{$item_id}'>";
    echo "</form>";
}