change addressing tags by name in query string to addressing by id
This commit is contained in:
parent
c94e1329ca
commit
deb0d071bb
7 changed files with 9 additions and 10 deletions
|
@ -10,7 +10,7 @@
|
|||
<?php if ($_GET["tag"] != "*" &&
|
||||
$_GET["tag"] != "_"): ?>
|
||||
<div class="text doc-item doc-new-item">
|
||||
<a href="?action=new_item&tag=<?= $tag["Name"] ?>">
|
||||
<a href="?action=new_item&tag=<?= $tag["ID"] ?>">
|
||||
<div class="doc-item-text">
|
||||
<h2>Upload a new document</h2>
|
||||
</div>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
<ul>
|
||||
<?php
|
||||
foreach ($tags as $tag) {
|
||||
echo '<li><a href="?tag=' . $tag['name'] . "\">" . $tag['name'] . " (" . $tag['count'] . ")</a></li>";
|
||||
echo '<li><a href="?tag=' . $tag['id'] . "\">" . $tag['name'] . " (" . $tag['count'] . ")</a></li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<h3 class="doc-taglist">Tags:
|
||||
<?php
|
||||
foreach ($doc["tags"] as $tag) {
|
||||
echo '<li><a href="?tag=' . $tag["Name"] . "\">" . $tag["Name"] . "</a></li>";
|
||||
echo '<li><a href="?tag=' . $tag["ID"] . "\">" . $tag["Name"] . "</a></li>";
|
||||
}
|
||||
?>
|
||||
</h3>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
<?php
|
||||
foreach ($tags as $tag) {
|
||||
if ($tag['count'] > 0) {
|
||||
echo '<li><a href="?tag=' . $tag['name'] . "\">" . $tag['name'] . " (" . $tag['count'] . ")</a></li>";
|
||||
echo '<li><a href="?tag=' . $tag['id'] . "\">" . $tag['name'] . " (" . $tag['count'] . ")</a></li>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -51,7 +51,7 @@ class PileDB
|
|||
$tags = [];
|
||||
while ($row = $tags_ret->fetchArray(SQLITE3_NUM)) {
|
||||
array_push($tags, array(
|
||||
'href' => $row[0],
|
||||
'id' => $row[0],
|
||||
'name' => $row[1],
|
||||
'count' => $row[2]
|
||||
));
|
||||
|
|
|
@ -114,9 +114,9 @@ if (isset($_SESSION['ID'])) {
|
|||
} elseif ($_GET["tag"] == "_") {
|
||||
$docs = $db->listDocs(-1);
|
||||
} else {
|
||||
$tag = $db->findTag($_GET["tag"]);
|
||||
$tag = $db->fetchTag($_GET["tag"]);
|
||||
$docs = $db->listDocs($tag["ID"]);
|
||||
$doc_list_template->tag = $db->fetchTag($tag["ID"]);
|
||||
$doc_list_template->tag = $tag;
|
||||
}
|
||||
$doc_list_template->docs = $docs;
|
||||
$content = $doc_list_template->render('admin_doc_listing.php');
|
||||
|
|
|
@ -21,9 +21,8 @@ if (isset($_GET["item"])) {
|
|||
} elseif ($_GET["tag"] == "_") {
|
||||
$docs = $db->listDocs(-1);
|
||||
} else {
|
||||
$tagObj = $db->findTag($_GET["tag"]);
|
||||
$docs = $db->listDocs($tagObj["ID"]);
|
||||
$tag = $db->fetchTag($tagObj["ID"]);
|
||||
$tag = $db->fetchTag($_GET["tag"]);
|
||||
$docs = $db->listDocs($tag["ID"]);
|
||||
$tag["Description"] = $pd->text($tag["Description"]);
|
||||
$doc_list_template->tag = $tag;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue