sub expand_vars
{
 my ($line,$entry) = @_;

	# Above: Get our two parameters:

	# 1. The data to filter (required).
	# 2. An optional entry number (used with %%ENTRY%%).

	# N.B. The second parameter is only used in a few instances (see manual).


	# Now we just have to replace our special content tags with the neccessary information.
	# Each of these tags is discussed in the user's manual, so we won't go into detail here.

 $line =~ s!\Q%%NAVIGATION%%\E!expand_vars(getfile($navfile,1),'')!ge;
 $line =~ s!\Q%%ENTRY%%\E!$entry!g;
 $line =~ s!\Q%%TITLE%%\E!$pagetitle!g;
 $line =~ s!\Q%%DATE%%\E!$datenow!g;
 $line =~ s!\Q%%TIME%%\E!$timenow!g;
 $line =~ s!\Q%%SCRIPT_URL%%\E!http://$host$scripturl!g;
 $line =~ s!\Q%%ADD_URL%%\E!http://$host$scripturl?action=showform!g;
 $line =~ s!\Q%%VIEW_URL%%\E!http://$host$scripturl?action=view!g;
 $line =~ s!\Q%%SEARCH_URL%%\E!http://$host$scripturl?action=search!g;
 $line =~ s!\Q%%COUNTRIES%%\E!getfile($countriesfile,1)!ge;
 $line =~ s!\Q%%SIGNATURE%%\E!$pagesig!g;
 $line =~ s!\Q%%SORTMENU%%\E!prepare_sort_menu()!ge;

 # Now we just send back the filtered data:
 return $line;
}
1;
