setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // Auto-create articles table if not exists with proper indexes $pdo->exec("CREATE TABLE IF NOT EXISTS articles ( id INT AUTO_INCREMENT PRIMARY KEY, source VARCHAR(100), title VARCHAR(255) UNIQUE, short_summary TEXT, full_description TEXT, link TEXT, date DATETIME, image TEXT )"); } catch (PDOException $e) { die("Database Connection Failed: " . $e->getMessage()); } $search_query = isset($_GET['q']) ? trim($_GET['q']) : ''; $filter_date = isset($_GET['date']) ? $_GET['date'] : ''; $page = isset($_GET['page']) ? (int)$_GET['page'] : 1; if ($page < 1) $page = 1; $limit = 12; // Articles per page $offset = ($page - 1) * $limit; // Expanded Multi-Source RSS Feeds (BBC, TOI, Zee, ANI, Al Jazeera) $rss_sources = [ "BBC News" => "http://feeds.bbci.co.uk/news/rss.xml", "Times of India" => "https://timesofindia.indiatimes.com/rssfeedstopstories.cms", "Zee News" => "https://zeenews.india.com/rss/india-national-news.xml", "ANI News" => "https://www.aninews.in/rss/category/national/general-news", "Al Jazeera" => "https://www.aljazeera.com/xml/rss/all.xml" ]; $options = [ "http" => [ "method" => "GET", "header" => "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36\r\n" ] ]; $context = stream_context_create($options); // Fetching & Storing News Continuously foreach ($rss_sources as $source_name => $url) { $rss_raw = @file_get_contents($url, false, $context); if (!$rss_raw) continue; $rss_feed = @simplexml_load_string($rss_raw); if ($rss_feed && isset($rss_feed->channel->item)) { foreach ($rss_feed->channel->item as $item) { $title = (string)$item->title; $link = (string)$item->link; $date_raw = (string)$item->pubDate; $formatted_date = date('Y-m-d H:i:s', strtotime($date_raw)); if(empty($formatted_date) || $formatted_date == '1970-01-01 00:00:00') { $formatted_date = date('Y-m-d H:i:s'); } $full_desc = strip_tags((string)$item->description); if (empty($full_desc)) $full_desc = "Official network direct verified update."; $short_summary = mb_strimwidth($full_desc, 0, 140, "..."); try { $stmt = $pdo->prepare("INSERT IGNORE INTO articles (source, title, short_summary, full_description, link, date, image) VALUES (?, ?, ?, ?, ?, ?, ?)"); $stmt->execute([$source_name, $title, $short_summary, $full_desc, $link, $formatted_date, '']); } catch (Exception $e) {} } } } // Count total items for pagination $count_sql = "SELECT COUNT(*) FROM articles WHERE 1=1"; $count_params = []; if (!empty($search_query)) { $count_sql .= " AND (title LIKE ? OR short_summary LIKE ?)"; $count_params[] = "%$search_query%"; $count_params[] = "%$search_query%"; } if (!empty($filter_date)) { $count_sql .= " AND DATE(date) = ?"; $count_params[] = $filter_date; } $stmt_count = $pdo->prepare($count_sql); $stmt_count->execute($count_params); $total_articles = $stmt_count->fetchColumn(); $total_pages = ceil($total_articles / $limit); if ($total_pages < 1) $total_pages = 1; // Fetching Paginated Items $sql = "SELECT * FROM articles WHERE 1=1"; $params = []; if (!empty($search_query)) { $sql .= " AND (title LIKE ? OR short_summary LIKE ?)"; $params[] = "%$search_query%"; $params[] = "%$search_query%"; } if (!empty($filter_date)) { $sql .= " AND DATE(date) = ?"; $params[] = $filter_date; } $sql .= " ORDER BY date DESC LIMIT $limit OFFSET $offset"; $stmt = $pdo->prepare($sql); $stmt->execute($params); $news_items = $stmt->fetchAll(PDO::FETCH_ASSOC); ?> NEWZXT - No Faltu News, Only True Updates
A Venture of UARES GROUP | info@newzxt.com
Loading Time...
NEWZXT Direct Edition

Live Direct News Stream

Bina time-pass ke, seedhe kaam ki baat — Zero Bakwas.

Total Archives:
XT
Verified Report LIVE FEED

NEWZXT

"No faltu news, no bakwas, only true news!"

Conclusion

1): ?>
1): ?> « First Last »

Koi matching news nahi mili.

Reset Filter