version 2.x.x - Griffin Chapel ()
+ Better logging
+ + New home screen layout
version 2.8.2 - Dragon Chapel (2023-09-14)
border-top: 1px solid #cccccc;
}
+.ddTags:not(:last-child) {
+ margin-bottom: inherit;
+}
+
/* overwrites */
.section {
padding-top: 1.5rem;
# add stuff
$this->_image();
+ $this->_tags();
+ $this->_categories();
}
} catch (Exception $e) {
Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
&& isset($data['title']) && isset($data['hash']) && isset($data['description']) && isset($data['image'])) {
$this->_data = $data;
$this->_image();
+ $this->_tags();
+ $this->_categories();
}
return $this->_data;
public function latestLinks(string $limit="5"): array {
$ret = array();
- $queryStr = "SELECT `title`, `link` FROM `".DB_PREFIX."_link` AS t";
+ $queryStr = "SELECT `hash` FROM `".DB_PREFIX."_link` AS t";
$queryStr .= " WHERE ".$this->_decideLinkTypeForQuery();
$queryStr .= " ORDER BY `created` DESC";
if(!empty($limit)) {
try {
$query = $this->DB->query($queryStr);
if(!empty($query) && $query->num_rows > 0) {
- $ret = $query->fetch_all(MYSQLI_ASSOC);
+ while($result = $query->fetch_assoc()) {
+ $linkObj = new Link($this->DB);
+ $ret[] = $linkObj->loadShortInfo($result['hash']);
+
+ }
}
} catch (Exception $e) {
Summoner::sysLog("[ERROR] ".__METHOD__." mysql catch: ".$e->getMessage());
return $ret;
}
-
/**
* amount of tags
*
$existingCategories = $Management->categories();
$existingTags = $Management->tags();
}
-$latestLinks = $Management->latestLinks(20);
-$orderedCategories = $Management->categoriesByDateAdded();
+$latestLinks = $Management->latestLinks(50);
<div class="content">
<h4><a href="index.php?p=overview&m=all"><?php echo $T->t('home.last.added'); ?></a></h4>
<?php if(!empty($latestLinks)) { ?>
- <div class="tags">
+ <dl>
<?php foreach ($latestLinks as $ll) { ?>
- <a class="tag is-link" href="<?php echo $ll['link']; ?>" target="_blank"><?php echo $ll['title']; ?></a>
+ <dt>
+ <a href="<?php echo $ll['link']; ?>" target="_blank"><?php echo $ll['title']; ?></a>
+ <a href="index.php?p=linkinfo&id=<?php echo $ll['hash']; ?>"><i class="ion-md-information-circle-outline"></i></a>
+ </dt>
+ <dd class="tags ddTags">
+ <?php foreach ($ll['tags'] as $tid=>$tname) {
+ echo '<a href="index.php?p=overview&m=tag&id='.$tid.'" class="tag is-white" title="'.$T->t('view.tag').'">'.$tname.'</a>';
+ } ?>
+ <?php foreach ($ll['categories'] as $cid=>$cname) {
+ echo '<a href="index.php?p=overview&m=category&id='.$cid.'" class="tag is-white" title="'.$T->t('view.category').'">'.$cname.'</a>';
+ } ?>
+ </dd>
<?php } ?>
- </div>
-<?php } ?>
- </div>
- </div>
- </div>
-</section>
-
-
-<section class="section">
- <div class="columns is-multiline">
-<?php
- if(!empty($orderedCategories)) {
- foreach ($orderedCategories as $k=>$v) {
- $links = $Management->linksByCategory($v['id']);
-?>
- <div class="column is-one-quarter">
- <div class="content">
- <h4><a href="?p=overview&m=category&id=<?php echo urlencode($v['id']); ?>"><?php echo $v['name']; ?></a></h4>
- <ul>
-<?php foreach ($links['results'] as $link) { ?>
- <li><a class="" href="<?php echo $link['link']; ?>" target="_blank"><?php echo $link['title']; ?></a></li>
+ </dl>
<?php } ?>
- </ul>
</div>
</div>
-<?php
- }
- }
-?>
</div>
</section>