diff --git a/README.md b/README.md index 8ac2abc62..51d6d5e6a 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,11 @@ _Preserving history, one page at a time._ This repository contains the code that powers https://www.pgdp.net and other sister DP sites world-wide. +**This branch should not be merged into master.** + +This branch is for pgdp.net-specific production hacks and should not be merged +into master. + ## About Distributed Proofreaders is a web application (written in PHP and backed by a diff --git a/api/v1_projects.inc b/api/v1_projects.inc index 70e842b71..931f3f907 100644 --- a/api/v1_projects.inc +++ b/api/v1_projects.inc @@ -213,7 +213,7 @@ function get_project_fields_with_attr(?string $attr, ?Project $project): array // case of forbidding PMs to search for clearances that they can in fact // see in their individual projects, but we don't want to open up the // ability for them to value-fishing on clearances. - $can_search = is_null($project) && (user_is_a_sitemanager() || user_is_proj_facilitator()); + $can_search = is_null($project) && (user_is_a_sitemanager() || user_is_proj_facilitator() || User::current_username() == 'pg-automation'); if ($can_search || $can_render) { $fields["clearance"] = ["sql_name" => "clearance", "updatable" => true, "queryable" => true]; } diff --git a/dp_branding/dp-logo-500px-white.png b/dp_branding/dp-logo-500px-white.png new file mode 100644 index 000000000..f59e05652 Binary files /dev/null and b/dp_branding/dp-logo-500px-white.png differ diff --git a/dp_branding/dp-logo-500px.png b/dp_branding/dp-logo-500px.png new file mode 100644 index 000000000..d02f629c2 Binary files /dev/null and b/dp_branding/dp-logo-500px.png differ diff --git a/dp_branding/dp-logo-600px-white.png b/dp_branding/dp-logo-600px-white.png new file mode 100644 index 000000000..f672275e8 Binary files /dev/null and b/dp_branding/dp-logo-600px-white.png differ diff --git a/dp_branding/dp-logo-600px.png b/dp_branding/dp-logo-600px.png new file mode 100644 index 000000000..f6186045a Binary files /dev/null and b/dp_branding/dp-logo-600px.png differ diff --git a/dp_branding/dp-logo-Amiri_font.svg b/dp_branding/dp-logo-Amiri_font.svg new file mode 100644 index 000000000..aeeab696b --- /dev/null +++ b/dp_branding/dp-logo-Amiri_font.svg @@ -0,0 +1,517 @@ + + + + diff --git a/dp_branding/dp-logo-bw-500px.png b/dp_branding/dp-logo-bw-500px.png new file mode 100644 index 000000000..33a20d692 Binary files /dev/null and b/dp_branding/dp-logo-bw-500px.png differ diff --git a/dp_branding/dp-logo-bw.svg b/dp_branding/dp-logo-bw.svg new file mode 100644 index 000000000..a2bb56271 --- /dev/null +++ b/dp_branding/dp-logo-bw.svg @@ -0,0 +1,836 @@ + + + + diff --git a/dp_branding/dp-logo-dark.svg b/dp_branding/dp-logo-dark.svg new file mode 100644 index 000000000..8bca64a17 --- /dev/null +++ b/dp_branding/dp-logo-dark.svg @@ -0,0 +1,838 @@ + + diff --git a/dp_branding/dp-logo.png b/dp_branding/dp-logo.png new file mode 100644 index 000000000..2ec073f23 Binary files /dev/null and b/dp_branding/dp-logo.png differ diff --git a/dp_branding/dp-logo.svg b/dp_branding/dp-logo.svg new file mode 100644 index 000000000..4f7ecd627 --- /dev/null +++ b/dp_branding/dp-logo.svg @@ -0,0 +1,840 @@ + + + + diff --git a/dp_branding/dp-mark-120px-white.png b/dp_branding/dp-mark-120px-white.png new file mode 100644 index 000000000..eea9caa50 Binary files /dev/null and b/dp_branding/dp-mark-120px-white.png differ diff --git a/dp_branding/dp-mark-120px.png b/dp_branding/dp-mark-120px.png new file mode 100644 index 000000000..6c8d30798 Binary files /dev/null and b/dp_branding/dp-mark-120px.png differ diff --git a/dp_branding/dp-mark-32px-white.png b/dp_branding/dp-mark-32px-white.png new file mode 100644 index 000000000..610d57cb5 Binary files /dev/null and b/dp_branding/dp-mark-32px-white.png differ diff --git a/dp_branding/dp-mark-32px.png b/dp_branding/dp-mark-32px.png new file mode 100644 index 000000000..e30d8b604 Binary files /dev/null and b/dp_branding/dp-mark-32px.png differ diff --git a/dp_branding/dp-mark-400px-white.png b/dp_branding/dp-mark-400px-white.png new file mode 100644 index 000000000..03e94dd73 Binary files /dev/null and b/dp_branding/dp-mark-400px-white.png differ diff --git a/dp_branding/dp-mark-400px.png b/dp_branding/dp-mark-400px.png new file mode 100644 index 000000000..a4ef771c8 Binary files /dev/null and b/dp_branding/dp-mark-400px.png differ diff --git a/dp_branding/dp-mark-64px-white.png b/dp_branding/dp-mark-64px-white.png new file mode 100644 index 000000000..90dcb75b4 Binary files /dev/null and b/dp_branding/dp-mark-64px-white.png differ diff --git a/dp_branding/dp-mark-64px.png b/dp_branding/dp-mark-64px.png new file mode 100644 index 000000000..8505d8ee8 Binary files /dev/null and b/dp_branding/dp-mark-64px.png differ diff --git a/dp_branding/dp-mark.svg b/dp_branding/dp-mark.svg new file mode 100644 index 000000000..452497c2d --- /dev/null +++ b/dp_branding/dp-mark.svg @@ -0,0 +1,115 @@ + + diff --git a/dp_branding/index.php b/dp_branding/index.php new file mode 100644 index 000000000..5348ae538 --- /dev/null +++ b/dp_branding/index.php @@ -0,0 +1,235 @@ +$title"; + +echo "
" . _("Consistent branding and logos are an important part of today's world. This page provides some guidance when referring to Distributed Proofreaders as well as visual assets for both web and print.") . "
"; + +echo "" . _("Distributed Proofreaders refers to the web site at www.pgdp.net. It is governed by the Distributed Proofreaders Foundation. Community members affectionately refer to it as simply 'DP', but use the full 'Distributed Proofreaders' name for clarity when outside the community.") . "
"; + +echo "" . _("Other entities with similar names:") . "
"; + +echo "" . _("The following are DP logos and marks that can be used to link back to https://www.pgdp.net. An SVG is included, as well as PNGs at different sizes. Some of the PNGs have a white background and others use a transparent background. Use whichever makes sense for your purposes. If you need different sizes, you are encouraged to generate them from the SVG file, using a program like Inkscape, rather than resizing the PNGs.") . "
"; + +echo "" . _("For print media, you are encouraged to use the black and white version without the drop shadow. If your design software supports it, use the SVG version for the best output.") . "
"; + +echo "" . _("The SVG files have had the text changed into paths for best consumability. See Fonts and Colors for what fonts were used.") . "
"; + +echo "
+
+
+ 





