<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>
Daily Bot
</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
</head><body>


<?

################################################## #############
//Database ayarları wordpress için
$dbhost="localhost"; //Db Host
$dbkullanici="asdasdas"; //Db Kullanıcısi
$dbsifre="122345"; //Db Şifre
$dbadi="aqwsddsaa"; //Db İsmi
$siteadresi="http://www.deneme.com"; //Site Adresi
################################################## #############

$baglan = mysql_connect($dbhost,$dbkullanici,$dbsifre);
mysql_select_db($dbadi,$baglan);
mysql_query("SET NAMES 'UTF8'");
mysql_query("SET CHARACTER SET UTF8");
mysql_query("SET COLLATION_CONNECTION = 'UTF8_turkish_ci'");

function birdensuna($sayi,$maximum) {
if ( $sayi >= 1 AND $sayi <= $maximum ) { return $sayi; }
else { return $maximum; }
}

function DosyaAl($url){
//$ch = curl_init();
//$timeout = 0;
//curl_setopt ($ch, CURLOPT_URL, $url);
//curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
//curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
//$xml = curl_exec($ch);
//curl_close($ch);
//if(!$xml) die('Baglantı Hatası');
$xml = file_get_contents($url);
return $xml;
}

function trsil($url)
{
$url = trim($url);
$url = strtolower($url);
$find = array('<b>', '</b>');
$url = str_replace ($find, '', $url);
$url = preg_replace('/<(\/{0,1})img(.*?)(\/{0,1})\>/', 'image', $url);
$find = array(' ', '&quot;', '&amp;', '&', '\r\n', '\n', '/', '\\', '+', '<', '>');
$url = str_replace ($find, '-', $url);
$find = array('é', 'è', 'ë', 'ê', 'É', 'È', 'Ë', 'Ê');
$url = str_replace ($find, 'e', $url);
$find = array('í', '&yacute;', 'ì', 'î', 'ï', 'I', '&Yacute;', 'Í', 'Ì', 'Î', 'Ï', 'ı', 'İ');
$url = str_replace ($find, 'i', $url);
$find = array('ó', 'ö', 'Ö', 'ò', 'ô', 'Ó', 'Ò', 'Ô');
$url = str_replace ($find, 'o', $url);
$find = array('á', 'ä', 'â', 'à', 'â', 'Ä', 'Â', 'Á', 'À', 'Â');
$url = str_replace ($find, 'a', $url);
$find = array('ú', 'ü', 'Ü', 'ù', 'û', 'Ú', 'Ù', 'Û');
$url = str_replace ($find, 'u', $url);
$find = array('ç', 'Ç');
$url = str_replace ($find, 'c', $url);
$find = array('&thorn;', '&THORN;', 'Ş', 'ş');
$url = str_replace ($find, 's', $url);
$find = array('&eth;', '&ETH;');
$url = str_replace ($find, 'g', $url);
$find = array('/[^a-z0-9\-<>]/', '/[\-]+/', '/<[^>]*>/');
$repl = array('', '-', '');
$url = preg_replace ($find, $repl, $url);
$url = str_replace ('--', '-', $url);
return $url;
}


function acilma_suresi (){
$time = explode( " ", microtime());
$usec = (double)$time[0];
$sec = (double)$time[1];
return $sec + $usec;
}
//Bunu sayfanın en üst kısmına koyarsanız iyi olur
$saymaya_basla = acilma_suresi();
$page = $_GET['page'];
$kelime = $_GET['kelime'];
$max=100;
if (!$page) $page=1;
$alt=($page - 1) * $max;
$et = explode(",",$etiketler);
$cek = rand(0,count($et));
if(!$kelime) $kelime = $et[$cek];
$aranan = urlencode($kelime);

$ix = $_POST['ix'];
if($ix == "1"){
$adi = $_POST['adi'];
$kategori = $_POST['kategori'];
$aciklama = $_POST['aciklama'];
$resim = $_POST['resim'];
$kod = $_POST['kod'];
$tarih = time();
$sef = trsil($adi) ;
$konu = "<p align=\"center\">$kod</p><p align=\"center\"><!--more--></p><p align=\"center\">$aciklama</p>" ;

$sql="select * from wp_posts order by ID DESC LIMIT 1";
$dogru=mysql_query($sql);
$post_id=mysql_result($dogru,0,"ID");
$post_ids = $post_id+1 ;
$guid="$siteadresi/?p=$post_ids";


$result = mysql_query("Insert Into wp_posts (guid,post_author,post_date,post_date_gmt,post_con tent,post_title,post_status,comment_status,ping_st atus,post_name,post_modified,post_modified_gmt,pos t_type) values ('$guid','1',Now(),Now(),'$konu','$adi','publish', 'open','open','$sef',Now(),Now(),'post')");

$results2 = mysql_query("Insert Into wp_term_relationships (object_id,term_taxonomy_id) values ('$post_ids','$kategori')");
echo "<b>Video eklendi!!<br>&nbsp;";
echo mysql_error();

}else{
?>
<FORM NAME="form" METHOD="GET" ACTION="">
<div align="center"><font face="Tahoma" size="2" class="ara">
<input type="text" name="kelime" class="ara" size="40" value="<?echo "$aranan";?>" />
</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="submit" name="onay" value="Aramaya Başla" />
<BR>
</div></FORM>

<?

$data=DosyaAl('http://www.dailymotion.com/rss/relevance/search/'.$aranan.'/'.$page);
if(eregi("<item>",$data)) {
$bol = explode("<item>",$data);
if(count($bol)-1<$max) {
$git = count($bol)-1;
}else{
$git = $max;}
for ($i=1;$i<=$git;$i++) {
preg_match("'<dm:id>(.*?)</dm:id>'si",$bol[$i], $id);
preg_match("'<media:thumbnail url=\"(.*?)\" height'si",$bol[$i], $resim);
preg_match("'<title>(.*?)</title>'si",$bol[$i], $adi);
preg_match("'<p>(.*?)</p>'si",$bol[$i], $aciklama);

$datas=DosyaAl('http://www.dailymotion.com/relevance/search/koca+kafalar/video/'.$id[1].'_n');

preg_match("'http://www.dailymotion.com/swf/(.*?)autoPlay=1\" \/>'si",$datas, $adres);
$adres = "http://www.dailymotion.com/swf/".$adres[1];


?> <FORM action=daily.php
method=post><input type=hidden name=ix value=1>
<div class="post" style="padding-top: 5px;">
<h2 class="title">isim:
<input name="adi" class="field" id="adi"
style="WIDTH: 200px; HEIGHT: 20px" value="<?=$adi[1];?>" size="10" />
Link:
<input name="" class="field"
style="WIDTH: 200px; HEIGHT: 20px" value="<?=$adres;?>" size="10" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;<INPUT class=button type=submit value=Ekle name=send_button></h2>
<div class="entry">
<table border="0" width='100%'>
<tr>
<td valign="top" width='217'><div align="center"><img border="0" src="<?=str_replace('320x240','160x120',$resim[1]);?>" alt="<?=$adi[1];?>" height="103" width="138" /></div>
<table cellspacing="0" cellpadding="0" width="220" align="left"
border="0">
<tbody>
<tr height="25">
<td width="84" align="left"><b>Kategori :</b></td>
<td width="136"><select name="kategori" id="kategori">
<?

$isimx="select * from wp_term_taxonomy where taxonomy='category'";
$sorgu=mysql_query($isimx);
while($veri = mysql_fetch_array($sorgu))
{

$q2=mysql_query("Select * from wp_terms where term_id='$veri[term_id]'");
$r2=mysql_fetch_array($q2);
echo "<option value=$veri[term_taxonomy_id]>$r2[name]</option>";
}
?></select>
</td>
</tr>
</tbody>
</table></td>
<td width="269" valign="top"><p><strong>Aciklama:</strong></p>
<p>
<textarea class="field" style="WIDTH: 416; HEIGHT: 159" name="aciklama" rows="5" cols="40"><?=strip_tags(str_replace(' style="display:none;"','',str_replace('>','',$acik lama[1])));?>
</textarea></p></td>
<td width="458" valign="top"><p><strong>Embed Kodu:</strong></p>
<p>
<textarea class="field" style="WIDTH: 416; HEIGHT: 159" name="kod" rows="5" cols="40" id="kod"><div><object width="420" height="300"><param name="movie" value="<?=$adres?>&related=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="<?=$adres?>&related=1" type="application/x-shockwave-flash" width="420" height="300" allowFullScreen="true" allowScriptAccess="always"></embed></object><br /><b><a href="<?=$adres?>"><?=$adi[1]?></a></b></div>
</textarea>
<br />
<strong>Resim Konumu</strong>:
<input name="resim" class="field" id="resim"
style="WIDTH: 200px; HEIGHT: 20px" value="<?=$resim[1];?>" size="10" />
</p></td>
</tr>
</table>
</div>
</FORM>
<center>
---------------------------------------------------------------------------------------------------------------------------------------------------------------
</center>
<? } } } ?>
<BR>
<BR>

</body>
</html>

Bu Botu gezerken buldum ancak çalışıyor videoları çekiyor ama kategoriyi bulmuyor.Vede şu hatayı veriyor

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in /home/klipstor/public_html/bot/daily.php on line 110
Video eklendi!!
Table 'klipstor_videoizleseneq1.wp_term_relationships' doesn't exist

Konu ile ilgilenen tüm arkadaşlara çok tşk ed. sorunum çözüldü herkese iyi çalışmalar iyi günler diliyorum.