mnhgfrewsdfghgfdsasdfghji
This commit is contained in:
		
							
								
								
									
										19
									
								
								index.php
									
									
									
									
									
								
							
							
						
						
									
										19
									
								
								index.php
									
									
									
									
									
								
							@@ -22,16 +22,6 @@ $page = basename($_SERVER['QUERY_STRING']);
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
$nav = include_ob("$template_dir/navigation.html");
 | 
					$nav = include_ob("$template_dir/navigation.html");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$page_regex = '/<!--PAGENAME=(.*?)-->/';
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if(preg_match($page_regex, $htmlWithComments, $matches)){
 | 
					 | 
				
			||||||
    $page_name = $matches[1];
 | 
					 | 
				
			||||||
    print_r($matches);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
else{
 | 
					 | 
				
			||||||
    $page_name = ucfirst($page);
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if(empty($page)){
 | 
					if(empty($page)){
 | 
				
			||||||
@@ -75,6 +65,15 @@ if (isset($_SESSION['user_id'])) {
 | 
				
			|||||||
    $page_data = str_replace('<template name="username">', $_SESSION['user_username'], $page_data);
 | 
					    $page_data = str_replace('<template name="username">', $_SESSION['user_username'], $page_data);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					$page_regex = '/<!--PAGENAME=(.*?)-->/';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if(preg_match($page_regex, $page_data, $matches)){
 | 
				
			||||||
 | 
					    $page_name = $matches[1];
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					else{
 | 
				
			||||||
 | 
					    $page_name = ucfirst($page);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$output = str_replace('<template name="page name">', $page_name, $output);
 | 
					$output = str_replace('<template name="page name">', $page_name, $output);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
echo $output;
 | 
					echo $output;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user