$difficulty_options = array('' => _('any'), 'beginner' => _('Beginner'), 'easy' => _('Easy'), 'average' => _('Average'), 'hard' => _('Hard'));
// ---------
$state_options[''] = _('any state');
foreach ($PROJECT_STATES_IN_ORDER as $proj_state) {
    $state_options[$proj_state] = project_states_text($proj_state);
}
// ---------
define('DEFAULT_N_RESULTS_PER_PAGE', 100);
$widgets = array(new Widget(array('id' => 'title', 'label' => _('Title'), 'type' => 'text', 'q_part' => 'WHERE', 'q_contrib' => array('nameofwork', 'LIKE'))), new Widget(array('id' => 'author', 'label' => _('Author'), 'type' => 'text', 'q_part' => 'WHERE', 'q_contrib' => array('authorsname', 'LIKE'))), new Widget(array('id' => 'language', 'label' => _('Language'), 'type' => 'select', 'options' => $lang_options, 'can_be_multiple' => TRUE, 'initial_value' => '', 'q_part' => 'WHERE', 'q_contrib' => array('language', 'LIKE'))), new Widget(array('id' => 'genre', 'label' => _('Genre'), 'type' => 'select', 'options' => $genre_options, 'can_be_multiple' => TRUE, 'q_part' => 'WHERE', 'q_contrib' => array('genre', '='))), new Widget(array('id' => 'difficulty', 'label' => _('Difficulty'), 'type' => 'select', 'options' => $difficulty_options, 'can_be_multiple' => TRUE, 'q_part' => 'WHERE', 'q_contrib' => array('difficulty', '='))), new Widget(array('id' => 'special_day', 'label' => _('Special day'), 'type' => 'select', 'options' => $special_day_options, 'can_be_multiple' => TRUE, 'initial_value' => '', 'q_part' => 'WHERE', 'q_contrib' => array('special_code', '='))), new Widget(array('id' => 'projectid', 'label' => _('Project ID'), 'type' => 'text', 'size' => 45, 'can_be_multiple' => TRUE, 'separator' => '[\\s,;]+', 'q_part' => 'WHERE', 'q_contrib' => array('projectid', 'LIKE'))), new Widget(array('id' => 'project_manager', 'label' => _('Project Manager'), 'type' => 'text', 'q_part' => 'WHERE', 'q_contrib' => array('username', 'LIKE'))), new Widget(array('id' => 'checkedoutby', 'label' => _('Checked Out By'), 'type' => 'text', 'q_part' => 'WHERE', 'q_contrib' => array('checkedoutby', 'LIKE'))), new Widget(array('id' => 'pp_er', 'label' => _('Post-processor'), 'type' => 'text', 'q_part' => 'WHERE', 'q_contrib' => array('postproofer', 'LIKE'))), new Widget(array('id' => 'ppv_er', 'label' => _('Post-processing Verifier'), 'type' => 'text', 'q_part' => 'WHERE', 'q_contrib' => array('ppverifier', 'LIKE'))), new Widget(array('id' => 'postednum', 'label' => _('PG etext number'), 'type' => 'text', 'can_be_multiple' => TRUE, 'separator' => '[\\s,;]+', 'q_part' => 'WHERE', 'q_contrib' => array('postednum', '='))), new Widget(array('id' => 'state', 'label' => _('State'), 'type' => 'select', 'options' => $state_options, 'can_be_multiple' => TRUE, 'q_part' => 'WHERE', 'q_contrib' => array('state', '='))), new Widget(array('id' => 'n_results_per_page', 'label' => _('Number of results per page'), 'type' => 'select', 'options' => array(30 => 30, 100 => 100, 300 => 300), 'can_be_multiple' => FALSE, 'initial_value' => DEFAULT_N_RESULTS_PER_PAGE, 'q_part' => 'LIMIT', 'q_contrib' => '{VALUE}')));
// -----------------------------------------------------------------------------
if (user_is_PM() && empty($_GET['show']) && empty($_GET['up_projectid'])) {
    if ($userP['i_pmdefault'] == 0) {
        metarefresh(0, "projectmgr.php?show=user_all", "", "");
        exit;
    } elseif ($userP['i_pmdefault'] == 1) {
        metarefresh(0, "projectmgr.php?show=user_active", "", "");
        exit;
    }
}
output_header(_("Project Search"), NO_STATSBAR);
$PROJECT_IS_ACTIVE_sql = "(state NOT IN ('" . PROJ_SUBMIT_PG_POSTED . "','" . PROJ_DELETE . "'))";
if (!isset($_GET['show']) && !isset($_GET['up_projectid']) || $_GET['show'] == 'search_form' || $_GET['show'] == '' && $_GET['up_projectid'] == '') {
    echo_manager_header();
    // New proofreaders are having a hard time finding stuff because they
    // end up on the Project Search page instead of the starting round page.
    // See if we can't help them out by pointing them to the starting
    // round page.
    $pagesproofed = get_pages_proofed_maybe_simulated();
    if ($pagesproofed < 100) {
        echo "<div class='callout'>";
        echo "<div class='calloutheader'>";
<?php

$relPath = '../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'metarefresh.inc';
// The contents of this file have been moved to the pgdp.net wiki.
metarefresh(0, "http://www.pgdp.net/wiki/DP_Code_Development");
// vim: sw=4 ts=4 expandtab
// Translated by user babymag 18 Feb 2009
$relPath = '../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'faq.inc';
include_once $relPath . 'pg.inc';
include_once $relPath . 'theme.inc';
include_once $relPath . 'metarefresh.inc';
include_once $relPath . 'misc.inc';
// undo_all_magic_quotes()
undo_all_magic_quotes();
# SITE-SPECIFIC
# Redirect users to this document in the wiki
if (strpos($code_url, '://www.pgdp.')) {
    $url = 'http://www.pgdp.net/wiki/DP_Official_Documentation:Formatting/Italian/Regole_di_Formattazione';
    metarefresh(0, $url);
}
$theme_args["css_data"] = "p.backtotop {text-align:right; font-size:75%;margin-right:-5%;}";
output_header('Regole di Formattazione', NO_STATSBAR, $theme_args);
?>

<!-- NOTE TO MAINTAINERS AND DEVELOPERS:

     There are now HTML comments interspersed in this document which are/will be
     used by a script which automagically slices out the Random Rule text for the
     database. It does this by copying:
       1) All text from one h_3 to the next h_3
          -OR-
       2) All text from h_3 to the END_RR comment line.

    This allows us to have "extra" information in the Guidelines, but leave it out
