ソースを参照

did I get the filter right?

Xen 1 年間 前
コミット
37983b41d3
1 ファイル変更26 行追加26 行削除
  1. 26 26
      www/index.php

+ 26 - 26
www/index.php

@@ -102,10 +102,10 @@ function clean_str($str) {
 	
 	<?php
 	$title_filters = array(
-			" sports ",
-			" nfl ",
-			" nba ",
-			" mlb "
+			" 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.
@@ -115,30 +115,30 @@ function clean_str($str) {
 		$item_link = "article.php?loc=" . $loc . '&a=' . $item->get_permalink();
 		
 		$up_title = strtoupper($item_title);
-		if (str_contains($up_title, "SPORTS") == true)
-		{
-			// 🧒 👦 👨‍👦‍👦
-			echo '<p class="sports" style="font-size: 4px;">
-				⚽ 🏀 🏈 ⚾️ 🎾 🏐 🏉 🎱 🏆 🏟 ⛹️
-				<a href="$item_link">happened</a>
-				</p>'; 
-			// Break out of 2nd-level loop.
-			continue;
-		}
-		// for ($i = 0; $i < count($title_filters); $i++)
+		// if (str_contains($up_title, "SPORTS") == true)
 		// {
-		// 	$testing = $title_filters[$i];
-		// 	if (str_contains($up_title, $testing) == true)
-		// 	{
-		// 		// 🧒 👦 👨‍👦‍👦
-		// 		echo '<p class="sports" style="font-size: 4px;">
-		// 			⚽ 🏀 🏈 ⚾️ 🎾 🏐 🏉 🎱 🏆 🏟 ⛹️
-		// 			<a href="$item_link">happened</a>
-		// 			</p>'; 
-		// 		// Break out of 2nd-level loop.
-		// 		continue 2;
-		// 	}
+		// 	// 🧒 👦 👨‍👦‍👦
+		// 	echo '<p class="sports" style="font-size: 4px;">
+		// 		⚽ 🏀 🏈 ⚾️ 🎾 🏐 🏉 🎱 🏆 🏟 ⛹️
+		// 		<a href="$item_link">happened</a>
+		// 		</p>'; 
+		// 	// Break out of 2nd-level loop.
+		// 	continue;
 		// }
+		for ($i = 0; $i < count($title_filters); $i++)
+		{
+			$testing = $title_filters[$i];
+			if (str_contains($up_title, $testing) == 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());