<?php if (!defined('IN_F2BLOG')) { die('Access Denied.'); } $logId = empty($_GET['logId']) ? "" : $_GET['logId']; $isTrackback = getFieldValue($DBPrefix . "logs", "id='{$logId}'", "isTrackback"); if (!filter_ip(getip()) or $isTrackback == 0) { //为禁止IP时,不给看引用地址 echo $strTrackbackSessionError; } else { //取得随机数 $tb_extra = tb_extra(10); $tbDate = time(); //写入数据库 $sql = "insert into " . $DBPrefix . "tbsession(extra,tbDate,logId) values('{$tb_extra}','{$tbDate}','{$logId}')"; $DMC->query($sql); //返回内容 $home_url = "http://" . $_SERVER['HTTP_HOST'] . substr($_SERVER['PHP_SELF'], 0, strpos($_SERVER['PHP_SELF'], "f2blog_ajax.php")); echo $home_url . "trackback.php?tbID={$logId}&extra={$tb_extra}"; }
?> <br/><a href="index.php"><?php echo $strErrorBack; ?> </a></div> </div> </div> </div><br/><br/> <?php } else { $arr_array = $DMF->fetchQueryAll($result); $fa = $arr_array[0]; $strFeadLogs = $strFeadAll . $fa['name'] . $strLogss; $strViewLogs = $strView . $fa['name'] . $strLogss; $extra = tb_extra($id, $fa['postTime']); if (!filter_ip(getip()) or $fa['isTrackback'] == 0) { //为禁止IP时,不给看引用地址 $tb_url = ""; } else { $tb_url = $settingInfo['blogUrl'] . "trackback.php?tbID={$id}&extra={$extra}"; } $postTime = $fa['postTime']; $searchSql = searchSQL($job, $seekname); $prevsql = "SELECT id,logTitle FROM " . $DBPrefix . "logs WHERE postTime < '" . $postTime . "' and saveType=1 {$searchSql} ORDER BY postTime DESC LIMIT 1"; $prevLog = $DMF->fetchArray($DMF->query($prevsql)); $previd = $prevLog['id']; $prevtitle = "{$strPrevLog}{$strHomeLog}: " . $prevLog['logTitle']; $nextsql = "SELECT id,logTitle FROM " . $DBPrefix . "logs WHERE postTime > '" . $postTime . "' and saveType=1 {$searchSql} ORDER BY postTime ASC LIMIT 1"; $nextLog = $DMF->fetchArray($DMF->query($nextsql)); $nextid = $nextLog['id'];
$charset_convert = 0; $charset = strtolower($_SERVER['HTTP_ACCEPT_CHARSET']); if ($charset && !strstr($charset, 'utf-8')) { if (strstr($charset, 'gb') || strstr($charset, 'big5')) { tb_xml_error("Your trackback uses a charset other than UTF-8."); } } $result = $DMF->query("SELECT * FROM " . $DBPrefix . "logs WHERE id='{$tid}' and saveType='1'"); $numRows = $DMF->numRows($result); if ($numRows <= 0) { tb_xml_error("Invalid ID or the ID refers to a locked entry."); } else { $my = $DMF->fetchArray($result); } //检验认证码 $tb_extra = tb_extra($my['id'], $my['postTime']); if ($tb_extra != $extra) { tb_xml_error("Verifying failed."); } $title = $_REQUEST['title']; $excerpt = $_REQUEST['excerpt']; $url = $_REQUEST['url']; $blog_name = $_REQUEST['blog_name']; if ($url == "") { tb_xml_error("Invalid URL."); } if ($excerpt == "") { tb_xml_error("We require all Trackbacks to provide an excerption."); } else { if (strlen($excerpt) > 100) { $excerpt = substr($excerpt, 100) . " ...";