Example #4
0
<?php

//clear cookie if one is already set
$relPath = './../pinc/';
include_once $relPath . 'base.inc';
include_once $relPath . 'metarefresh.inc';
include_once $relPath . 'forum_interface.inc';
if ($user_is_logged_in) {
    logout_forum_user();
    dpsession_end();
}
metarefresh(0, "../default.php", _("Logout Complete"), "<a href=\"../default.php\">" . _("Return to DP Home Page.") . "</a>");
// vim: sw=4 ts=4 expandtab
Example #5
0
            // Set the first remaining available profile to be active.
            $result = mysql_query("SELECT * FROM user_profiles WHERE  u_ref={$uid}");
            $new_profile_name = mysql_result($result, 0, "profilename");
            $new_profile_id = mysql_result($result, 0, "id");
            echo sprintf(_("Active usersettings profile is now: %s"), $new_profile_name) . "\n<br>\n";
            mysql_query(sprintf("\n        UPDATE users\n        SET u_profile='{$new_profile_id}'\n        WHERE u_id='{$uid}' AND username='******'", mysql_real_escape_string($pguser)));
            // Reload preferences to reflect changed active profile.
            dpsession_set_preferences_from_db();
            // Bounce user back to the proofreading preferences tab.
            $selected_tab = 1;
            $url = "{$code_url}/userprefs.php?tab={$selected_tab}&amp;origin=" . urlencode($origin);
            metarefresh(3, $url, _('Delete profile'), _('Reloading current tab....'));
        } else {
            // Show the same tab that was just saved
            $url = "{$code_url}/userprefs.php?tab={$selected_tab}&amp;origin=" . urlencode($origin);
            metarefresh(0, $url, _('Saving preferences'), _('Reloading current tab....'));
        }
    }
}
// header, start of table, form, etc. common to all tabs
$header = _("Personal Preferences");
$theme_extra_args["js_data"] = get_newHelpWin_javascript("{$code_url}/pophelp.php?category=prefs&name=set_") . "\n\n    // function that can be used to check/uncheck a lot\n    // of checkboxes at a time.\n    // First parameter: true/false.\n    // Following parameters: The name of the checkboxes.\n    // The code checks that a checkbox really exists\n    // before accessing it.\n    function check_boxes(value) {\n        var f = document.forms[0];\n        for (var i = 1; i < arguments.length; i++) {\n            var name = arguments[i];\n            eval('if (f.'+name+') f.'+name+'.checked=value');\n        }\n    }";
output_header($header, SHOW_STATSBAR, $theme_extra_args);
echo_stylesheet_for_tabs();
echo "<br><center>";
echo "<form action='userprefs.php' method='post'>";
echo "<table width='90%' bgcolor='#ffffff' border='1' cellspacing='0' cellpadding='0' style='border: 1px solid #111; border-collapse: collapse'>";
echo "<tr><td bgcolor='" . $theme['color_headerbar_bg'] . "' colspan='6' align='center'>";
echo "<font size=\"+2\" color='" . $theme['color_headerbar_font'] . "'><b>" . sprintf(_("Preferences Page for %s"), $pguser) . "</b></font>\n";
echo "<br><font color='" . $theme['color_headerbar_font'] . "'><i>" . _("Your preferences are grouped into tabs. Switch between the tabs by clicking on e.g. 'General' or 'Proofreading'.") . "</i></font>\n";
echo "<br><font color='" . $theme['color_headerbar_font'] . "'><i>" . _("(click the ? for help on that specific preference)") . "</i></font></td></tr>";
    $title = _("Transferring...");
    $body = "";
    $refresh_url = prepare_url($transition->detour);
    metarefresh(2, $refresh_url, $title, $body);
    exit;
}
$extras = array();
// -------------------------------------------------------------------------
$error_msg = $transition->do_state_change($project, $pguser, $extras);
if ($error_msg == '') {
    $title = _("Action Successful");
    $body = sprintf(_("Your request ('%s') was successful."), $transition->action_name);
} else {
    fatal_error(sprintf(_("Something went wrong, and your request ('%s') has probably not been carried out."), $transition->action_name) . "\n" . _("Error") . ":" . "\n" . $error_msg);
}
// Return the user to the screen they were at
// when they requested the state change.
$refresh_url = $return_uri;
metarefresh(2, $refresh_url, $title, $body);
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function prepare_url($url_template)
{
    global $projectid, $return_uri;
    $url = str_replace('<PROJECTID>', $projectid, $url_template);
    // Pass $return_uri on to the next page, in hopes it can use it.
    $connector = strpos($url, '?') === FALSE ? '?' : '&';
    $encoded_return_uri = urlencode($return_uri);
    $url .= "{$connector}return_uri={$encoded_return_uri}";
    return $url;
}
// vim: sw=4 ts=4 expandtab
        if ($can_edit) {
            $action = 'show_sources';
        } else {
            output_header('', NO_STATSBAR);
            if ($new) {
                $source->log_request_for_approval($pguser);
            }
            echo _("Your proposal has been successfully recorded. You will be\n                    notified by email once it has been approved.");
        }
    }
}
if ($action == 'show_sources') {
    // The more detailed listing of Image Sources is only available
    // to managers.
    if (!$can_edit) {
        metarefresh(0, "{$code_url}/tools/project_manager/show_image_sources.php");
    }
    output_header(_('List Image Sources'), NO_STATSBAR, $theme_args);
    show_is_toolbar();
    $result = mysql_query("SELECT code_name FROM image_sources ORDER BY display_name ASC");
    echo "<br>";
    echo "<table class='listing'>";
    echo "<tr>";
    echo "<th>" . _("ID") . "</th>";
    echo "<th>" . _("Display Name") . "</th>";
    echo "<th>" . _("Full Name") . "</th>";
    echo "<th>" . _("Status") . "</th>";
    echo "<th>" . _("Store Images") . "</th>";
    echo "<th>" . _("Publish Images") . "</th>";
    echo "<th>" . _("Source shown to") . "</th>";
    echo "</tr>";
Example #8
0
$ID = validate_userID('id', @$_GET['id']);
$result = mysql_query("SELECT * FROM non_activated_users WHERE id='{$ID}'");
if (mysql_num_rows($result) == 1) {
    $user = mysql_fetch_assoc($result);
} else {
    $user = NULL;
    // If the user is already activated, and the activated user is the
    // one that is logged in, redirect them to the Activity Hub. This can
    // happen if they use the login form in the navbar and are redirected
    // back here.
    try {
        $user_test = new User();
        $user_test->load("id", $ID);
        $existing_user = $user_test->username;
        if ($pguser == $existing_user) {
            metarefresh(0, "{$code_url}/activity_hub.php");
        }
    } catch (Exception $exception) {
        $existing_user = NULL;
    }
}
// A newly registered user has clicked the link in the welcoming e-mail and has thus
// proved that the e-mail is working. It is time to 'activate' the account, i.e.
// create a record in the users table, create a profile, stats data, etc.
// and send a welcome mail.
output_header(_('Activate account'));
if (!$user) {
    echo "<p>\n";
    echo sprintf(_("There is no account with the id '%s' waiting to be activated."), $ID);
    if ($existing_user) {
        echo "\n";
Example #9
0
include_once '../includes/team.inc';
$order = get_enumerated_param($_GET, 'order', 'id', array('id', 'teamname', 'member_count'));
$direction = get_enumerated_param($_GET, 'direction', 'asc', array('asc', 'desc'));
$tname = array_get($_REQUEST, 'tname', null);
$texact = array_get($_REQUEST, 'texact', null);
$tstart = get_integer_param($_GET, 'tstart', 0, 0, null);
if ($tname) {
    if ($texact) {
        $where_body = "teamname='{$tname}'";
    } else {
        $where_body = "teamname LIKE '%{$tname}%'";
    }
    $tResult = select_from_teams($where_body, "ORDER BY {$order} {$direction} LIMIT {$tstart},20");
    $tRows = mysql_num_rows($tResult);
    if ($tRows == 1) {
        metarefresh(0, "tdetail.php?tid=" . mysql_result($tResult, 0, "id") . "", '', '');
        exit;
    }
    $tname = "tname=" . urlencode($tname) . "&";
} else {
    $tResult = select_from_teams("", "ORDER BY {$order} {$direction} LIMIT {$tstart},20");
    $tRows = mysql_num_rows($tResult);
    $tname = "";
}
$name = _("Team List");
output_header($name);
echo "<center><br>";
//Display of user teams
echo "<table border='1' cellspacing='0' cellpadding='4' style='border: 1px solid #111; border-collapse: collapse' width='95%'>\n";
echo "<tr bgcolor='" . $theme['color_headerbar_bg'] . "'><td colspan='6' align='center'><b><font color='" . $theme['color_headerbar_font'] . "'>";
echo _("User Teams");
        if ($weeks == "replace") {
            log_project_event($projectid, $pguser, 'smooth-reading', 'text replaced');
        } else {
            log_project_event($projectid, $pguser, 'smooth-reading', 'text available', $deadline);
        }
        notify_project_event_subscribers($project, 'sr_available');
        if ($auto_post_to_project_topic) {
            // Add an auto-post to the project's discussion topic.
            $project->ensure_topic();
            topic_add_post($project->topic_id, "Project made available for smooth-reading", "The project has just been made available for smooth-reading for {$weeks} weeks." . "\n\n" . "(This post is automatically generated.)", '[Smooth Reading Monitor]', FALSE);
        }
    }
    // let them know file uploaded and send back to the right place
    $msg1 = _("File uploaded. Thank you!");
    $msg2 = _("Project returned to pool");
    if ($have_file && $returning_to_pool) {
        $msg = $msg1 . "\n" . $msg2;
    } else {
        if ($have_file) {
            $msg = $msg1;
        } else {
            if ($returning_to_pool) {
                $msg = $msg2;
            } else {
                $msg = _("This shouldn't happen. No file upload and not returning to pool.");
            }
        }
    }
    metarefresh(1, $back_url, $msg, $msg);
}
// vim: sw=4 ts=4 expandtab
Example #11
0
    $result = mysql_query("SELECT metadata FROM {$projectid} WHERE image = '{$imagename}'");
    $old_md = mysql_result($result, 0, "metadata");
    //concat new metadata
    $i = 0;
    $new_md = '';
    foreach ($_POST as $key => $val) {
        if ($val == 'on') {
            $new_md = $new_md . ',' . $key;
            $i++;
        }
        $all_md = $old_md . $new_md;
        $result = mysql_query("UPDATE {$projectid} SET metadata = '{$all_md}' WHERE image = '{$imagename}'");
    }
    //change page status and keep going
    $result = mysql_query("UPDATE {$projectid} SET state = 'save_md_second' WHERE image = '{$imagename}'");
    metarefresh(0, "md_phase2.php?projectid={$projectid}", "Image Metadata Collection", "");
}
$md_groups = array('Front Matter' => array('acknowledge' => 'Acknowledgement', 'dedication' => 'Dedication', 'ednotes' => "Editor's Notes", 'foreword' => 'Foreword', 'intro' => 'Introduction', 'loi' => 'List of Illustrations', 'preface' => 'Preface', 'prologue' => 'Prologue', 'toc' => 'Table of Contents', 'titlepage' => 'Title Page'), 'Body of Book' => array('abbreviation' => 'Abbreviation', 'division' => 'Chapter/Part/Book Heading', 'epigraph' => 'Dedication/Epigraph', 'footnote' => 'Footnote', 'illustration' => 'Illustration or Drawing', 'letter' => 'Letter', 'list' => 'List', 'math' => 'Symbolic Notation', 'poetry' => 'Poetry/Verse', 'sidenote' => 'Sidenote', 'verse' => 'Song/Music', 'table' => 'Table'), 'Back Matter' => array('appendix' => 'Appendix', 'afterword' => 'Afterword', 'biblio' => 'Bibliography', 'colophon' => 'Colophon', 'endnote' => 'End Note', 'epilogue' => 'Epilogue', 'index' => 'Index'));
output_header(_("Image Frame"));
//Start the outside table
echo "<table cols ='2' border = '1'>";
//Display image
if ($userP['i_layout'] == 1) {
    $iWidth = $userP['v_zoom'];
} else {
    $iWidth = $userP['h_zoom'];
}
$iWidth = round(1000 * $iWidth / 100);
// The outside table has a single row containing two cells.
echo "<tr>\n";
// The left cell contains the page image
Example #12
0
    } else {
        include_once $relPath . 'theme.inc';
        $title = _("Three Team Maximum");
        output_header($title);
        echo "<br><center>";
        echo "<table border='1' cellspacing='0' cellpadding='3' style='border: 1px solid  #111; border-collapse: collapse' width='95%'>";
        echo "<tr bgcolor='" . $theme['color_headerbar_bg'] . "'><td colspan='3'><b><center><font face='" . $theme['font_headerbar'] . "' color='" . $theme['color_headerbar_font'] . "'>" . _("Three Team Maximum") . "</font></center></b></td></tr>";
        echo "<tr bgcolor='" . $theme['color_mainbody_bg'] . "'><td colspan='3'><center><font face='" . $theme['font_mainbody'] . "' color='" . $theme['color_mainbody_font'] . "' size='2'>" . _("You have already joined three teams.<br>Which team would you like to replace?") . "</font></center></td></tr>";
        echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>";
        $teamR = mysql_query("SELECT teamname FROM user_teams WHERE id='" . $userP['team_1'] . "'");
        echo "<td width='33%'><center><b><a href='jointeam.php?tid={$tid}&otid=1'>" . mysql_result($teamR, 0, 'teamname') . "</a></b></center></td>";
        $teamR = mysql_query("SELECT teamname FROM user_teams WHERE id='" . $userP['team_2'] . "'");
        echo "<td width='33%'><center><b><a href='jointeam.php?tid={$tid}&otid=2'>" . mysql_result($teamR, 0, 'teamname') . "</a></b></center></td>";
        $teamR = mysql_query("SELECT teamname FROM user_teams WHERE id='" . $userP['team_3'] . "'");
        echo "<td width='34%'><center><b><a href='jointeam.php?tid={$tid}&otid=3'>" . mysql_result($teamR, 0, 'teamname') . "</a></b></center></td>";
        echo "</tr><tr bgcolor='" . $theme['color_headerbar_bg'] . "'><td colspan='3'><center><b><a href='../teams/tdetail.php?tid={$tid}'><font face='" . $theme['font_headerbar'] . "' color='" . $theme['color_headerbar_font'] . "' size='2'>" . _("Do Not Join Team") . "</font></a></b></center></td></tr></table></center>";
        $redirect_team = 0;
    }
} else {
    $title = _("Unable to Join the Team");
    $desc = _("You are already a member of this team....");
    metarefresh(4, "../teams/tdetail.php?tid={$tid}", $title, $desc);
    $redirect_team = 0;
}
if ($redirect_team == 1) {
    dpsession_set_preferences_from_db();
    $title = _("Join the Team");
    $desc = _("Joining the team....");
    metarefresh(0, "../teams/tdetail.php?tid={$tid}", $title, $desc);
}
// vim: sw=4 ts=4 expandtab
    echo "<p><b>" . _("Note") . ":</b> " . _("If this report causes a project to be marked bad you will be redirected to the Activity Hub.") . "</p>";
    echo "</form>";
} else {
    $reason = $_POST['reason'];
    //See if they filled in a reason.  If not tell them to go back
    if ($reason == 0) {
        include_once $relPath . 'theme.inc';
        output_header(_("Incomplete Form!"), NO_STATSBAR);
        echo "<br><center>" . _("You have not completely filled out this form!  Please hit the <a href='javascript:history.back()'>back</a> button on your browser & fill out all fields.") . "</center>";
        exit;
    }
    //Update the page the user was working on to reflect a bad page.
    //This may cause the whole project to be marked bad.
    $project_is_bad = $ppage->markAsBad($pguser, $reason);
    // Redirect the user to either continue proofreading if project is still open
    // or present a link back to the activity hub
    if ($_POST['redirect_action'] == "proof" && !$project_is_bad) {
        $frame1 = $ppage->url_for_do_another_page();
        $title = _("Bad Page Report");
        $body = _("Continuing to Proofread");
        metarefresh(0, $frame1, $title, $body);
    } else {
        $frame1 = "../../activity_hub.php";
        $title = _("Stop Proofreading");
        $body = sprintf(_("Return to the <a %s>Activity Hub</a>."), "href='{$frame1}' target='_top'");
        slim_header($title);
        echo $body;
        exit;
    }
}
// vim: sw=4 ts=4 expandtab
    echo "<br><h2 align='center'>{$page_title}</h2>\n";
    if ($errors != '') {
        echo "<br><center><font size='+1' color='#ff0000'><b>{$errors}</b></font></center>";
    }
    $pih->show_form();
    if (isset($_POST['saveAndPreview'])) {
        $pih->preview();
    }
} elseif (isset($_POST['quit'])) {
    // if return is empty for whatever reason take them to
    // the PM page
    if (empty($return)) {
        $return = "{$code_url}/tools/project_manager/projectmgr.php";
    }
    // do the redirect
    metarefresh(0, $return, _("Quit Without Saving"), "");
} else {
    $requested_action = get_enumerated_param($_REQUEST, 'action', null, array('createnew', 'clone', 'createnewfromuber', 'create_from_marc_record', 'edit'));
    if (in_array($requested_action, array('createnew', 'clone', 'createnewfromuber', 'create_from_marc_record'))) {
        check_user_can_load_projects(true);
        // exit if they can't
    }
    switch ($requested_action) {
        case 'createnew':
            $page_title = _("Create a Project");
            $fatal_error = $pih->set_from_nothing();
            break;
        case 'clone':
            $page_title = _("Clone a Project");
            $fatal_error = $pih->set_from_db(FALSE);
            break;
<?php

$relPath = "../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'metarefresh.inc';
include_once $relPath . 'Project.inc';
include_once $relPath . 'project_trans.inc';
require_login();
$projectid = validate_projectID('projectid', @$_POST['projectid']);
$postcomments = @$_POST['postcomments'];
// Verify that it's the pp-er trying to perform this action.
$project = new Project($projectid);
if (!$project->PPer_is_current_user || $project->state != PROJ_POST_FIRST_CHECKED_OUT) {
    echo _("The project is not checked out to you.");
    exit;
}
$qry = mysql_query("\n    UPDATE projects SET postcomments = '{$postcomments}'\n    WHERE projectid = '{$projectid}'\n");
$msg = _("Comments added.");
metarefresh(1, "{$code_url}/project.php?id={$projectid}", $msg, $msg);
// vim: sw=4 ts=4 expandtab
Example #16
0
include_once '../includes/member.inc';
$order = get_enumerated_param($_GET, 'order', 'u_id', array('u_id', 'username', 'date_created'));
$direction = get_enumerated_param($_GET, 'direction', 'asc', array('asc', 'desc'));
$mstart = get_integer_param($_GET, 'mstart', 0, 0, null);
$uname = @$_REQUEST['uname'];
$uexact = @$_REQUEST['uexact'];
if (!empty($uname)) {
    if ($uexact == 'yes') {
        $where_clause = "WHERE username='******'";
    } else {
        $where_clause = "WHERE username LIKE '%" . addcslashes($uname, "%_") . "%'";
    }
    $mResult = mysql_query("\n        SELECT u_id, username, date_created, u_privacy\n        FROM users\n        {$where_clause}\n        ORDER BY {$order} {$direction}\n        LIMIT {$mstart},20\n    ");
    $mRows = mysql_num_rows($mResult);
    if ($mRows == 1) {
        metarefresh(0, "mdetail.php?id=" . mysql_result($mResult, 0, "u_id") . "", '', '');
        exit;
    }
    $uname = "uname=" . $uname . "&";
} else {
    $mResult = mysql_query("\n        SELECT u_id, username, date_created, u_privacy\n        FROM users\n        ORDER BY {$order} {$direction}\n        LIMIT {$mstart},20\n    ");
    $mRows = mysql_num_rows($mResult);
    $uname = "";
}
output_header(_("Member List"));
echo "<center><br>";
//Display of user teams
echo "<table border='1' cellspacing='0' cellpadding='4' style='border: 1px solid #111; border-collapse: collapse' width='95%'>";
echo "<tr bgcolor='" . $theme['color_headerbar_bg'] . "'><td colspan='6' align='center'><b><font color='" . $theme['color_headerbar_font'] . "'>" . sprintf(_("%s Members"), $site_name) . "</font></b></td></tr>";
echo "<tr bgcolor='" . $theme['color_navbar_bg'] . "'>";
if ($order == "u_id" && $direction == "asc") {
        $numeric_fields = array("open_month" => _("Open Month"), "open_day" => _("Open Day"), "close_month" => _("Close Month"), "close_day" => _("Close Day"));
        foreach ($numeric_fields as $field => $string) {
            if ($_POST[$field] == '' || !ctype_digit($_POST[$field])) {
                $errmsgs .= sprintf(_("Field %s does not contain a valid number."), $string) . "<br>";
            }
        }
        // validate the URLs
        if ($_POST['info_url'] && !startswith($_POST['info_url'], "http")) {
            $errmsgs .= _("Info URL is not a valid URL -- ensure it starts with http://.") . "<br>";
        }
        if ($_POST['image_url'] && !startswith($_POST['image_url'], "http")) {
            $errmsgs .= _("Image URL is not a valid URL -- ensure it starts with http://.") . "<br>";
        }
        $source->save_from_post();
        // Redisplay at the entry just added or edited
        metarefresh(0, "{$page_url}#" . urlencode($spec_code));
    }
}
if ($action == 'show_specials') {
    output_header(_('Manage Special Days'), NO_STATSBAR, $theme_args);
    $table_summary = _("Special Days Listing");
    show_sd_toolbar();
    $result = mysql_query("SELECT spec_code\n        FROM special_days\n        ORDER BY open_month, open_day");
    echo "<br>\n\n";
    echo "<table class='listing' summary='" . attr_safe($table_summary) . "'>\n";
    $count = 0;
    $current_month = -1;
    while (list($source_name) = mysql_fetch_row($result)) {
        $count++;
        $source = new SpecialDay($source_name);
        $current_month = $source->show_listing_row($count, $current_month);
Example #18
0
    $result = mysql_query("SELECT id FROM user_teams WHERE id != " . $tid . " AND teamname = '" . addslashes(stripAllString(trim($_POST['teamname']))) . "'");
    if (mysql_num_rows($result) > 0 || trim($_POST['teamname']) == '') {
        $preview = _("Preview");
        output_header($preview, SHOW_STATSBAR, $theme_extra_args);
        $teamimages = uploadImages(1, $tid, "both");
        $curTeam['avatar'] = $teamimages['avatar'];
        if (trim($_POST['teamname']) == "") {
            echo "<center><br>" . _("The team name must not be empty.") . "<br>";
        } else {
            echo "<center><br>" . _("The team name must be unique. Please make any changes and resubmit.") . "<br>";
        }
        showEdit(stripslashes($_POST['teamname']), stripslashes($_POST['text_data']), stripslashes($_POST['teamwebpage']), 0, $tid);
        echo "<br></center><br>";
    } else {
        if (!empty($_POST['tavatar'])) {
            mysql_query("UPDATE user_teams SET avatar='" . $_POST['tavatar'] . "' WHERE id = {$tid}");
        } elseif (!empty($_FILES['teamavatar'])) {
            uploadImages(0, $tid, "avatar");
        }
        if (!empty($_POST['ticon'])) {
            mysql_query("UPDATE user_teams SET icon='" . $_POST['ticon'] . "' WHERE id = {$tid}");
        } elseif (!empty($_FILES['teamicon'])) {
            uploadImages(0, $tid, "icon");
        }
        mysql_query("UPDATE user_teams SET teamname='" . addslashes(stripAllString(trim($_POST['teamname']))) . "', team_info='" . addslashes(stripAllString($_POST['text_data'])) . "', webpage='" . addslashes(stripAllString($_POST['teamwebpage'])) . "' WHERE id='{$tid}'");
        $title = _("Saving Team Update");
        $desc = _("Updating team....");
        metarefresh(0, "tdetail.php?tid={$tid}", $title, $desc);
    }
}
// vim: sw=4 ts=4 expandtab
Example #19
0
            $otid = 0;
            if (!isset($_POST['teamall'])) {
                if ($userP['team_1'] == $_POST['tteams']) {
                    $otid = 1;
                } elseif ($userP['team_2'] == $_POST['tteams']) {
                    $otid = 2;
                } else {
                    if ($userP['team_3'] == $_POST['tteams']) {
                        $otid = 3;
                    }
                }
            }
            dpsession_set_preferences_from_db();
            $title = _("Join the Team");
            $desc = _("Creating the team....");
            metarefresh(0, "../members/jointeam.php?tid={$tid}&otid={$otid}", $title, $desc);
        }
    } elseif (isset($_POST['mkQuit'])) {
        $title = _("Quit Without Saving");
        $desc = _("Quitting without saving...");
        metarefresh(4, "{$code_url}/activity_hub.php", $title, $desc);
        exit;
    } else {
        $name = _("Create a New Team");
        output_header($name, SHOW_STATSBAR, $theme_extra_args);
        echo "<center><br>";
        showEdit("", "", "", 1, 0);
        echo "</center>";
    }
}
// vim: sw=4 ts=4 expandtab
     switch_layout();
     echo_proof_frame($ppage);
     break;
 case B_REVERT_TO_ORIGINAL:
     $ppage->saveAsInProgress($text_data, $pguser);
     $ppage->revertToOriginal();
     echo_proof_frame($ppage);
     break;
 case B_REVERT_TO_LAST_TEMPSAVE:
     $ppage->revertToSaved();
     echo_proof_frame($ppage);
     break;
 case B_SAVE_AND_DO_ANOTHER:
     $ppage->saveAsDone($text_data, $pguser);
     $url = $ppage->url_for_do_another_page();
     metarefresh(1, $url, _("Save as 'Done' & Proof Next"), _("Page Saved."));
     break;
 case B_SAVE_AND_QUIT:
     $ppage->saveAsDone($text_data, $pguser);
     leave_proofing_interface(_("Save as 'Done'"));
     break;
 case B_RETURN_PAGE_TO_ROUND:
     $ppage->returnToRound($pguser);
     leave_proofing_interface(_("Return to Round"));
     break;
 case B_REPORT_BAD_PAGE:
     include 'report_bad_page.php';
     break;
 case B_RUN_SPELL_CHECK:
     if (!is_dir($aspell_temp_dir)) {
         mkdir($aspell_temp_dir);
Example #21
0
function login_failure($error_code, $destination)
{
    global $code_url;
    metarefresh(0, "{$code_url}/accounts/login_failure.php?error_code={$error_code}&destination=" . urlencode($destination), "", "");
}
    row(_("Default Text Preparer"), 'DP_user_field', $text_preparer, 'text_preparer');
    row(_("Default Extra Credits"), 'extra_credits_field', $extra_credits);
    if ($scannercredit != '') {
        row(_("Default Scanner Credit (deprecated)"), 'text_field', $scannercredit, 'scannercredit');
    }
    row(_("Default Clearance Information"), 'text_field', $clearance, 'clearance');
    row(_("Default Project Comments"), 'proj_comments_field', $comments);
    echo "<tr><td bgcolor='{$bgcol}' colspan='2' align='center'><input type='submit' name='saveUberAndQuit' value='" . _("Save Uber Project and Quit") . "'><input type='submit' name='saveUberAndNewProject' value='" . _("Save Uber Project and Create \na New Project from this Uber Project") . "'><input type='submit' name='saveUberAndReturn' value='" . _("Save Uber Project\n and Refresh") . "'><input type='button' value='" . _("Quit Without Saving") . "' onclick='javascript:location.href=\"projectmgr.php\";'></td></tr>\n</table></center>";
    echo "</form>";
} elseif (isset($_POST['saveUberAndQuit']) || isset($_POST['saveUberAndNewProject'])) {
    $errorMsg = saveUberProject($_POST);
    if (empty($errorMsg)) {
        if (isset($_POST['saveUberAndQuit'])) {
            metarefresh(0, "projectmgr.php", _("Save Uber Project and Quit"), "");
        } else {
            metarefresh(0, "editproject.php?action=createnewfromuber&up_projectid=" . $up_projectid, _("Save Uber Project and Create New Project"), "");
        }
    } else {
        output_header(_("Uber Project Error!"));
        echo "<br><center><h3><font color='#ff0000'>{$errorMsg}<br><br>";
        echo _("Press browser Back button to return, edit, and try again");
        echo "</font></h3></center>";
    }
}
// XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
function saveUberProject()
{
    //Let's check to make sure everything is correct & there are no errors
    if (empty($_POST['up_nameofwork'])) {
        $errormsg .= "Overall Name of Uber Project is required.<br>";
    }
Example #23
0
}
if (isset($_POST['done'])) {
    $badmetadata = handle_page_params();
    if ($badmetadata == 1) {
        $result = mysql_query("UPDATE projects SET state = 'project_md_bad' WHERE projectid = '{$projectid}'");
        metarefresh(0, 'md_available.php', _("Image Metadata Collection"), "");
    } else {
        $result = mysql_query("UPDATE projects SET state = 'project_md_second' WHERE projectid = '{$projectid}'");
        $result = mysql_query("UPDATE {$projectid} SET state = 'avail_md_second'");
        metarefresh(0, 'md_available.php', _("Image Metadata Collection"), "");
    }
    exit;
}
if (isset($_POST['return'])) {
    //they don't want to save so clean it up and return them to md_available
    metarefresh(0, 'md_available.php', _("Image Metadata Collection"), "");
    exit;
}
if (isset($_POST['continue'])) {
    handle_page_params();
    // ignore the return value
}
function handle_page_params()
{
    global $projectid;
    foreach ($_POST['orig_page_num_'] as $image => $orig_page_num) {
        $result = mysql_query("UPDATE {$projectid} SET orig_page_num = '{$orig_page_num}' WHERE image = '{$image}'");
    }
    $badmetadata = 0;
    foreach ($_POST['metadata_'] as $image => $metadata) {
        $result = mysql_query("UPDATE {$projectid} SET metadata = '{$metadata}' WHERE image = '{$image}'");
Example #24
0
$relPath = "./../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'metarefresh.inc';
include_once '../includes/team.inc';
require_login();
$tid = get_integer_param($_GET, 'tid', null, 0, null);
if ($userP['team_1'] == $tid || $userP['team_2'] == $tid || $userP['team_3'] == $tid) {
    $quitQuery = "UPDATE users SET ";
    if ($userP['team_1'] == $tid) {
        $quitQuery .= "team_1 = '0'";
    }
    if ($userP['team_2'] == $tid) {
        $quitQuery .= "team_2 = '0'";
    }
    if ($userP['team_3'] == $tid) {
        $quitQuery .= "team_3 = '0'";
    }
    $quitQuery .= " WHERE username='******' AND u_id='" . $userP['u_id'] . "'";
    $teamResult = mysql_query($quitQuery);
    mysql_query("UPDATE user_teams SET active_members = active_members-1 WHERE id='" . $tid . "'");
    dpsession_set_preferences_from_db();
    $title = _("Quit the Team");
    $desc = _("Quitting the team....");
    metarefresh(0, "../teams/tdetail.php?tid=" . $tid . "", $title, $desc);
} else {
    $title = _("Not a member");
    $desc = _("Unable to quit team....");
    metarefresh(3, "../teams/tdetail.php?tid=" . $tid . "", $title, $desc);
}
// vim: sw=4 ts=4 expandtab
Example #25
0
     $locale = validate_locale($_REQUEST['locale'], False);
     if (file_exists("{$dyn_locales_dir}/{$locale}")) {
         echo "<p>" . sprintf(_("Translation directory for %s already exists."), $locale) . "</p>";
         echo "<p><a href='{$translate_url}'>" . _("Back to the Translation Center") . "</a></p>";
     }
     if (!file_exists("{$dyn_locales_dir}/messages.pot")) {
         echo "<p>" . _("No POT available to initialize translation.") . "</p>";
         echo "<p><a href='{$translate_url}'>" . _("Back to the Translation Center") . "</a></p>";
     }
     mkdir("{$dyn_locales_dir}/{$locale}", 0755);
     mkdir("{$dyn_locales_dir}/{$locale}/LC_MESSAGES/", 0755);
     $po_filename = "{$dyn_locales_dir}/{$locale}/LC_MESSAGES/messages.po";
     $po_file = new POFile($po_filename);
     try {
         $po_file->create_from_template("{$dyn_locales_dir}/messages.pot", $locale);
         metarefresh(0, "{$translate_url}?func=manage&amp;locale={$locale}", "", "");
     } catch (Exception $exception) {
         echo "<p>" . _("An error occurred during translation initialization.") . "</p>";
         echo "<pre>" . $exception->getMessage() . "</pre>";
         echo "<p><a href='{$translate_url}'>" . _("Back to the Translation Center") . "</a></p>";
     }
 } else {
     if ($func == "delete") {
         $locale = validate_locale($_REQUEST['locale']);
         assert(is_dir("{$dyn_locales_dir}/{$locale}"));
         exec("rm -r {$dyn_locales_dir}/{$locale}");
         echo "<p>" . sprintf(_("Locale %s deleted."), $locale) . "</p>";
         echo "<p><a href='{$translate_url}'>" . _("Back to the Translation Center") . "</a></p>";
     } else {
         if ($func == "changeenable") {
             $locale = validate_locale($_REQUEST['locale']);