Delete recommend.php
This commit is contained in:
-123
@@ -1,123 +0,0 @@
|
||||
<?PHP
|
||||
include('/media/10T/ADMIN/.admin.php');
|
||||
date_default_timezone_set("America/Chicago");
|
||||
$home_dir=dirname(__FILE__);
|
||||
$SiteName=$name=$url=$rss=$lang=$email=$site_INSERT=$rss_INSERT=NULL;
|
||||
include_once('/TS/TidyBot/functions/misc_functions.php');
|
||||
$TS_con=pg_connect("host=".$db['host']." dbname=tidysearch user=".$db['user']." password=".$db['passw']);
|
||||
$aa="SELECT * FROM tidysearch.sites ORDER BY sites.index DESC LIMIT 1";
|
||||
$ab=pg_fetch_assoc(pg_query($TS_con,$aa));
|
||||
$dex=$ab['index']+1;
|
||||
if (isset($_POST['lang']) and $_POST['lang']!==""){
|
||||
$lang=$_POST['lang'];
|
||||
$Mcon=mysqli_connect($db['host'],$db['user'],$db['passw'],"users");
|
||||
$aa="SELECT * FROM `_lang` WHERE `lang` LIKE '".$lang."';";
|
||||
$ab=mysqli_fetch_array(mysqli_query($Mcon,$aa));
|
||||
if (!isset($ab['lang'])){echo "Unknown Lang<BR>";$lang="NULL";}else{$lang="'".$lang."'";}
|
||||
$Mcon->close();
|
||||
}else{
|
||||
echo "Language is helpful<BR>";
|
||||
}
|
||||
if (isset($_POST['SiteName']) and $_POST['SiteName']!==""){
|
||||
$SiteName=$_POST['SiteName'];
|
||||
$name=htmlentities($SiteName,ENT_QUOTES|ENT_HTML5,'UTF-8');
|
||||
$name="'".str_ireplace('\'',''',$name)."'";
|
||||
echo "Valid SiteName: ".$name."<BR>";
|
||||
}else{
|
||||
echo "Must have Site Name";
|
||||
exit;
|
||||
}
|
||||
if (isset($_POST['url']) and $_POST['url']!==""){
|
||||
$url=mb_trim($_POST['url'],"/");
|
||||
if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$url)){
|
||||
echo "Must have VALID Site Address";
|
||||
exit;
|
||||
}else{
|
||||
if (!test_channel($url)){
|
||||
echo "Must have VALID Site Address";
|
||||
exit;
|
||||
}else{
|
||||
echo "Valid Address: ".$url." ";
|
||||
$aa="SELECT * FROM tidysearch.sites WHERE sites.url LIKE '%".$url."%';";
|
||||
$ab=pg_fetch_array(pg_query($TS_con,$aa));
|
||||
if (!isset($ab['index'])){
|
||||
$site_INSERT="INSERT INTO tidysearch.sites (index,remoteid,url,name,_lang)VALUES(".$dex.",".$dex.",'".$url."',".$name.",".$lang.");";
|
||||
}else{
|
||||
echo "<B>Found that URL</B>";
|
||||
}
|
||||
echo "<BR>";
|
||||
}
|
||||
}
|
||||
}else{
|
||||
echo "Must have VALID Site Address";
|
||||
exit;
|
||||
}
|
||||
if (isset($_POST['rss']) and $_POST['rss']!==""){
|
||||
$rss=mb_trim($_POST['rss'],"/");
|
||||
if (filter_var($rss,FILTER_VALIDATE_URL)){
|
||||
if (!test_channel($rss)){
|
||||
echo "INVALID RSS Address";
|
||||
exit;
|
||||
}else{
|
||||
if (!preg_match("/\b(?:(?:https?|ftp):\/\/|www\.)[-a-z0-9+&@#\/%?=~_|!:,.;]*[-a-z0-9+&@#\/%=~_|]/i",$rss)){
|
||||
echo "INVALID RSS Address";
|
||||
exit;
|
||||
}else{
|
||||
echo "Valid RSS Address: ".$rss." ";
|
||||
$aa="SELECT * FROM tidysearch.sites WHERE sites.url LIKE '%".$url."%';";
|
||||
$ab=pg_fetch_array(pg_query($TS_con,$aa));
|
||||
if (!isset($ab['index'])){
|
||||
$rss_INSERT="INSERT INTO tidysearch.sites_rss (sitesid,remoteid,url,sitename)VALUES(".$dex.",".$dex.",'".$rss."',".$name.");";
|
||||
}else{
|
||||
echo "<B>Found that RSS</B>";
|
||||
}
|
||||
echo "<BR>";
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
echo "RSS Address is helpful ";
|
||||
}
|
||||
if (isset($_POST['email']) and $_POST['email']!==""){
|
||||
$email=$_POST['email'];
|
||||
if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
echo "Invalid email format: ".$email."<BR>";
|
||||
}else{
|
||||
echo "Your email is only used to thank you if we add it<BR>";
|
||||
}
|
||||
}else{
|
||||
echo "Your email is only used to thank you if we add it<BR>";
|
||||
}
|
||||
if (!is_null($name) and !is_null($url) and !is_null($rss)){
|
||||
echo "<B>".$site_INSERT."<BR>".$rss_INSERT."</B><BR><BR>";
|
||||
// Send alert to XMPP bob@mpaq.org
|
||||
if (isset($lang)){
|
||||
$INSERT="INSERT INTO recommend (name,url,rss,lang)VALUES(".$name.",'".$url."','".$rss."',".$lang.");";
|
||||
}else{
|
||||
$INSERT="INSERT INTO recommend (name,url,rss)VALUES(".$name.",'".$url."','".$rss."');";
|
||||
}
|
||||
echo $INSERT;
|
||||
pg_query($TS_con,$INSERT);
|
||||
}
|
||||
header("Refresh:1; url=/");
|
||||
echo "<BR><BR>";
|
||||
var_dump($_POST);
|
||||
exit;
|
||||
|
||||
/*
|
||||
|
||||
*/
|
||||
?>
|
||||
Thank you, sending you back to TidySearch
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user