Login | Register
NTugo

Add a feed

0) { while ($row = mysql_fetch_assoc($result)) { $ntsp_feed_url = $row['FeedURL'] ; $ntsp_feed_name = $row['FeedName'] ; $ntsp_feed_tags = $row['Tags'] ; } } //CLOSE CONNECTION mysql_close($connection); } //=========================== //=== API === if ($_GET['apiadd'] != "") { $ntsp_feed_url = $_GET['apiadd']; $ntsp_feed_name = $_GET['apititle']; $ntsp_feed_tags = $_GET['apitags']; } //========== ?>
Feed URL:
Feed Name:
Feed Tags: (Separate with commas)
set_feed_url($newfeed_url); $feed->set_cache_duration (600); // XML dump $feed->enable_xml_dump(isset($_GET['xmldump']) ? true : false); // Initialize the whole SimplePie object. Read the feed, process it, parse it, cache it, and // all that other good stuff. The feed's information will not be available to SimplePie before // this is called. $success = $feed->init(); // We'll make sure that the right content type and character encoding gets set automatically. // This function will grab the proper character encoding, as well as set the content type to text/html. $feed->handle_content_type(); if (!$success) { echo "The URL you entered is not a valid feed. Go back and try again."; $regerror=="1"; exit(); } //Check for blank fields if ($newfeed_url=="" OR $newfeed_name==""){ echo "A regired field was left blank. Go back and try again."; $regerror=="1"; exit(); } //Is the feed in the FeedDir? //DB CONFIG $host = "localhost"; $user = "merlin"; $pass = "VitaMerlini"; $db = "ntugo_mynt"; //CONNECT $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect to database. Please contact the webmaster."); //SELECT DB mysql_select_db($db) or die ("Unable to select database (connection was OK). Please contact the webmaster."); //CHECK FEEDDIR FOR FEED $query = "SELECT * FROM mynt_feeddir WHERE FeedURL = '$newfeed_url'"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) > 0) { $indir="yes"; } //CLOSE CONNECTION mysql_close($connection); //Is the user already subscribed to the feed? //DB CONFIG $host = "localhost"; $user = "merlin"; $pass = "VitaMerlini"; $db = "ntugo_mynt"; //CONNECT $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect to database. Please contact the webmaster."); //SELECT DB mysql_select_db($db) or die ("Unable to select database (connection was OK). Please contact the webmaster."); //CHECK FEEDDIR FOR FEED $query = "SELECT * FROM mynt_feeds WHERE FeedURL = '$newfeed_url' AND User = '$newfeed_user'"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) > 0) { echo "You are already subscribed to that feed! Back to your feeds."; $regerror=="1"; exit(); } //CLOSE CONNECTION mysql_close($connection); //Add the feed! if ($regerror != "1") { //DB CONFIG $host = "localhost"; $user = "merlin"; $pass = "VitaMerlini"; $db = "ntugo_mynt"; //CONNECT $connection = mysql_connect($host, $user, $pass) or die ("Unable to connect to database. Please contact the webmaster."); //SELECT DB mysql_select_db($db) or die ("Unable to select database (connection was OK). Please contact the webmaster."); //INSERT THE FEED $query = "INSERT INTO mynt_feeds (FeedURL, FeedName, User, Tags) VALUES('$newfeed_url', '$newfeed_name', '$newfeed_user', '$newfeed_tags')"; $result = mysql_query($query) or die(mysql_error()); if ($indir == "yes") { $query = "UPDATE mynt_feeddir SET SubscriberCount = SubscriberCount +1 WHERE FeedURL = '$newfeed_url'"; $result = mysql_query($query) or die(mysql_error()); } if ($indir != "yes") { $query = "INSERT INTO mynt_feeddir (FeedURL, FeedName, Tags, SubscriberCount) VALUES('$newfeed_url', '$newfeed_name', '$newfeed_tags', 1)"; $result = mysql_query($query) or die(mysql_error()); } //CLOSE CONNECTION mysql_close($connection); echo "Feed added. Go back to your feeds or add another."; } } ?> You must be logged in to access this page.
Username:
Password:
Don't have an NTugo account? Get one!

©2007-2026 NTugo, all rights reserved.
Close

Login

Username:
Password:

Forgot your password?