All right, all right! I still don't feel like finishing these sections, but whatever (grumble)...
piro - fall 2007
-
Believe it or not, the (page) is in production and will be incorporated into the new site launch. We just are not including them as part of this beta test
+
Believe it or not, the (page) is in production and will be incorporated into the new site launch. We just are not including them as part of this beta test
(because they still need some work).
diff --git a/external.php b/external.php
index fa6b318..4148fe6 100644
--- a/external.php
+++ b/external.php
@@ -4,20 +4,20 @@ require_once 'frontend.inc.php';
class MTAPIi
{
-
+
private static $db_conn;
-
+
static function construct($db)
{
$db_conn = $db;
return mysqli_ping($db_conn);
}
-
+
static function destruct()
{
$db_conn = NULL;
}
-
+
#This just returns the current maximum comic
static function getNumStrips()
{
@@ -36,7 +36,7 @@ class MTAPIi
die("Invalid args: $comic $panel\n");
return false;
}
-
+
$script = build_panel_transcript($comic, $panel);
if(!$xml)
{
@@ -88,9 +88,9 @@ class MTAPIi
{
return false;
}
-
+
$panels = MTAPIi::getNumPanels($comic);
-
+
$query = 'SELECT DISTINCT speaker FROM transcript WHERE strip = '.(int)$comic;
$query .= ' AND panel = '.(int)$panel;
$query .= ' AND speaker NOT LIKE "#%" ';
@@ -99,7 +99,7 @@ class MTAPIi
$query .= " AND search != '' ";
}
$query .= 'ORDER BY speaker';
-
+
return query_to_array($query);
}
@@ -109,7 +109,7 @@ class MTAPIi
{
return false;
}
-
+
$query = 'SELECT DISTINCT speaker FROM transcript WHERE strip = '.(int)$comic;
$query .= ' AND speaker NOT LIKE "#%" ';
if($speakersOnly)
@@ -117,7 +117,7 @@ class MTAPIi
$query .= " AND search != '' ";
}
$query .= 'ORDER BY speaker';
-
+
return query_to_array($query);
}
@@ -161,7 +161,7 @@ class MTAPIi
$query = 'SELECT description FROM strip_t
JOIN strip ON strip.type = strip_t.id
WHERE strip.id = '.(int)$comic;
-
+
$qr = query_to_array($query);
return $qr[0];
}
@@ -178,11 +178,11 @@ class MTAPIi
JOIN strip_t ON meta.type = strip_t.id
JOIN strip ON strip.type = strip_t.id
WHERE strip.id = '.(int)$comic.' ORDER BY meta_t.id';
-
+
$qr = query_to_array($query);
return $qr;
}
-
+
static function getStrip($comic)
{
if(!validate_comic_id($comic))
@@ -192,26 +192,26 @@ class MTAPIi
$strip = load_strip($comic);
$strip['type'] = self::getStripTypeName($strip['type']);
$strip['number'] = self::getStripNumberInType($comic);
-
+
unset($strip['udate']);
-
+
return $strip;
}
-
+
static function getStripNumberInType($comic)
{
if(!validate_comic_id($comic))
{
return false;
}
-
+
$type = self::getStripType($comic);
-
+
$query = "SELECT count(*)
FROM strip_t JOIN strip ON strip_t.id = strip.type
WHERE strip.id < {$comic}+1
AND strip.type = {$type}";
-
+
$qr = query_to_array($query);
return $qr[0];
}
@@ -227,7 +227,7 @@ class MTAPIi
JOIN strip_t ON meta.type = strip_t.id
JOIN strip ON strip.type = strip_t.id
WHERE strip.id = '.(int)$comic.' ORDER BY meta_t.name';
-
+
$qr = query_to_array($query);
return $qr;
}
@@ -238,12 +238,12 @@ class MTAPIi
{
return false;
}
-
+
$query = 'SELECT meta_t.id FROM meta_t
JOIN meta ON meta_t.id = meta.meta
JOIN strip_t ON meta.type = strip_t.id
WHERE strip_t.id = '.(int)$type.' ORDER BY meta_t.id';
-
+
$qr = query_to_array($query);
return $qr;
}
@@ -254,12 +254,12 @@ class MTAPIi
{
return false;
}
-
+
$query = 'SELECT meta_t.name FROM meta_t
JOIN meta ON meta_t.id = meta.meta
JOIN strip_t ON meta.type = strip_t.id
WHERE strip_t.id = '.(int)$type.' ORDER BY meta_t.name';
-
+
$qr = query_to_array($query);
return $qr;
}
@@ -270,7 +270,7 @@ class MTAPIi
{
return false;
}
-
+
$query = 'SELECT strip.id FROM strip WHERE strip.type = '.(int)$type.' ORDER BY strip.id';
$qr = query_to_array($query);
return $qr;
@@ -283,7 +283,7 @@ class MTAPIi
{
return false;
}
-
+
$query = 'SELECT strip.id FROM strip
JOIN strip_t ON strip.type = strip_t.id
JOIN meta ON strip_t.id = meta.type
diff --git a/frontend.inc.php b/frontend.inc.php
index 6bce86d..ea38c26 100644
--- a/frontend.inc.php
+++ b/frontend.inc.php
@@ -40,7 +40,7 @@ function get_num_panels($comic)
{
return false;
}
-
+
$rs = mysqli_query($link,'SELECT MAX(panel) FROM transcript WHERE strip = '.(int)$comic);
return current(mysqli_fetch_row($rs));
}
@@ -48,9 +48,9 @@ function get_num_panels($comic)
function build_panel_transcript($comic, $panel)
{
$query = 'SELECT speaker, speech FROM transcript
- WHERE strip = '.(int)$comic.' AND panel = '.(int)$panel.'
+ WHERE strip = '.(int)$comic.' AND panel = '.(int)$panel.'
AND speaker NOT LIKE "#%" ORDER BY line';
-
+
$qr = query_to_nested($query);
return $qr;
}
@@ -65,7 +65,7 @@ function query_to_nested($query)
$ret[]= $row;
}
mysqli_free_result($rs);
-
+
return $ret;
}
@@ -81,7 +81,7 @@ function query_to_array($query, $col=0)
$ret[]= $row[0];
}
mysqli_free_result($rs);
-
+
return $ret;
}
@@ -141,7 +141,7 @@ function conditional_exit($mtime)
{
if(!PERFORM_CONDITIONAL_CACHE)
return;
-
+
$f_date = gmdate( 'D, d M Y H:i:s T', $mtime );
header("Last-Modified: $f_date");
@@ -183,17 +183,17 @@ function mtdie($errno, $errstr, $errfile, $errline, $errcontext) {
}
error_log( $message, 0 ); // Log to Syslog
-
+
$message .= "\r\n\r\nBacktrace:";
$backtrace = array_reverse(debug_backtrace());
$i=2;
$message .= "\r\n1: " . $err_context . " at $errfile:$errline";
foreach($backtrace as $k=>$call) {
- $message .= "\r\n" . str_pad("$i:", $i+4 ) . $call['function'] . '( ' . implode(', ', $call['args']) . ' ) at ' . $call['file'] . ':' . $call['line'];
+ $message .= "\r\n" . str_pad("$i:", $i+4 ) . $call['function'] . '( ' . implode(', ', $call['args']) . ' ) at ' . $call['file'] . ':' . $call['line'];
$i++;
}
$message .= "\r\n";
-
+
$message .= "\r\nRequest Details:"
. "\r\nscript_url: " . $_SERVER["SCRIPT_URL"]
. "\r\nquery_string: " . $_SERVER["QUERY_STRING"]
@@ -287,7 +287,7 @@ function pagehead($caller, $title = 'relax, we understand j00', $style='')
-
+
@@ -299,7 +299,7 @@ function pagehead($caller, $title = 'relax, we understand j00', $style='')
-
+
-
+
-
+
/www/delivery/spcjs.php?id=1'> */ ?>
@@ -360,7 +360,7 @@ function pagefoot()
all rights reserved.