forked from DistributedProofreaders/ppwb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathppsmq.php
More file actions
85 lines (75 loc) · 2.61 KB
/
ppsmq.php
File metadata and controls
85 lines (75 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php
output_header();
output_content();
output_footer();
function output_content()
{
echo <<<MENU
<p>The ppsmq program attempts to convert a file with straight quotes into one
with curly quotes. It can work with either a plain text file or an HTML
file. It only makes changes it's pretty certain are
correct. It will flag those it is uncertain about with a "@"
character. It will leave alone any straight quotes it can't reliably
classify.</p>
<p>Even if you don't intend to convert your book to curly quotes,
anything that this program flags is often an error and should
be investigated.</p>
<p>If you are converting,
once you've run the program and downloaded the result file, search
everywhere for "@" and manually enter the correct punctuation, then
remove the "@" flag. Then search for straight double quotes (there
should be none) and straight single quotes (there usually are
some).</p>
<p>If you run this on an HTML file, you will find it converts all
single quotes inside HTML tags to "∮" and all double quotes in tags to "∯"
to protect them. The process is the same as in the previous paragraph.
For HTML, there is an added step to replace all "∮" with single quotes and
all "∯" with double quotes to restore the HTML tags.</p>
<form target="_blank" action="ppsmq-action.php" method="POST" enctype="multipart/form-data">
<table>
<tr>
<td style='text-align:right'><label for='userfile'>User text file </label></td>
<td><input type="file" name="userfile" autocomplete=off /></td>
</tr>
</table>
<div style='margin-top:1em; margin-bottom:0em;'><input type="submit" value="Submit" name="upload"/></div>
</form>
MENU;
}
function output_header()
{
echo <<<HEAD
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name=viewport content="width=device-width, initial-scale=1">
<title>PP Workbench: ppsmq</title>
<link rel="stylesheet" type="text/css" href="rfrank.css">
</head>
<body>
<div id="header" class='hsty'>ppsmq</div>
<hr style='border:none; border-bottom:1px solid silver;'>
HEAD;
}
function output_footer()
{
echo <<<FOOT
<div id="footer">
<hr style='border:none; border-bottom:1px solid silver;'>
<table summary="" width="100%">
<tr>
<td align="left">
<a style='font-size:70%' href='index.php'>MAIN PAGE</a>
|
<a style='font-size:70%' href='techinfo-ppsmq.php'>TECH INFO</a>
</td>
<td align="right">
<a style='font-size:70%' href='mailto:rfrank@rfrank.net'>CONTACT</a></td>
</tr>
</table>
</div>
</body>
</html>
FOOT;
}