This is a comment on Internal Links using PageID, posted by coffe1nk at 10/19/2022 03:03
View source for Re: Internal Links using PageID
I created this simple action code
%%<?php
// {{link pageid=}}
if (!defined('IN_WACKO'))
{
exit;
}
if (!isset($pageid)) $pageid = '';
if (!isset($inline)) $inline = '0';
$pages = $this->db->load_all(
"SELECT tag, title " .
"FROM " . $this->db->table_prefix . "page " .
"WHERE page_id IN ( " . $pageid . ")" .
"ORDER BY title");
if ($inline == '0') {
echo '<style type="text/css" scoped>ul + br {display: none;} ul,ol {margin-top: 10px;margin-bottom: 10px;}</style>';
echo '<ul>';
foreach ($pages as $_page)
{
echo '<li>' . $this->link('/' . $_page['tag'], '', $_page['title']) . '</li>';
}
echo '</ul>';
} else {
echo $this->link('/' . $pages[0]['tag'], '', $pages[0]['title']);
}%%
and then call it in wikipage
%%{{link pageid=313}}%%