AutomaticPageRefresh-Talk

Summary: Talk page for AutomaticPageRefresh.
Maintainer: Petko
Users: (View? / Edit)

This space is for User-contributed commentary and notes. Please include your name and a date along with your comment.

Comments

refresh url, with the ability to re-visit an anchor

In the example above, it's not possible to continually refresh Group/Name#anchor - it will always refresh to Group/Name, and drop the anchor. The code below offers an optional anchor= parameter, so that refreshing will always return you to the part of the page you desire:

if (@$_GET['refresh']) {
	# determine duration of refresh
	$r = $_GET['refresh'];
	# determine an anchorname
	if (@$_GET['anchor']) {
		$a = "#".$_GET['anchor'];	    # get the specified anchorname
		$aQ = "&anchor=".$_GET['anchor'];   # make sure to call the same anchor on the next page
	}
	$HTMLHeaderFmt['refresh'] =
	"<meta http-equiv='Refresh' Content='$r; URL={\$PageUrl}?refresh=$r$aQ$a' />";
}

overtones99 September 02, 2009, at 08:56 PM

Talk page for the AutomaticPageRefresh recipe (users?).