diff options
author | aleteoryx <alyx@aleteoryx.me> | 2024-11-12 17:32:37 -0500 |
---|---|---|
committer | aleteoryx <alyx@aleteoryx.me> | 2024-11-12 17:32:37 -0500 |
commit | 4fb02a34f4f6e3dd4a9c55a604fffc65da368c14 (patch) | |
tree | 8cf342d547100f6fed8de217d58d1041a063d406 | |
parent | 5fe4a07f496ad6394be4f7fc4661b55f7102ea42 (diff) | |
download | rss_dot_php-4fb02a34f4f6e3dd4a9c55a604fffc65da368c14.tar.gz rss_dot_php-4fb02a34f4f6e3dd4a9c55a604fffc65da368c14.tar.bz2 rss_dot_php-4fb02a34f4f6e3dd4a9c55a604fffc65da368c14.zip |
link target0.0.1
-rw-r--r-- | rss.php | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -44,6 +44,13 @@ $config["date_fmt"] = "l, M jS, Y, H:i T"; $config["timezone"] = new DateTimeZone('UTC'); +/// <a target=? > +/// +/// What to set for the target= attribute on generated links. +/// _top will redirect the main tab, _blank wil make a nwe tab +$config["link_target"] = "_top"; + + /* --- CODE - DO NOT TOUCH --- */ function load_rss(string $uri, string $linkrel = "alternate"): array { @@ -198,10 +205,10 @@ $base = parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH); <?php endif; foreach ($combined as $entry): ?> <article> - <h1><a href="<?= htmlentities($entry['link']) ?>"><?= htmlentities($entry['title'] ?? "[[[No Title]]]") ?></a></h1> + <h1><a target="<?= htmlentities($config['link_target']) ?>" href="<?= htmlentities($entry['link']) ?>"><?= htmlentities($entry['title'] ?? "[[[No Title]]]") ?></a></h1> <span class="source" data-source="<?= htmlentities($entry['source']) ?>"> <?php if ($entry['home']): ?> - <a href="<?= htmlentities($entry['home']) ?>"><?= htmlentities($entry['source']) ?></a> + <a target="<?= htmlentities($config['link_target']) ?>" href="<?= htmlentities($entry['home']) ?>"><?= htmlentities($entry['source']) ?></a> <?php else: ?> <?= htmlentities($entry['source']) ?> <?php endif; ?> |