This is an ex post facto rendering of pq6 in its various versions in

svn, so that changes will be trackable thataway.

As checked in, right here, this is PQ 6.0
This commit is contained in:
Eric Fredricksen committed 2006-12-24 16:42:50 +00:00
commit d3bba84017
184 files changed
+12251

No files matched your search

+5
View File
@@ -0,0 +1,5 @@
order deny,allow
deny from all
allow from .telocity.com
allow from .google.com
allow from .mclass.broadwing.net
+56
View File
@@ -0,0 +1,56 @@
<?
include('../log.php');
include('../db.php');
include('../util.php');
?>
<html>
<head>
<title>Progress Quest Admin</title>
<style>
<? include('../pq.css') ?>
</style>
</head>
<body bgcolor=#ffffff>
<font color=#404000>
<br>
<i>quamvis progressio</i>
<p>
<form>
<input type=text name=query size=80 height=5em value="<? echo(stripslashes($query)) ?>">
<input type=submit value=Go>
</form>
<?
if (isset($query)) {
$query = stripslashes($query);
$query2 = htmlspecialchars($query);
echo("<b>$query2</b><br>");
$result = mysql_query($query) or die(mysql_error());
if (is_bool($result)) {
echo($result ? 'OK' : 'FAILED');
}
else {
print "<table><tr>\n";
for ($i = 0; $i < mysql_num_fields($result); $i++)
print "<th>" . mysql_field_name($result,$i) . "\n";
while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
print "\t<tr>\n";
foreach ($line as $col_value) {
print "\t\t<td>";
if (0 == strncmp($col_value, "http://", 7))
print "<a href=$col_value>$col_value</a>";
else
print $col_value;
print "</td>\n";
}
print "\t</tr>\n";
}
print "</table>\n";
}
}
?>
</body></html>
+7
View File
@@ -0,0 +1,7 @@
<?
include('../db.php');
include('../util.php');
heading();
footer();
?>
+106
View File
@@ -0,0 +1,106 @@
<?
include('../log.php');
include('../db.php');
include('../util.php');
mysql_query("
CREATE TABLE IF NOT EXISTS pqquotes (
num INTEGER NOT NULL AUTO_INCREMENT,
quote TEXT DEFAULT NULL,
source TEXT DEFAULT NULL,
stamp TIMESTAMP DEFAULT NULL,
PRIMARY KEY (num) )
")
or die(mysql_error());
if (isset($cmd)) {
$quote = arg($quote);
$source = arg($source);
$loc = "Location: http://progressquest.com/quote-admin.php?list=1";
if (isset($num))
$loc = $loc . "&disp=$num";
$num = arg($num);
if ($cmd == "add")
mysql_query("INSERT INTO pqquotes (quote,source) VALUES ('$quote','$source')") or die(mysql_error());
if ($cmd == "update")
mysql_query("UPDATE pqquotes SET quote='$quote', source='$source' WHERE num=$num") or die(mysql_error());
if ($cmd == "delete")
mysql_query("DELETE FROM pqquotes WHERE num=$num") or die(mysql_error());
header($loc);
exit();
}
$result = mysql_query("SELECT COUNT(*) FROM pqquotes") or die(mysql_error());
$count = mysql_result($result, 0);
?>
<h2> PQ Quote Admin</h2>
<a href=/quote-admin.php?list=1>List all <? echo($count) ?></a>
<p>
<form>
<?
if (isset($num))
$disp = $num;
if (isset($disp)) {
$result = mysql_query("SELECT num,quote,source FROM pqquotes WHERE num=$disp") or die(mysql_error());
if ($row = mysql_fetch_row($result)) {
echo("<b>Quote $disp</b>");
quotation($row[1], $row[2]);
if (isset($num)) {
$quote = $row[1];
$source = $row[2];
echo("<input type=hidden name=num value=$num>");
}
}
}
?>
<p>
Quote<br>
<textarea name=quote rows=8 cols=80>
<? echo($quote) ?>
</textarea>
<br>
Source<br>
<textarea name=source rows=3 cols=80>
<? echo($source) ?>
</textarea>
<br>
<input type=submit name=cmd value=add>
<? if (isset($num)): ?>
<input type=submit name=cmd value=update>
<input type=submit name=cmd value=delete>
<? endif; ?>
</form>
<p>
<?
if ($list) {
echo("<table style='border: solid 1'>");
$result = mysql_query("SELECT num,quote,source FROM pqquotes ORDER BY num")or die(mysql_error());
while ($row = mysql_fetch_row($result)) {
$num = $row[0];
$quote = $row[1];
$source = $row[2];
if (strlen($quote) > 50)
$quote = substr($quote,0,47) . "...";
if (strlen($source) > 50)
$source = substr($source,0,47) . "...";
$quote = htmlspecialchars($quote);
$source = htmlspecialchars($source);
echo("<tr><td><a href=/quote-admin.php?num=$num>$num</a><td>$quote<td>$source");
}
echo("</table>");
}
?>
+69
View File
@@ -0,0 +1,69 @@
<?
include('../log.php');
include('../db.php');
include('../util.php');
?>
<html>
<head>
<title>Progress Quest Referers</title>
<style>
<? include('../pq.css') ?>
</style>
</head>
<body bgcolor=#ffffff>
<font color=#404000>
<br>
<i>PQ Referers</i>
<p>
<?
if (!isset($host)) {
print "<b>Hosts</b>";
$query = <<<EOD
select
count(*) as count,
left(substring(referer,8),instr(substring(referer,8),'/')-1) as referer
from access_log
where instr(referer,'progressquest.com')<=0
group by referer
order by count desc
EOD;
} else {
print "<b>$host</b> (<a href=referers.php>list all hosts</a>)<p>";
$query = <<<EOD
select
count(*) as count,
referer
from access_log
where left(substring(referer,8),instr(substring(referer,8),'/')-1) = '$host'
group by referer
order by referer
EOD;
}
$query2 = htmlspecialchars($query);
$result = mysql_query($query) or die(mysql_error());
print "<table><tr>\n";
for ($i = 0; $i < mysql_num_fields($result); $i++)
print "<th>" . mysql_field_name($result,$i) . "\n";
while ($row = mysql_fetch_row($result)) {
$count = $row[0];
$referer = $row[1];
print "<tr><td>$count<td>";
if (0 == strncmp($referer, "http://", 7))
print "<a href=$referer>$referer</a>";
else if (!isset($host))
print "<a href=referers.php?host=$referer>$referer</a>";
else
print $referer;
}
print "</table>\n";
?>
</body></html>