Permalink
Browse files

More binary updates (full text viewing, insert tab).

  • Loading branch information...
1 parent c2ae10d commit e60ce3a415f60f3362eea5d173e5d8da6cf4be62 calvinlough committed Sep 6, 2008
Showing with 530 additions and 483 deletions.
  1. +29 −1 ajaxfulltext.php
  2. +1 −0 css/common.css
  3. +1 −1 edit.php
  4. +9 −2 includes/class/Sql.php
  5. +471 −1 includes/common.php
  6. +0 −476 includes/helpers.php
  7. +18 −1 insert.php
  8. +1 −1 serve.php
View
@@ -29,13 +29,41 @@
}
}
+if ($conn->getAdapter() == "mysql")
+{
+ $structureSql = $conn->describeTable($table);
+
+ while ($structureRow = $conn->fetchAssoc($structureSql))
+ {
+ $types[$structureRow['Field']] = $structureRow['Type'];
+ }
+}
+
if ($conn->rowCount($sql))
{
$row = @$conn->fetchAssoc($sql);
foreach ($row as $key => $value)
{
echo "<div class=\"fulltexttitle\">" . $key . "</div>";
- echo "<div class=\"fulltextbody\">" . nl2br(htmlentities($value, ENT_QUOTES, 'UTF-8')) . "</div>";
+ echo "<div class=\"fulltextbody\">";
+
+ $curtype = $types[$key];
+
+ if (strpos(" ", $curtype) > 0)
+ {
+ $curtype = substr($curtype, 0, strpos(" ", $curtype));
+ }
+
+ if ($value && ((isset($binaryDTs) && in_array($curtype, $binaryDTs)) || stristr($types[$key], "binary") !== false))
+ {
+ echo "0x" . bin2hex($value);
+ }
+ else
+ {
+ echo nl2br(htmlentities($value, ENT_QUOTES, 'UTF-8'));
+ }
+
+ echo "</div>";
}
}
View
@@ -666,6 +666,7 @@ padding: 5px 5px 0 8px;
overflow: auto;
min-height: 100px;
padding-right: 5px;
+word-break: break-all;
}
.mainr {
width: 13px;
View
@@ -22,7 +22,7 @@
if (isset($db))
$conn->selectDB($db);
-if (isset($db))
+if (isset($table))
$structureSql = $conn->describeTable($table);
if (isset($_POST['editParts']))
@@ -291,13 +291,20 @@ function listCollation()
}
}
- function insertId($resultSet)
+ function insertId($resultSet = "")
{
if ($this->conn)
{
if ($this->adapter == "mysql")
{
- return mysql_insert_id($resultSet);
+ if ($resultSet)
+ {
+ return mysql_insert_id($resultSet);
+ }
+ else
+ {
+ return mysql_insert_id();
+ }
}
else if ($this->adapter == "sqlite")
{
Oops, something went wrong.

0 comments on commit e60ce3a

Please sign in to comment.