ソースを参照

none of the tla sports either

Xen 1 年間 前
コミット
19176e88ee
1 ファイル変更20 行追加4 行削除
  1. 20 4
      www/index.php

+ 20 - 4
www/index.php

@@ -99,7 +99,14 @@ function clean_str($str) {
 		<?php echo strtoupper($loc) ?> Edition
 		<a href="choose_edition.php">(Change)</a>
 	</p>
+	
 	<?php
+	$title_filters = array(
+			" sports ",
+			" nfl ",
+			" nba ",
+			" mlb "
+		);
 	/*
 	Here, we'll loop through all of the items in the feed, and $item represents the current item in the loop.
 	*/
@@ -107,11 +114,20 @@ function clean_str($str) {
 		$item_title = clean_str($item->get_title());
 		$item_link = "article.php?loc=" . $loc . '&a=' . $item->get_permalink();
 		
-		if (str_contains(strtoupper($item_title), strtoupper("sports")))
+		$up_title = strtoupper($item_title);
+		for ($i = 0 ; $i < count($title_filters); $i++)
 		{
-			echo '<p class="sports" style="font-size: 4px;">⚽ 🏀 🏈 ⚾️ 🎾 🏐 🏉 🎱 🏆 🏟 ⛹️ <a href="$item_link">happened</a></p>'; // 🧒 👦 👦 👨‍👦‍👦
-			continue;
-		}	
+			if (str_contains($up_title, $title_filters[$i]) == true)
+			{
+				// 🧒 👦 👨‍👦‍👦
+				echo '<p class="sports" style="font-size: 4px;">
+					⚽ 🏀 🏈 ⚾️ 🎾 🏐 🏉 🎱 🏆 🏟 ⛹️
+					<a href="$item_link">happened</a>
+					</p>'; 
+				// Break out of 2nd-level loop.
+				continue 2;
+			}
+		}
 		
 		$subheadlines = clean_str($item->get_description());