`
化蝶自在飞
  • 浏览: 2305802 次
  • 性别: Icon_minigender_2
  • 来自: 武汉
社区版块
存档分类
最新评论

dz论坛火车头接口_自动生成/注册会员/自动回复/自动提取关键词tags

    博客分类:
  • php
阅读更多
接口来自火车头官方人员,在此表示感谢.
我修改了下,使其支持自动提取关键词tags,并且随机生成用户名.

只提供php源代码,火车头接口请去火车头论坛自行查找.

<?php
define('CURSCRIPT', 'post');
define('NOROBOT', TRUE);
require_once './include/common.inc.php';
header('Content-Type:text/html;charset='.$charset);
require_once DISCUZ_ROOT.'./include/post.func.php';
require_once DISCUZ_ROOT.'./uc_client/client.php';
require_once DISCUZ_ROOT.'./include/discuzcode.func.php';
/*以下是程序配置参数*/

//发布回复贴使用的用户名,多个用户名用 | 分开,建议放50-100个用户名
$replyusers = "甲壳虫|化蝶自在飞";
$password = "password";			//注册用户使用的默认密码
$email = "tuzwu@qq.com";		//注册用户使用的默认邮箱,请一定要修改成自己的邮箱
$questionid = "我的名字";		//注册用户名的问题
$answer = "tuzwu";				//注册用户名的答案
$time = 2345 * rand(1,7);		//发布回复默认间隔时间
$replyvisitor	=	1 ;			//当找不到回复用户名时,是否以游客身份发布回复,1为启用,0为不启用
$down_attachment = 1 ;			//是否启用附件识别,1为启用,0为不启用
$oneuser = 0 ;					//是否启用一人发贴模式,适用于回帖也是一楼作者发贴的帖子
$gettags = 1;                   //是否开启自动获取标签tags

/*以上是程序配置参数*/

if(empty($action)) exit(show_form());

if($action == 'info') exit(phpinfo());

$_DTYPE = $checkoption = $optionlist = array();

$special = empty($special) || !is_numeric($special) || $special < 0 || $special > 6 ? 0 : intval($special);
$allowpostattach = !empty($forum['allowpostattach']) || (!$forum['postattachperm'] && $allowpostattach) || ($forum['postattachperm'] && forumperm($forum['postattachperm']));
$attachextensions = $forum['attachextensions'] ? $forum['attachextensions'] : $attachextensions;
$enctype = $allowpostattach ? 'enctype="multipart/form-data"' : '';
$maxattachsize_kb = $maxattachsize / 1000;
$postcredits = $forum['postcredits'] ? $forum['postcredits'] : $creditspolicy['post'];
$replycredits = $forum['replycredits'] ? $forum['replycredits'] : $creditspolicy['reply'];
$digestcredits = $forum['digestcredits'] ? $forum['digestcredits'] : $creditspolicy['digest'];
$postattachcredits = $forum['postattachcredits'] ? $forum['postattachcredits'] : $creditspolicy['postattach'];
$maxprice = isset($extcredits[$creditstrans]) ? $maxprice : 0;
$extra = rawurlencode($extra);
$blogcheck = empty($isblog) && empty($addtoblog) ? '' : 'checked="checked"';
$notifycheck = empty($emailnotify) ? '' : 'checked="checked"';
$stickcheck = empty($sticktopic) ? '' : 'checked="checked"';
$digestcheck = empty($addtodigest) ? '' : 'checked="checked"';
$subject = isset($subject) ? dhtmlspecialchars(censor(trim($subject))) : '';
$message = isset($message) ? censor(trim($message)) : '';
$readperm = isset($readperm) ? intval($readperm) : 0;
$price = isset($price) ? intval($price) : 0;
$urloffcheck = $usesigcheck = $smileyoffcheck = $codeoffcheck = $htmloncheck = $emailcheck = '';
$seccodecheck = ($seccodestatus & 4) && (!$seccodedata['minposts'] || $posts < $seccodedata['minposts']);
$secqaacheck = $secqaa['status'][2] && (!$secqaa['minposts'] || $posts < $secqaa['minposts']);
if($iscircle = $supe['status'] && $supe['circlestatus'] && $forum['status'] == 2) {
	unset($forum['threadtypes']);
}
$allowpostpoll = $allowpost && $allowpostpoll && ($forum['allowpostspecial'] & 1);
$allowposttrade = $allowpost && $allowposttrade && ($forum['allowpostspecial'] & 2);
$allowpostreward = $allowpost && $allowpostreward && ($forum['allowpostspecial'] & 4) && isset($extcredits[$creditstrans]);
$allowpostactivity = $allowpost && $allowpostactivity && ($forum['allowpostspecial'] & 8);
$allowpostdebate = $allowpost && $allowpostdebate && ($forum['allowpostspecial'] & 16);
$allowpostvideo = $allowpost && $allowpostvideo && ($forum['allowpostspecial'] & 32) && $videoopen;
$allowanonymous = $forum['allowanonymous'] || $allowanonymous ? 1 : 0;
$editorid = 'posteditor';
$editoroptions = str_pad(decbin($editoroptions), 2, 0, STR_PAD_LEFT);
$editormode = $editormode == 2 ? $editoroptions{0} : $editormode;
$allowswitcheditor = $editoroptions{1};
$advanceeditor = $special ? 0 : 1;
$previewdisplay = !empty($previewpost) ? '' : 'none';

/*开始注册用户并发贴*/
if($action == 'newthread') {
	$discuz_action = 11;
	
	if(empty($forum['fid']) || $forum['type'] == 'group') exit('发布错误原因:未选择版块或版块不能发帖');
	
	$isblog = empty($isblog) ? '' : 'yes';
	
	if($message == '') exit('发布错误原因:帖子内容不能为空');
	if($subject == '') exit('发布错误原因:帖子标题不能为空');

if(!$_POST['username'])
	{
//2010年6月17日16:16:06 新增用户名空白时自动生成随机字符串
$str = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';   
$str2 = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';   
    for ($x = 0; $x < 6; $x++)   
    {   
        $str[$x] = substr($str, mt_rand(0,strlen($str)-1),1);   
        $str2[$x] = substr($str2, mt_rand(0,strlen($str2)-1),1);   
    }   
    $radomstring = $str[0] . $str2[0] .$str[2] . $str[1] . $str2[1] . $str[3] . $str2[3] . $str[4];   
    $returnname = strtolower(substr($radomstring,0,8));
	}
$_POST['username'] = $_POST['username']?$_POST['username']:$returnname;//随机生成用户名字符串
	
	$discuz_user = $_POST['username'] ? html2txt(strtolower($_POST['username'])) : exit('发布错误原因:发布用户名不能为空');
	$typeid = isset($typeid) && isset($forum['threadtypes']['types'][$typeid]) ? $typeid : 0;
	$iconid = !empty($iconid) && isset($_DCACHE['icons'][$iconid]) ? $iconid : 0;
	$displayorder = $modnewthreads ? -2 : (($forum['ismoderator'] && !empty($sticktopic)) ? 1 : 0);
	$digest = ($forum['ismoderator'] && !empty($addtodigest)) ? 1 : 0;
	$blog = $allowuseblog && $forum['allowshare'] && !empty($addtoblog) ? 1 : 0;
	$readperm = $allowsetreadperm ? $readperm : 0;
	$isanonymous = $isanonymous ? 1 : 0;
	$price = $price ? intval($price) : 0;
	
	if(!$typeid && $forum['threadtypes']['required'] && !$special) exit('发布错误原因:未填写主题分类');
	
	$query = $db->query("SELECT uid,password,secques  FROM {$tablepre}members m WHERE m.username='$discuz_user'");
	
	if ($query=$db->fetch_row($query)){
		list($discuz_uid,$discuz_pw, $discuz_secques ) = $query;
	}else{
		$timestamp = auto_time(100,rand(5,55),$time);
		$discuz_uid = uc_user_register($discuz_user, $password, $email, $questionid, $answer);
		if($discuz_uid <= 0) {
			$onuser = $db->fetch_first("SELECT uid,username FROM `{$tablepre}members` order by rand() limit 1;");
			if(!$onuser){
				if($discuz_uid == -1) {
					exit('用户注册失败:用户名包含敏感字符或被系统屏蔽');
				} elseif($discuz_uid == -2) {
					exit('用户注册失败:用户名包含被系统屏蔽的字符');
				} elseif($discuz_uid == -3) {
					exit('用户注册失败:该用户名已经被注册');
				} elseif($discuz_uid == -4) {
					exit('用户注册失败:用户名包含敏感字符');
				} elseif($discuz_uid == -5) {
					exit('用户注册失败:用户名包含不可使用的邮箱域名');
				} elseif($discuz_uid == -6) {
					exit('用户注册失败:该 Email 地址已经被注册');
				} else {
					exit('用户注册失败:未定义操作');
				}
			}else{
				$discuz_uid = $onuser['uid'];
				$discuz_user = $onuser['username'];
				echo "使用了一个随机用户: $discuz_user, $discuz_uid <br>\n";
			}
		}else{
			$db->query("INSERT INTO {$tablepre}members (uid, username, password, secques, adminid, groupid, regip, regdate, lastvisit, lastactivity, posts, credits, extcredits1, extcredits2, extcredits3, extcredits4, extcredits5, extcredits6, extcredits7, extcredits8, email, showemail, timeoffset, pmsound, invisible, newsletter)
			VALUES ('$discuz_uid', '$discuz_user', '".md5($password)."', '$secques', '0', '10', '".onlineip()."', '$timestamp', '$timestamp', '$timestamp', '0', $initcredits, '$email', '0', '9999', '1', '$invisiblenew', '1')");
			$db->query("REPLACE INTO {$tablepre}memberfields (uid, authstr) VALUES ('$discuz_uid', '$authstr')");
			echo "用户注册成功:$discuz_user,$discuz_uid <br>\n";
		}
	}

	$messages = array_chk(array_unique(explode("|||",$message))) ;
	
	//print_r($messages);
	
	if($messages[0] == '') exit('发布错误原因:帖子内容不能为空');
	
	$mcount = count($messages);
	$total_reply = $mcount - 1;
	$timestamp = auto_time($mcount,0,$time);
	$author = !$isanonymous ? $discuz_user : '';
	
	if($oneuser) $oneuser = array('uid'=>$discuz_uid,'uname'=>$author);
	
	$moderated = $digest || $displayorder > 0 ? 1 : 0;
	
	$subscribed = !empty($emailnotify) && $discuz_uid ? 1 : 0;
	$supe_pushstatus = $supe['status'] && $forum['supe_pushsetting']['status'] == 1 && !$modnewthreads ? '1' : '0';
	$sgidadd1 = $sgidadd2 = '';
	
	if($iscircle) {
		$sgidadd1 = ', sgid';
		$sgidadd2 = ", '$sgid'";
	}
	
	$db->query("INSERT INTO {$tablepre}threads (fid, readperm, price, iconid, typeid, sortid, author, authorid, subject, dateline, lastpost, lastposter, displayorder, digest, special, attachment,  moderated, supe_pushstatus $sgidadd1)
		VALUES ('$fid', '$readperm', '$price', '$iconid', '$typeid', '$sortid', '$author', '$discuz_uid', '$subject', '$timestamp', '$timestamp', '$author', '$displayorder', '$digest', '$special', '$attachment',  '$moderated', '$supe_pushstatus' $sgidadd2)");
	$tid = $db->insert_id();
	$thread['tid'] = $tid;
	
	if($sortid) {
		foreach($optiondata as $optionid => $value) {
			$db->query("INSERT INTO {$tablepre}typeoptionvars (sortid, tid, optionid, value, expiration)
				VALUES ('$sortid', '$tid', '$optionid', '$value', '".($typeexpiration ? $timestamp + $typeexpiration : 0)."')");
		}
	}

	$bbcodeoff = checkbbcodes($message, !empty($bbcodeoff));
	$smileyoff = checksmilies($message, !empty($smileyoff));
	$parseurloff = !empty($parseurloff);
	$htmlon = bindec(($tagstatus && !empty($tagoff) ? 1 : 0).($allowhtml && !empty($htmlon) ? 1 : 0));
	$pinvisible = $modnewthreads ? -2 : 0;
	
	$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, anonymous, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment)
		VALUES ('$fid', '$tid', '1', '$discuz_user', '$discuz_uid', '$subject', '$timestamp', '".html2txt(strip_tags($messages[0]))."', '".onlineip()."', '$pinvisible', '$isanonymous', '$usesig', '$htmlon', '$bbcodeoff', '$smileyoff', '$parseurloff', '$attachment')");
	$pid = $db->insert_id();

//add 2010年6月17日15:52:51 tuzwu 自动获取tags标签
if($gettags)
	{
	error_reporting(0);
    set_magic_quotes_runtime(0);
$subjectenc = rawurlencode(strip_tags($subject));
$messageenc = rawurlencode(strip_tags(preg_replace("/\[.+?\]/U", '', $message)));
$data = @implode('', file("http://keyword.discuz.com/related_kw.html?ics=$charset&ocs=$charset&title=$subjectenc&content=$messageenc"));
if($data) {

	if(PHP_VERSION > '5' && $charset != 'utf-8') {
		require_once DISCUZ_ROOT.'./include/chinese.class.php';
		$chs = new Chinese('utf-8', $charset);
	}

	$parser = xml_parser_create();
	xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
	xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
	xml_parse_into_struct($parser, $data, $values, $index);
	xml_parser_free($parser);

	$kws = array();

	foreach($values as $valuearray) {
		if($valuearray['tag'] == 'kw' || $valuearray['tag'] == 'ekw') {
			$kws[] = !empty($chs) ? $chs->convert(trim($valuearray['value'])) : trim($valuearray['value']);
		}
	}

	$return = '';
	if($kws) {
		foreach($kws as $kw) {
			$kw = htmlspecialchars($kw);
			$return .= $kw.' ';
		}
		$return = htmlspecialchars($return);
	         }
	    }
	}

	$tags = $gettags?$return:$tags;//如果开启自动获取,则调用gettags函数进行处理

	
	$tags = str_replace('|',' ',$tags);
	
	if($tagstatus && $tags != '') {
		$tags = str_replace(array(chr(0xa1).chr(0xa1), chr(0xa1).chr(0x40), chr(0xe3).chr(0x80).chr(0x80)), ' ', $tags);
		$tagarray = array_unique(explode(' ', censor($tags)));
		$tagcount = 0;
		foreach($tagarray as $tagname) {
			$tagname = trim($tagname);
			if(preg_match('/^([\x7f-\xff_-]|\w){3,20}$/', $tagname)) {
				$query = $db->query("SELECT closed FROM {$tablepre}tags WHERE tagname='$tagname'");
				if($db->num_rows($query)) {
					if(!$tagstatus = $db->result($query, 0)) {
						$db->query("UPDATE {$tablepre}tags SET total=total+1 WHERE tagname='$tagname'", 'UNBUFFERED');
					}
				} else {
					$db->query("INSERT INTO {$tablepre}tags (tagname, closed, total)
						VALUES ('$tagname', 0, 1)", 'UNBUFFERED');
					$tagstatus = 0;
				}
				if(!$tagstatus) {
					$db->query("INSERT {$tablepre}threadtags (tagname, tid) VALUES ('$tagname', $tid)", 'UNBUFFERED');
				}
				$tagcount++;
				if($tagcount > 4) {
					unset($tagarray);
					break;
				}
			}
		}
	}

	$tradeaid = 0;

	if($iscircle && $sgid) {
		supe_dbconnect();
		$query = $supe['db']->query("UPDATE {$supe[tablepre]}groups SET lastpost='$timestamp' WHERE gid='$sgid'", 'SILENT');
	}
	
	if($modnewthreads) {
		$db->query("UPDATE {$tablepre}forums SET todayposts=todayposts+1 WHERE fid='$fid'", 'UNBUFFERED');
	} else {
		updatepostcredits('+', $discuz_uid, $postcredits);
		$subject = str_replace("\t", ' ', $subject);
		$lastpost = "$tid\t$subject\t$timestamp\t$author";
		$db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost', threads=threads+1, posts=posts+1, todayposts=todayposts+1 WHERE fid='$fid'", 'UNBUFFERED');
		if($forum['type'] == 'sub') {
			$db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost' WHERE fid='$forum[fup]'", 'UNBUFFERED');
		}	
	}
	
	echo("\n<br/>恭喜,成功发布一条主题,<a href='viewthread.php?tid=$tid' target='_blank'>点击访问</a>");

}

/*发布主题结束,开始发表回复*/

if($total_reply > 0)
{
	/*统计回复数量,计算回复时间*/
	$discuz_action = 12;
	require_once DISCUZ_ROOT.'./include/forum.func.php';
	$replyusers = array_chk(array_unique(explode("|",$replyusers))) ;
	$reusercount = count($replyusers);
	for($re=1;$re<=$total_reply;$re++)
	{
		if(strlen(html2txt(trim($messages[$re]))) < 5 ) continue;
		$index = rand(1,$reusercount-1);
		$discuz_user = $replyusers[$index];
		
		if($discuz_user = trim($discuz_user)){
			$query = $db->query("SELECT uid,password,secques FROM {$tablepre}members WHERE username = '$discuz_user' limit 1;");
		}else{
			$query = $db->query("SELECT uid,password,secques FROM {$tablepre}members order by rand() limit 1;");
		}

		if ($rs=$db->fetch_row($query)){
			list($discuz_uid,$discuz_pw, $discuz_secques ) =$rs;
		}else{
			if($replyvisitor){
				$discuz_uid = 0;
				$discuz_user='过客';
			}else{
				echo("\n<br/>不存在的用户名:".$discuz_user);
				continue;
			}
		}
		
	if(is_array($oneuser)){$discuz_uid = $oneuser['uid'];$discuz_user=$oneuser['uname'];}
	
	$attachnum = 0;
	$subscribed = $thread['subscribed'] && $timestamp - $thread['lastpost'] < 7776000;
	$newsubscribed = !empty($emailnotify) && $discuz_uid;

	if($subscribed && !$modnewreplies) {
		$db->query("UPDATE {$tablepre}subscriptions SET lastpost='$timestamp' WHERE tid='$tid' AND uid<>'$discuz_uid'", 'UNBUFFERED');
	}

	if($newsubscribed) {
		$db->query("REPLACE INTO {$tablepre}subscriptions (uid, tid, lastpost, lastnotify)
			VALUES ('$discuz_uid', '$tid', '".($modnewreplies ? $thread['lastpost'] : $timestamp)."', '$timestamp')", 'UNBUFFERED');
	}

	$bbcodeoff = checkbbcodes($message, !empty($bbcodeoff));
	$smileyoff = checksmilies($message, !empty($smileyoff));
	$parseurloff = !empty($parseurloff);
	$htmlon = $htmlon ? 1 : 0;
	$usesig = !empty($usesig) ? 1 : 0;
	$isanonymous = $isanonymous? 1 : 0;
	$author = empty($isanonymous) ? $discuz_user : '';
	$pinvisible = $modnewreplies ? -2 : 0;
	$timestamp = auto_time($mcount,$re,$time);
	$db->query("INSERT INTO {$tablepre}posts (fid, tid, first, author, authorid, subject, dateline, message, useip, invisible, anonymous, usesig, htmlon, bbcodeoff, smileyoff, parseurloff, attachment)
			VALUES ('$fid', '$tid', '0', '$discuz_user', '$discuz_uid', '', '$timestamp', '".$messages[$re]."', '".onlineip()."', '$pinvisible', '$isanonymous', '$usesig', '$htmlon', '$bbcodeoff', '$smileyoff', '$parseurloff', '0')");
	$pid = $db->insert_id();
	$tradeaid = 0;
	$thread['subject'] ? $thread['subject'] : $thread['subject'] = $subject;
	
	if($modnewreplies) {
		$db->query("UPDATE {$tablepre}forums SET todayposts=todayposts+1 WHERE fid='$fid'", 'UNBUFFERED');
		if($newsubscribed) {
			$db->query("UPDATE {$tablepre}threads SET views=views+".rand(0,39)." WHERE tid='$tid'", 'UNBUFFERED');
		}
	} else {
		$db->query("UPDATE {$tablepre}threads SET views=views+".rand(0,39).", lastposter='$author', lastpost='$timestamp', replies=replies+1 ".($attachment ? ', attachment=\'1\'' : '')." WHERE tid='$tid'", 'UNBUFFERED');
		updatepostcredits('+', $discuz_uid, $replycredits);
		$lastpost = "$thread[tid]\t".addslashes($thread['subject'])."\t$timestamp\t$author";
		$db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost', posts=posts+1, todayposts=todayposts+1 WHERE fid='$fid'", 'UNBUFFERED');
		if($forum['type'] == 'sub') {
			$db->query("UPDATE {$tablepre}forums SET lastpost='$lastpost' WHERE fid='$forum[fup]'", 'UNBUFFERED');
		}
	}
	
	}
}

$db->query("UPDATE {$tablepre}threads SET views=views+".rand(0,39)." WHERE tid='$tid' and views= 0 ;", 'UNBUFFERED');

echo "\n<p><input type=button value='返回接口发布页面' onClick='onclick=history.go(-1)'>";

/***************************************************************************************/

function discuz_get_user($username){
	global $db,$tablepre;
	$uid = $db->result_first("SELECT uid FROM {$tablepre}members WHERE username='$username'");
	if ($uid) { return $uid ; }else{ return false;}
}
function auto_time($total,$no,$time,$now=''){
	if (is_array($total)) $total = count($total);
	if ($now == '') $now = time();
	return $now - ($total - $no) * $time;
}
function html2txt($str){
	$str = preg_replace("/<(br|p)\s{0,}[\w\W]{0,}>/isU","\r\n",str_replace("%26","&",trim($str)));
	$str = str_replace("%26","&",trim($str));
	/*$str = strip_tags($str);//过滤了HTML代码*/
	return $str;
}
function array_chk($array){
	foreach($array as $key=>$value){
		$value = html2txt($value);
		if($value == ''){
			unset($array[$key]);
			continue;
		}
		$array[$key] = $value;
	}
	return $array;
}
function onlineip(){
	return rand(58,233).".".rand(0,233).".".rand(0,233).".".rand(0,233);
}

/***************************************************************************************/

	function show_form(){
		global $db,$tablepre,$charset;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>火车采集器 For Discuz 7.1 发布接口</title>
<meta http-equiv="Content-Type" content="text/html; charset=gbk">
<link href="./images/admincp/admincp.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="append_parent"></div>
<div class="container" id="cpcontainer">
<div class="itemtitle">
<h3>火车采集器 For Discuz 7.1 发布接口 (免费版20091015)</h3>
	<ul class="tab1">
    	<li><a href="http://www.4wei.cn" target='_blank'><span>作者:尘缘</span></a></li>
        <li><a href="http://bbs.locoy.com/"  target='_blank'><span>火车论坛</span></a></li>
<li><a href="http://www.k686.com/"  target='_blank'><span>k686绿色软件</span></a></li>
        <li><a href="./"><span>查看论坛</span></a></li>
    </ul>
</div>
<table class="tb tb2 " id="tips">
<tr>
  <th  class="partition">使用说明</th>
</tr>
<tr><td class="tipsblock"><ul id="tipslis">
      <li>当前版本:免费版,不能发布附件,不能批量注册用户,收费版售价:150元RMB,提供技术支持,包插件升级和售后.</li>
      <li>收费版本:任意格式附件识别,批量注册用户,自定义字段分类信息发布,提供技术支持,包插件升级和售后.仅售150RMB.</li>
      <li>本版功能:采集任意循环型内容发布到Discuz 论坛,支持自动注册用户,支持自动设计发布时间,支持随机用户发布回复.</li>
      <li>发布参数:用户名:username;标题:subject;回复:message;栏目:fid;标签:Tags.</li>
      <li>购买方式:QQ:130775;手机:15101058520; 感谢你对尘缘的支持.</li>
</ul></td></tr>
<tr>
  <th  class="partition">测试发布效果</th>
</tr>
</table>
<div id="searchmembers"><form name="cpform" method="post" action="?action=newthread" id="cpform">
<table class="tb tb2 ">
<tr><td colspan="2" class="td27">用户名:</td></tr>
<tr class="noborder"><td class="vtop rowform">
<input name="username" value="尘缘" type="text" class="txt"   /></td><td class="vtop tips2">发贴的用户名,不能为空,程序会自动注册未注册的用户.</td></tr>
<tr>
  <td colspan="2" class="td27">帖子标题:</td>
</tr>
<tr class="noborder"><td class="vtop rowform">
<input name="subject" value="测试帖子 发布于<?php echo date("m月d号 H:i:s")?>" type="text" class="txt"/></td>
  <td class="vtop tips2">请输入帖子标题,不能为空</td>
</tr>
<tr>
  <td colspan="2" class="td27">帖子分类:</td>
</tr>
<tr class="noborder"><td class="vtop rowform"><select name="fid">
<?php
	$query = $db->query("SELECT fid,name,fup FROM {$tablepre}forums order by fid ;");
	while($f = $db->fetch_array($query)){
		if($f['fup'] != 0) $f['name'] = $f['fid']." -> ".$f['name'];
		else $f['name'] = "=====".$f['name']."=====";
		echo "<option value='".$f['fid']."'>".$f['name']."</option>";
	}
?>
</select> </td>
  <td class="vtop tips2">请选择论坛版块</td>
</tr>
<tr>
  <td colspan="2" class="td27">帖子回复:</td>
</tr>
<tr class="noborder"><td class="vtop rowform"><textarea rows="5" name="message">1楼表情: :)|||2楼颜色 [color=Orange]好帅哟[/color]|||3楼引用 
引用
**** 作者被禁止或删除 内容自动屏蔽 ****
|||4楼回复 [b] [url=http://localhost/discuz/redirect.php?goto=findpost&pid=96&ptid=74]7#[/url] [i]火车头[/i] [/b]|||5楼发布图片 [img]http://bbs.locoy.com/uc_server/avatar.php?uid=30324&size=middle[/img]|||6楼耍起|||7楼也是|||8楼HTML <B>代码在这里</B>|||地板 冷凉了</textarea></td> <td class="vtop tips2">帖子回复,默认取第一条回复为主题内容.且不支持HTML</td></tr> <tr> <td colspan="2" class="td27">帖子标签:</td> </tr> <tr class="noborder"><td class="vtop rowform"> <input name="tags" value="火车采集器|||Discuz 尘缘" type="text" class="txt"/></td> <td class="vtop tips2">多个标签以空格 或者|||格开</td> </tr> <td colspan="15"><div class="fixsel"><input type="submit" class="btn" name="submit" value="提交" /></div></td></tr></table> </form> </div> </div> </body> </html> <?PHP } ?>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics