Show a list of all pages citing a given page.
The appearence of the list seems like this of the category macro.
Another way to do category. Just add the name of page, say CategoryPage, at the end of another one, say NewPage.
If CategoryPage calls the macro
the name of NewPage will be automatically added to CategoryPage with the last modification information.
Adventage, one page can belong to several category. Just add CategoryPageOne, CategoryPageTwo, ... at the end if those CategoryPage<n> use the macro.
in parse/macro, add the following function
// Prepare a list of pages and those pages they link to.
function view_macro_citing($args)
{
global $pagestore, $LkTbl, $PgTbl;
$lastpage = '';
$text = '';
if (empty($args)) { return ""; }
$q1 = $pagestore->dbh->query("SELECT $PgTbl.time, $LkTbl.page, $PgTbl.author, $PgTbl.username, $PgTbl.comment FROM $LkTbl, $PgTbl " .
"WHERE $LkTbl.link=\"$args\" AND $LkTbl.page = $PgTbl.title ORDER BY $LkTbl.page");
while(($result = $pagestore->dbh->result($q1)))
{
if($lastpage != $result[1])
{
if($lastpage != '')
{ $text = $text . "\n"; }
$text .= html_category($result[0], $result[1], $result[2], $result[3], $result[4]) . html_newline();
$lastpage = $result[1];
}
}
return $text;
}
In lib/defaults.php, add a line
'Citing' => 'view_macro_citing',
to $ViewMacroEngine array. In other words, replace (more or less at line 250)
$ViewMacroEngine = array(
'!' => 'view_macro_category',
'!!' => 'view_macro_short_category',
'Anchor' => 'view_macro_anchor',
'Transclude' => 'view_macro_transclude',
'PageSize' => 'view_macro_pagesize',
'LinkTable' => 'view_macro_linktab',
'OrphanedPages' => 'view_macro_orphans',
'WantedPages' => 'view_macro_wanted',
'PageLinks' => 'view_macro_outlinks',
'PageRefs' => 'view_macro_refs',
'phpBB' => 'view_macro_phpbb_post'
);
by
$ViewMacroEngine = array(
'!' => 'view_macro_category',
'!!' => 'view_macro_short_category',
'Anchor' => 'view_macro_anchor',
'Transclude' => 'view_macro_transclude',
'PageSize' => 'view_macro_pagesize',
'LinkTable' => 'view_macro_linktab',
'Citing' => 'view_macro_citing',
'OrphanedPages' => 'view_macro_orphans',
'WantedPages' => 'view_macro_wanted',
'PageLinks' => 'view_macro_outlinks',
'PageRefs' => 'view_macro_refs',
'phpBB' => 'view_macro_phpbb_post'
);
Hi, you have a macro for PHPBB-Posts? Is this public? :)
Alex