mainURL] = $parsedTwtxtFile; } */ if (!empty($twtsURL)) { $parsedTwtxtFile = getTwtsFromTwtxtString($twtsURL); if (!is_null($parsedTwtxtFile)) { $parsedTwtxtFiles[$parsedTwtxtFile->mainURL] = $parsedTwtxtFile; } } else { // Show timeline for the URL $parsedTwtxtFiles = []; foreach ($fileLines as $currentLine) { if (str_starts_with($currentLine, '#')) { if (!is_null(getDoubleParameter('follow', $currentLine))) { $follow = getDoubleParameter('follow', $currentLine); $twtFollowingList[] = $follow; // Read the parsed files if in Cache $followURL = $follow[1]; $parsedTwtxtFile = getTwtsFromTwtxtString($followURL); if (!is_null($parsedTwtxtFile)) { $parsedTwtxtFiles[$parsedTwtxtFile->mainURL] = $parsedTwtxtFile; } } } } } $twts = []; # Combine all the followers twts foreach ($parsedTwtxtFiles as $currentTwtFile) { if (!is_null($currentTwtFile)) { $twts += $currentTwtFile->twts; } } // Search / filter on tags (or anything within a twt actually) // Base on hash filter below and on code from: https://social.dfaria.eu/search // TODO: Move to after rendering of tag-cloud to get all tags rendered /* if (!empty($_GET['search'])) { $search = $_GET['search']; $pattern = preg_quote($search, '/'); $pattern = "/^.*$pattern.*\$/mi"; $twts = array_filter($twts, function ($twt) use ($pattern) { return preg_match($pattern, $twt->content); }); } */ // TODO: (re)move or rename `?hash=` to something/where else? if (!empty($_GET['hash'])) { $hash = $_GET['hash']; $twts = array_filter($twts, function ($twt) use ($hash) { return $twt->hash === $hash || $twt->replyToHash === $hash; }); } krsort($twts, SORT_NUMERIC); if (!empty($_GET['hash'])) { $twts = array_reverse($twts, true); } // echo "Total twts before filtering: " . count($twts); // Pagnation (moved to pagnation.php) $baseURL = str_replace("/index.php", "", $_SERVER['SCRIPT_NAME']);