" . _("If you are looking to create additional branding assets, here are some guidelines for how the current assets were created.") . "
"; + +echo <<" + . sprintf( + _("We are unable to provide certification for any purpose that would require Distributed Proofreaders to track the number of hours spent volunteering, or to provide verification of a user's identity beyond that provided by their email address, or to certify that the volunteer personally performed the work. For these reasons, we cannot provide certification for court-ordered community service, programs operated by federal, state, or municipal governments, etc. For more information, please see this page."), + "$wiki_url/DP_Official_Documentation:General/Certification_of_Volunteer_Work" + ) + . "
" + . "\n"; + // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX echo "\n" diff --git a/phpstan.neon b/phpstan.neon index 35dba7059..4c15cad51 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -38,8 +38,6 @@ parameters: path: pinc/DifferenceEngineWrapper.inc - message: '#Call to function is_array\(\) with array" . _("The following projects are currently available:") . "
"; + break; + case 'P3': + case 'F2': + echo "" . sprintf(_("Your help in proofreading these %s Qualifier projects would be greatly appreciated:"), $round) . "
"; + break; + } + + echo "" . sprintf(_("%1\$s Qualifying projects are for volunteers who are preparing to apply for %1\$s access."), $qual_type) . "
"; + echo "" . sprintf(_("Please make sure you have satisfied the %2\$s entrance requirements before applying.
"), "$code_url/tools/proofers/round.php?round_id=$qual_type#Entrance_Requirements", $qual_type) . ""; + break; + case 'P3': + case 'F2': + echo "" . sprintf(_("Thank you very much for your help with the %s Quals!"), $qual_type) . "
"; + break; + } +} diff --git a/pinc/quizzes.inc b/pinc/quizzes.inc index 15195526f..29b7be4bc 100644 --- a/pinc/quizzes.inc +++ b/pinc/quizzes.inc @@ -126,7 +126,7 @@ new QuizLevel( "proof", "" . sprintf(_("This section covers topics that are not addressed in the proofreading guidelines. The pages include items that you are likely to see when proofreading HARD (and some Average) projects."), get_faq_url("proofreading_guidelines.php")) . "
\n" . - _("If you are not yet familiar with a topic, you can learn about it by using the tutorial mode or following the \"Information\" link for that topic.") . + _("The following quizzes are not required, but can be useful. If you are not yet familiar with a topic, you can learn about it by using the tutorial mode or following the \"Information\" link for that topic.") . "
", [ diff --git a/pinc/stages.inc b/pinc/stages.inc index b89b2bb61..633579a3b 100644 --- a/pinc/stages.inc +++ b/pinc/stages.inc @@ -9,6 +9,7 @@ include_once($relPath.'Pool.inc'); include_once($relPath.'ProjectState.inc'); include_once($relPath.'forum_interface.inc'); // get_url_to_view_forum() include_once($relPath.'faq.inc'); +include_once($relPath.'access_change_emails.inc'); // pp_access_change_email(), f1_access_change_email() // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX @@ -32,14 +33,14 @@ $pi_tools_for_F = [ new Round( 'P1', _('Proofreading Round 1'), - [], - 'IMMEDIATE', + ['quiz/p_basic' => 1], + 'REQ-AUTO', '', null, // access_change_callback _("The page-texts are the output from OCR software and need to have the text carefully compared to the image."), 'proofreading_guidelines.php', $pi_tools_for_P, - null, // daily_page_limit + 60, // daily_page_limit [], [ 0 => _('Novice'), @@ -76,11 +77,11 @@ new Round( ['P1' => 300, 'days since reg' => 21, 'quiz/p_basic' => 1, 'quiz/p_mod1' => 1], 'REQ-AUTO', '', - null, // access_change_callback + "p2_access_change_email", // access_change_callback _("The page-texts have already been proofread, and now need to have the text WordChecked and carefully compared to the image."), 'proofreading_guidelines.php', $pi_tools_for_P, - null, // daily_page_limit + 60, // daily_page_limit ['P1'], [ 0 => _('Precise Proofreader'), @@ -116,7 +117,7 @@ new Round( _('Proofreading Round 3'), ['P2' => 150, 'F1' => 50, 'days since reg' => 42, 'quiz/p_basic' => 1, 'quiz/p_mod1' => 1, 'quiz/p_mod2' => 1], 'REQ-HUMAN', - _("Once you have met the requirements and requested access to P3, an evaluator will check over at least 50 of your recent P2 pages that have been completed in P3. If you proofread them to P3 standards, you'll be granted access."), + sprintf(_("If you are interested in earning access to P3, please visit Am I ready for P3?, and do a self-evaluation. Once you have requested access to P3, an evaluator will check over at least 50 of your recent P2 pages that have been completed in P3. If you proofread them to P3 standards, you'll be granted access."), "https://www.pgdp.net/wiki/DP_Official_Documentation:Proofreading/Am_I_Ready_For_P3%3F"), null, // access_change_callback _("The page-texts have already been proofread, but now need to be examined closely for small errors that may have been missed."), 'proofreading_guidelines.php', @@ -158,11 +159,11 @@ new Round( ['P1' => 300, 'days since reg' => 21, 'quiz/f_only' => 1], 'REQ-AUTO', '', - null, // access_change_callback + "f1_access_change_email", // access_change_callback _("The page-texts have already been proofread, but now need to be formatted with markup which may be specific to the project."), 'formatting_guidelines.php', $pi_tools_for_F, - null, // daily_page_limit + 25, // daily_page_limit [], [ 0 => _('Formatting Neophyte'), @@ -265,7 +266,7 @@ new Pool( ['F1' => 400], 'REQ-AUTO', '', - null, // access_change_callback + "pp_access_change_email", // access_change_callback _('After going through various rounds of proofreading and formatting, the books need to be massaged into a final e-text.'), 'post_proof.php', _("Manager"), diff --git a/pinc/theme.inc b/pinc/theme.inc index c647dfbee..1de0a0c0b 100644 --- a/pinc/theme.inc +++ b/pinc/theme.inc @@ -536,6 +536,21 @@ function html_statsbar(): void global $code_url, $PG_home_url; maybe_show_language_selector(); + // SITE-SPECIFIC + // Display the donation icon and link to donate. + // + // It was decided that, at pgdp.net, we would show the donation block + // only on the front page and the Activity Hub. + // It's somewhat kludgey to effect that here -- a better design + // would express that in the respective calls to output_header() -- + // but this approach has a much lower impact (code diff), + // and its drawbacks probably won't bite us. + if (str_ends_with($_SERVER['SCRIPT_NAME'], "/index.php") || + str_ends_with($_SERVER['SCRIPT_NAME'], "/activity_hub.php")) { + show_donation_stuff(); + show_social_media_links(); + } + // For logged-in users, show links to key help documents: $user = User::load_current(); if ($user) { @@ -607,9 +622,24 @@ function html_statsbar(): void } // SITE-SPECIFIC - //Display the "About DP" section if user is not logged in + echo ""; + echo "" . _("Code of Conduct") . ""; + echo " · "; + echo "" . _("Privacy Policy") . ""; + echo "
"; + + echo ""; + echo sprintf(_("Distributed Proofreaders is dedicated to the preservation of written works that are in the Public Domain in the United States by converting them into high-quality, freely available digital transcriptions. This is accomplished through the efforts of a supportive community of volunteers. Distributed Proofreaders follows the principles of the American Library Association Freedom to Read statement."), "http://www.ala.org/advocacy/intfreedom/freedomreadstatement"); + echo "
"; + + //Display the history section if user is not logged in if (!$user) { - echo ""; + echo "
"; echo sprintf(_("Distributed Proofreaders was founded in 2000 by Charles Franks to support the digitization of Public Domain books. Originally conceived to assist Project Gutenberg (PG), Distributed Proofreaders (DP) is now the main source of PG e-books. In 2002, Distributed Proofreaders became an official PG site. In May 2006, Distributed Proofreaders became a separate legal entity and continues to maintain a strong relationship with PG."), $PG_home_url); echo "
"; } @@ -1049,6 +1079,72 @@ function show_key_help_links(): void // XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX +function show_donation_stuff(): void +{ + $pgdp_wiki_url = "https://www.pgdp.net/wiki"; + $DPF_home_url = "$pgdp_wiki_url/Distributed_Proofreaders_Foundation"; + $DPF_donor_url = "$pgdp_wiki_url/DPFoundation:Information_for_Donors"; + + echo ""; + echo sprintf( + _("Thank you for supporting DP! You can also support the site by making a donation to the non-profit Distributed Proofreaders Foundation."), + $DPF_home_url + ); + echo "
\n"; + + echo "This book has changed from a BEGINNERS ONLY project to a MENTORS project.
+ +NOTE: You may find a list of which beginner has done which page, and the number of pages proofread by each, at the For Mentors page.
+ +Also, should you be issued a page that shows any of the Project Facilitators as the P1 proofreader, you may safely skip the feedback--unless, of course, we NEED it! That page will have been reclaimed, then proofread by one of us in order to move the project on to P2.
+ " . $comments; + } + } + if ($comments == '') { // Put in *something*, otherwise it'll probably look odd. $comments = ' '; diff --git a/stats/includes/member.inc b/stats/includes/member.inc index 5bc55c37e..cdc3ef17b 100644 --- a/stats/includes/member.inc +++ b/stats/includes/member.inc @@ -407,17 +407,24 @@ function showMbrTallySelector(int $u_id, ?string $tally_name): void function showMbrPageStats(User $user, string $tally_name): void { - global $ELR_round; - $users_tallyboard = new TallyBoard($tally_name, 'U'); $vitals = $users_tallyboard->get_vitals($user->u_id); $now = time(); - // If this is the entry-level round, use the user creation date - if ($tally_name == $ELR_round->id) { + // There are two special cases needed here: + // Firstly, the R* tally should span the time period from date_created to the site R* apocalypse + // Secondly, the P1 tally should start from the site P genesis, or date_created, whichever is later. + + $site_R_apocalypse = 1117576800; + $site_P_genesis = 1117720800; + + if ($tally_name == "R*") { $firstWorkInRound = $user->date_created; + $daysInRoundInteger = floor(($site_R_apocalypse - $firstWorkInRound) / 86400); + } elseif ($tally_name == "P1") { + $firstWorkInRound = ($user->date_created > $site_P_genesis) ? $user->date_created : $site_P_genesis; $daysInRoundInteger = floor(($now - $firstWorkInRound) / 86400); } else { $firstWorkInRound = get_first_granted_date($user->username, $tally_name); diff --git a/stats/pp_stats.php b/stats/pp_stats.php index 1180081b2..0866e1484 100644 --- a/stats/pp_stats.php +++ b/stats/pp_stats.php @@ -16,6 +16,8 @@ echo "" . _("You can sign up for notifications in the Event Subscriptions section of the Project Comments page when proofreading.") . "
"; -echo "This page has been temporarily disabled due to its high load on the system. We're working to fix this.
"; +exit; + +echo "This page has moved. Please update your bookmarks.
"; + +echo "The following link will get you to the new location with whatever parameters you passed in.
"; +$url = "$code_url/tools/page_browser.php?simpleHeader=true&mode=image&project=$projectid&imagefile=$imagefile"; +echo ""; diff --git a/tools/mentors/view_page_text_image.php b/tools/mentors/view_page_text_image.php new file mode 100644 index 000000000..91abea91a --- /dev/null +++ b/tools/mentors/view_page_text_image.php @@ -0,0 +1,22 @@ +$title"; + +echo "This page has moved. Please update your bookmarks.
"; + +echo "The following link will get you to the new location with whatever parameters you passed in.
"; +$url = "$code_url/tools/page_browser.php?mode=imageText&project=$projectid&imagefile=$imagefile"; +echo ""; diff --git a/tools/project_manager/displayimage.php b/tools/project_manager/displayimage.php new file mode 100644 index 000000000..dcbd3292a --- /dev/null +++ b/tools/project_manager/displayimage.php @@ -0,0 +1,22 @@ +$title"; + +echo "This page has moved. Please update your bookmarks.
"; + +echo "The following link will get you to the new location with whatever parameters you passed in.
"; +$url = "$code_url/tools/page_browser.php?mode=image&project=$projectid&imagefile=$imagefile"; +echo ""; diff --git a/tools/project_manager/remote_file_manager.php b/tools/project_manager/remote_file_manager.php index a74886d58..1e5ebd8e8 100644 --- a/tools/project_manager/remote_file_manager.php +++ b/tools/project_manager/remote_file_manager.php @@ -227,6 +227,7 @@ function do_showdir(string $action_message): void } echo "" . _("This page allows you to manage content in this uploads folder.") . "
\n"; + echo "" . _("The ~/dpscans directory is not backed up so please keep a local copy on your computer until they are no longer needed. And please remove files when they're no longer required.") . "
"; if (get_access_mode($pguser) == 'common') { show_message('info', _("Your files are located in a common, shared, area.\n";