",$tmp);
+ if ($tmp2 === false) { return false; }
+ $row = substr($rawHTML,$tmp,$tmp2-$tmp);
+ $pattern = "/| | | | | ",$tmp);
+ if ($tmp === false) { return false; }
+ $tmp++;
+ $tmp2 = strpos(strtoupper($row),"",$idx)+5;
+ $rowIdx++;
+
+ /* Now parse the rest of the rows. */
+ $tmp = strpos($upperHTML," | ",$idx);
+ if ($tmp2 === false) { return false; }
+ $table = substr($rawHTML,$tmp,$tmp2-$tmp);
+
+ while ($tmp = strpos(strtoupper($table),"
",$tmp);
+ if ($tmp === false) { return false; }
+ $tmp++;
+ $tmp2 = strpos(strtoupper($row),"")+5);
+ $rowIdx++;
+ }
+ return $aryData;
+ }
+
+ /*
+ Static method table_into_xml()
+ Generic function to return xml dataset from HTML table data
+ rawHTML: the page source
+ needle: optional string to start parsing source from
+ allowedTags: list of tags to NOT strip from data, e.g. ""
+ */
+ function table_into_xml($rawHTML,$needle="",$needle_within=0,$allowedTags="") {
+ if (!$aryTable = http::table_into_array($rawHTML,$needle,$needle_within,$allowedTags)) { return false; }
+ $xml = "\n";
+ $xml .= "\n";
+ $rowIdx = 0;
+ foreach ($aryTable as $row) {
+ $xml .= "\t\n";
+ $colIdx = 0;
+ foreach ($row as $col) {
+ $xml .= "\t\t".trim(utf8_encode(htmlspecialchars($col)))."\n";
+ $colIdx++;
+ }
+ $xml .= "\t
\n";
+ $rowIdx++;
+ }
+ $xml .= "
";
+ return $xml;
+ }
+}
+
+?>
diff --git a/oss/vtiger/trunk/class_http/image_cache.php b/oss/vtiger/trunk/class_http/image_cache.php
new file mode 100644
index 00000000..12126730
--- /dev/null
+++ b/oss/vtiger/trunk/class_http/image_cache.php
@@ -0,0 +1,24 @@
+
+ (You must url encode the url within the src attribute.)
+*/
+
+/*
+Include the http class. Modify path according to where you put the class
+file.
+*/
+require_once('class_http.php');
+
+$h = new http();
+$h->fetch($_GET['url'], $_GET['ttl']);
+header("Content-Type: image/jpeg");
+echo $h->body;
+?>