function getmodule(){ # The index directory where all modules man pages are $fullindex_directory="grass64/manuals/html64_user"; # The index page with complete list of modules $fullindex= $fullindex_directory . '/full_index.html' ; # Type of choice of module: 'random' is different module each time page is loaded while 'day' is daily module. //$type='random'; $type='day'; ob_start(); include($fullindex); $buffer= ob_get_contents(); ob_end_clean(); $a=explode("\n", $buffer); $cc=0; if($type=='random'){ $ra=rand(0,1000); while(substr($a[$ra], 0, 27)!="r.average Finds the average of values in a cover map within areas assigned the same category value in a user-specified base map.'; break; } } } else if($type=='day'){ //$ra=date("z")+75; $ra=date("z")+$ra=rand(100,180); while(substr($a[$ra], 0, 27)!="20){ $a[$ra]='r.average Finds the average of values in a cover map within areas assigned the same category value in a user-specified base map.'; break; } } } else $a[$ra]="Error in module"; $what=array("", "", ""); $with=array("", "", ""); return "" . str_replace($what, $with, $a[$ra]) . "
"; } echo getmodule(); ?>