} else { if (strlen($excerpt) > 100) { $excerpt = substr($excerpt, 100) . " ..."; } $excerpt = encode($excerpt); } //检查过滤 if (!filter_ip($userdetail['ip'])) { tb_xml_error("Your IP address is banned from sending trackbacks."); } if (replace_filter($excerpt) || replace_filter($title) || replace_filter($blog_name)) { tb_xml_error("The trackback content contains some words that are not welcomed on our site. You may edit your post and send it again. Sorry for the inconvenience."); } $trytb = $DMF->numRows($DMF->query("SELECT * FROM " . $DBPrefix . "trackbacks WHERE ip='" . getip() . "' AND postTime+30>='" . time() . "'")); if ($trytb > 0) { tb_xml_error("Error."); } $spam = $settingInfo['isTbApp']; // 1为开启审核 if ($spam == 0 or strpos($url, ";" . $settingInfo['ttSiteList']) >= 1) { $isApp = 1; } else { $isApp = 0; } @fopen_url($url); $sql = "INSERT INTO " . $DBPrefix . "trackbacks (logId,tbTitle,blogSite,blogUrl,content,postTime,ip,isApp) VALUES ('{$tid}',\"{$title}\",\"{$blog_name}\",\"{$url}\",\"{$excerpt}\"," . time() . ",'" . getip() . "','{$isApp}')"; $DMF->query($sql); if ($isApp == 1) { add_bloginfo("tbNums", "adding", 1); $DMF->query("UPDATE " . $DBPrefix . "logs SET quoteNums=quoteNums+1 WHERE id='{$tid}'"); settings_recache();
$weburl = substr($weburl, 0, $posurl); } if (!filter_url($weburl)) { tb_xml_error("Your Web address is banned from sending trackbacks."); } if (replace_filter($excerpt) || replace_filter($title) || replace_filter($blog_name)) { tb_xml_error("The trackback content contains some words that are not welcomed on our site. You may edit your post and send it again. Sorry for the inconvenience."); } //同一个网址,在10分钟这内发送不给通过 $trytb = $DMC->numRows($DMC->query("SELECT * FROM " . $DBPrefix . "trackbacks WHERE blogUrl like '%{$weburl}%' AND postTime+600>='" . time() . "'")); if ($trytb > 0) { tb_xml_error("Same Blog try to send after 10 minutes!"); } $trytb = $DMC->numRows($DMC->query("SELECT * FROM " . $DBPrefix . "trackbacks WHERE ip='" . getip() . "' AND postTime+30>='" . time() . "'")); if ($trytb > 0) { tb_xml_error("Same IP try to send after 30 seconds !"); } $spam = $settingInfo['isTbApp']; // 0为开启审核 if ($spam == 1 or strpos($url, ";" . $settingInfo['ttSiteList']) >= 1) { $isApp = 1; //直接前臺顯示,不用審核 } else { $isApp = 0; } fopen_url($url); $sql = "INSERT INTO " . $DBPrefix . "trackbacks (logId,tbTitle,blogSite,blogUrl,content,postTime,ip,isApp) VALUES ('{$tid}','{$title}','{$blog_name}','{$url}','{$excerpt}'," . time() . ",'" . getip() . "','{$isApp}')"; $DMC->query($sql); //使用Ajax技术 if (strpos(";{$settingInfo['ajaxstatus']};", "T") > 0) { //删除验证信息