mirror of
				https://github.com/Alamantus/Lexiconga.git
				synced 2025-11-04 02:07:05 +01:00 
			
		
		
		
	Don't render announcements if dismissed
This commit is contained in:
		
							parent
							
								
									26e4475fc2
								
							
						
					
					
						commit
						6ee83c7773
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -80,6 +80,10 @@ switch ($view) {
 | 
			
		|||
    $announcements = json_decode($announcements, true);
 | 
			
		||||
    $announcements_html = '';
 | 
			
		||||
    foreach ($announcements as $announcement) {
 | 
			
		||||
      if (isset($announcement['dismissId']) && isset($_COOKIE['announcement-' . $announcement['dismissId']])) {
 | 
			
		||||
        continue;
 | 
			
		||||
      }
 | 
			
		||||
      
 | 
			
		||||
      $expire = strtotime($announcement['expire']);
 | 
			
		||||
      if (time() < $expire) {
 | 
			
		||||
        $announcements_html .= '<article class="announcement"' . (isset($announcement['dismissId']) ? ' id="announcement-' . $announcement['dismissId'] . '"' : '') . ' data-expires="' . $announcement['expire'] . '">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue