|
Cookbook /
AutomaticPageRefreshSummary: How to create pages that refresh automatically.
Version: 2006-09-26
Prerequisites: pmwiki-2.0 (and possibly earlier)
Status: stable
Maintainer:
Categories: Layout
DescriptionThis recipe makes it possible for a page to refresh at set intervals, or by an interval set in a ?refresh=nn addition to a page URL. NotesThe following will cause a browser to refresh the page every 30 seconds: if ($action == 'browse')@]
$HTMLHeaderFmt['refresh'] =
"<meta http-equiv='Refresh' Content='30; URL={\$PageUrl}' />";
It can be done sitewide in local/config.php (probably not recommended), or in a per-page or per-group customization file. Or, one could use the following customization to add a '?refresh=nn' option to all pages: if (@$_GET['refresh']) {
$r = $_GET['refresh'];
$HTMLHeaderFmt['refresh'] =
"<meta http-equiv='Refresh' Content='$r; URL={\$PageUrl}?refresh=$r' />";
}
As a demonstration, this latter version is enabled at: Test.Refresh. Release Notes
CommentsSee AlsoContributors |