comanche: move 'webpage' declaration to the first parser pass so it is set when content loads.
This commit is contained in:
		| @@ -79,6 +79,14 @@ function comanche_parser(&$a, $s, $pass = 0) { | ||||
| 		if($cnt) | ||||
| 			$a->layout['theme'] = trim($matches[1]); | ||||
|  | ||||
| 		$cnt = preg_match_all("/\[webpage\](.*?)\[\/webpage\]/ism", $s, $matches, PREG_SET_ORDER); | ||||
| 		if($cnt) { | ||||
| 			// only the last webpage definition is used if there is more than one | ||||
| 			foreach($matches as $mtch) { | ||||
| 				$a->layout['webpage'] = comanche_webpage($a,$mtch[1]); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 	} | ||||
| 	else { | ||||
| 		$cnt = preg_match_all("/\[region=(.*?)\](.*?)\[\/region\]/ism", $s, $matches, PREG_SET_ORDER); | ||||
| @@ -88,13 +96,6 @@ function comanche_parser(&$a, $s, $pass = 0) { | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		$cnt = preg_match_all("/\[webpage\](.*?)\[\/webpage\]/ism", $s, $matches, PREG_SET_ORDER); | ||||
| 		if($cnt) { | ||||
| 			// only the last webpage definition is used if there is more than one | ||||
| 			foreach($matches as $mtch) { | ||||
| 				$a->layout['webpage'] = comanche_webpage($a,$mtch[1]); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -1309,13 +1309,13 @@ function generate_map($coord) { | ||||
| 	$coord = str_replace(array(',','/','  '),array(' ',' ',' '),$coord); | ||||
| 	$arr = array('lat' => trim(substr($coord,0,strpos($coord,' '))), 'lon' => trim(substr($coord,strpos($coord,' ')+1)), 'html' => ''); | ||||
| 	call_hooks('generate_map',$arr); | ||||
| 	return $arr['html']; | ||||
| 	return (($arr['html']) ? $arr['html'] : $coord); | ||||
| } | ||||
|  | ||||
| function generate_named_map($location) { | ||||
| 	$arr = array('location' => $location, 'html' => ''); | ||||
| 	call_hooks('generate_named_map',$arr); | ||||
| 	return $arr['html']; | ||||
| 	return (($arr['html']) ? $arr['html'] : $location); | ||||
| } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -1 +1 @@ | ||||
| 2015-03-24.981 | ||||
| 2015-03-25.982 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user