PHPwind5.3多用户接口dezend版本
这个的,斑竹把他加密了,utf8的pw不能用,我dezend了下,有问题一起讨论哦。http://bbs.locoy.com/spider-17974-1-1.html
PHPwind5.3多用户发布模块出炉该模块可以实现多个用户轮换发帖.里边的接口文件请放在论坛根目录.几个用户的密码要一样..
注意,这个只适用于最新的3.2sp1,具体使用请看模块说明.我测试多次,使用无误.如你不能发表,不要找我.:lol
<?php
/*********************/
/* */
/* Dezend for PHP5 */
/* */
/*********************/
function refreshto( $URL, $content, $statime = 1 )
{
global $db_ifjump;
$URL = str_replace( "=", "=", $URL );
if ( $db_ifjump && 0 < $statime )
{
ob_end_clean( );
global $tplpath;
global $fid;
global $imgpath;
global $db_obstart;
global $db_bbsname;
global $skin;
global $B_url;
$index_name =& $db_bbsname;
$index_url =& $B_url;
$db_obstart == 1 && function_exists( "ob_gzhandler" ) ? ob_start( "ob_gzhandler" ) : ob_start( );
if ( file_exists( R_P.( "data/style/".$skin.".php" ) ) && strpos( $skin, ".." ) === false )
{
include_once( R_P.( "data/style/".$skin.".php" ) );
}
else
{
include_once( R_P."data/style/wind.php" );
}
@extract( $GLOBALS, @EXTR_SKIP );
require_once( getlang( "refreshto" ) );
if ( $lang[$content] )
{
}
@require( printeot( "refreshto" ) );
exit( );
}
obheader( $URL );
}
function obheader( $URL )
{
global $db_obstart;
global $db_bbsurl;
global $db_htmifopen;
if ( $db_htmifopen && strtolower( substr( $URL, 0, 4 ) ) != "http" )
{
$URL = $db_bbsurl."/{$URL}";
}
ob_end_clean( );
if ( $db_obstart )
{
header( "Location: ".$URL );
exit( );
}
ob_start( );
echo "";
exit( );
}
function showmsg( $msg_info, $dejump = 0 )
{
@extract( $GLOBALS, @EXTR_SKIP );
global $stylepath;
global $tablewidth;
global $mtablewidth;
global $tplpath;
global $runfc;
$runfc = "";
if ( defined( "SIMPLE" ) )
{
echo "";
}
require_once( R_P."require/header.php" );
require_once( getlang( "msg" ) );
if ( $lang[$msg_info] )
{
}
require_once( printeot( "showmsg" ) );
exit( );
}
function getlang( $lang, $EXT = "php" )
{
global $tplpath;
$path = R_P.( "template/".$tplpath."/lang_{$lang}.{$EXT}" );
if ( !file_exists( $path ) )
{
}
return $path;
}
function printeot( $template, $EXT = "htm" )
{
global $tplpath;
if ( $template )
{
$template = N;
}
$path = R_P.( "template/".$tplpath."/{$template}.{$EXT}" );
if ( !file_exists( $path ) )
{
}
return $path;
}
function cookie( $ck_Var, $ck_Value, $ck_Time = "F" )
{
global $db_ckpath;
global $db_ckdomain;
global $timestamp;
$ck_Time = $ck_Time == "F" ? $timestamp + 31536000 : $ck_Value == "" && $ck_Time == 0 ? $timestamp - 31536000 : $ck_Time;
$S = $_SERVER['SERVER_PORT'] == "443" ? 1 : 0;
if ( !$db_ckpath )
{
}
setcookie( cookiepre( )."_".$ck_Var, $ck_Value, $ck_Time, $db_ckpath, $db_ckdomain, $S );
}
function getcookie( $Var )
{
return $_COOKIE;
}
function cookiepre( )
{
return substr( md5( $db_hash ), 0, 5 );
}
function ipban( )
{
global $db_ipban;
global $onlineip;
global $imgpath;
global $stylepath;
if ( $db_ipban )
{
$baniparray = explode( ",", $db_ipban );
foreach ( $baniparray as $banip )
{
if ( $banip )
{
$banip = trim( $banip );
if ( strpos( ",".$onlineip.".", ",".$banip."." ) !== false )
{
showmsg( "ip_ban" );
}
}
}
}
}
function p_unlink( $filename )
{
if ( strpos( $filename, ".." ) !== false )
{
exit( "Forbidden" );
}
return unlink( $filename );
}
function readover( $filename, $method = "rb" )
{
if ( strpos( $filename, ".." ) !== false )
{
exit( "Forbidden" );
}
if ( $handle = @fopen( $filename, $method ) )
{
flock( $handle, LOCK_SH );
$filedata = @fread( $handle, @filesize( $filename ) );
fclose( $handle );
}
return $filedata;
}
function writeover( $filename, $data, $method = "rb+", $iflock = 1, $check = 1, $chmod = 1 )
{
if ( $check )
{
if ( strpos( $filename, ".." ) !== false )
{
exit( "Forbidden" );
}
}
touch( $filename );
$handle = fopen( $filename, $method );
if ( $iflock )
{
flock( $handle, LOCK_EX );
}
fwrite( $handle, $data );
if ( $method == "rb+" )
{
ftruncate( $handle, strlen( $data ) );
}
fclose( $handle );
if ( $chmod )
{
}
}
function openfile( $filename )
{
$filedata = readover( $filename );
$filedata = str_replace( "\n", "\n<:wind:>", $filedata );
$filedb = explode( "<:wind:>", $filedata );
$count = count( $filedb );
if ( $filedb[$count - 1] == "" || $filedb[$count - 1] == "\r" )
{
unset( $filedb[$count - 1] );
}
if ( empty( $filedb ) )
{
$filedb = "";
}
return $filedb;
}
function update_ol( )
{
global $runfc;
if ( $runfc == "Y" )
{
global $ol_offset;
global $winduid;
global $db_ipstates;
global $isModify;
if ( $winduid != "" )
{
list( $alt_offset, $isModify ) = addonlinefile( $ol_offset, $winduid );
}
else
{
list( $alt_offset, $isModify ) = addguestfile( $ol_offset );
}
if ( $alt_offset != $ol_offset )
{
cookie( "ol_offset", $alt_offset, 0 );
}
$runfc = "";
if ( $db_ipstates && ( getcookie( "ipstate" ) || $isModify === 1 || getcookie( "ipstate" ) && getcookie( "ipstate" ) < $tdtime ) )
{
require_once( R_P."require/ipstates.php" );
}
}
}
function htm_cv( $url, $tag )
{
global $db_dir;
global $db_ext;
if ( ereg( "^http|ftp|telnet|mms|rtsp|admin.php|rss.php", $url ) === false )
{
if ( strpos( $url, "#" ) !== false )
{
$add = substr( $url, strpos( $url, "#" ) );
}
$url = str_replace( array( ".php?", "=", "&", $add ), array( $db_dir, "-", "-", "" ), $url ).$db_ext.$add;
}
return stripslashes( $tag ).$url."\"";
}
function user_info( )
{
global $db;
global $timestamp;
global $db_onlinetime;
global $winduid;
global $windpwd;
global $db_ifonlinetime;
global $c_oltime;
global $onlineip;
global $db_ipcheck;
global $tdtime;
global $montime;
$ct = $sqladd = $sqltab = "";
if ( in_array( SCR, array( "index", "read", "thread", "post" ) ) )
{
$sqladd = SCR == "post" ? ",md.postcheck,sr.visit,sr.post,sr.reply" : ",sr.visit";
$sqltab = "LEFT JOIN pw_singleright sr ON m.uid=sr.uid";
}
$detail = $db->get_one( "SELECT m.uid,m.username,m.password,m.email,oicq,m.groupid,m.groups,m.memberid,m.regdate,m.timedf,m.style,m.datefm,m.t_num,m.p_num,m.yz,m.newpm,m.showsign,m.payemail,md.postnum,md.rvrc,md.money,md.credit,md.currency,md.lastvisit,md.thisvisit,md.onlinetime,md.lastpost,md.todaypost,md.monthpost,md.onlineip,md.uploadtime,md.uploadnum,md.editor,md.starttime ".$sqladd." FROM pw_members m LEFT JOIN pw_memberdata md ON m.uid=md.uid {$sqltab} WHERE m.uid='{$winduid}'" );
unset( $detail['password'] );
if ( $db_onlinetime < $timestamp - $detail['thisvisit'] )
{
if ( getcookie( "hideid" ) )
{
$ct = "lastvisit=thisvisit,thisvisit='".$timestamp."'";
$detail['lastvisit'] = $detail['thisvisit'];
$detail['thisvisit'] = $timestamp;
}
if ( $db_ifonlinetime == 1 && $ct && 0 < $c_oltime )
{
if ( $db_onlinetime * 1.2 < $c_oltime )
{
$c_oltime = $db_onlinetime;
}
$ct .= ",onlinetime=onlinetime+'".$c_oltime."'";
if ( $montime < $detail['lastvisit'] )
{
$ct .= ",monoltime=monoltime+'".$c_oltime."'";
}
else
{
$ct .= ",monoltime='".$c_oltime."'";
}
$c_oltime = 0;
}
if ( $ct )
{
}
}
return $detail;
}
function pwdcode( $pwd )
{
return md5( $_SERVER['HTTP_USER_AGENT'].$pwd.$db_hash );
}
function safecheck( $CK, $PwdCode, $var = "AdminUser", $expire = 1800 )
{
global $timestamp;
$t = $timestamp - $CK;
if ( $expire < $t || $CK != md5( $PwdCode.$CK ) )
{
cookie( $var, "", 0 );
return false;
}
$CK = $timestamp;
$CK = md5( $PwdCode.$timestamp );
$Value = implode( "\t", $CK );
$$var = strcode( $Value );
cookie( $var, strcode( $Value ) );
return true;
}
function strcode( $string, $action = "ENCODE" )
{
$key = substr( md5( $_SERVER['HTTP_USER_AGENT'].$db_hash ), 8, 18 );
$string = $action == "ENCODE" ? $string : base64_decode( $string );
$len = strlen( $key );
$code = "";
$i = 0;
for ( ; $i < strlen( $string ); ++$i )
{
$k = $i % $len;
$code .= $string[$i] ^ $key[$k];
}
$code = $action == "DECODE" ? $code : base64_encode( $code );
return $code;
}
function substrs( $content, $length, $add = "Y" )
{
global $db_charset;
if ( $length && $length < strlen( $content ) )
{
if ( $db_charset != "utf-8" )
{
$retstr = "";
$i = 0;
for ( ; $i < $length - 2; ++$i )
{
$retstr .= 127 < ord( $content[$i] ) ? $content[$i].$content[++$i] : $content[$i];
}
if ( $add == "Y" )
{
}
return $retstr;
}
return utf8_trim( substr( $content, 0, $length ) ).( $add == "Y" ? " .." : "" );
}
return $content;
}
function utf8_trim( $str )
{
$len = strlen( $str );
$i = strlen( $str ) - 1;
for ( ; 0 <= $i; $i -= 1 )
{
$hex .= " ".ord( $str[$i] );
$ch = ord( $str[$i] );
if ( ( $ch & 128 ) == 0 )
{
return substr( $str, 0, $i );
}
if ( ( $ch & 192 ) == 192 )
{
return substr( $str, 0, $i );
}
}
return $str.$hex;
}
function get_date( $timestamp, $timeformat = "" )
{
global $db_datefm;
global $db_timedf;
global $_datefm;
global $_timedf;
$date_show = $timeformat ? $timeformat : $_datefm ? $_datefm : $db_datefm;
if ( $_timedf )
{
$offset = $_timedf == "111" ? 0 : $_timedf;
}
else
{
$offset = $db_timedf == "111" ? 0 : $db_timedf;
}
return gmdate( $date_show, $timestamp + $offset * 3600 );
}
function add_s( &$array )
{
foreach ( $array as $key => $value )
{
if ( is_array( $value ) )
{
$array[$key] = addslashes( $value );
}
else
{
add_s( $array[$key] );
}
}
}
function char_cv( $msg )
{
$msg = str_replace( "&", "&", $msg );
$msg = str_replace( " ", " ", $msg );
$msg = str_replace( "\"", """, $msg );
$msg = str_replace( "'", "'", $msg );
$msg = str_replace( "<", "<", $msg );
$msg = str_replace( ">", ">", $msg );
$msg = str_replace( "\t", " ", $msg );
$msg = str_replace( "\r", "", $msg );
$msg = str_replace( " ", "", $msg );
return $msg;
}
function gdconfirm( $code )
{
cookie( "cknum", "", 0 );
if ( !$code || !safecheck( explode( "\t", strcode( getcookie( "cknum" ), "DECODE" ) ), $code, "cknum", 1800 ) )
{
showmsg( "check_error" );
}
}
function advertinit( $SCR, $fid )
{
global $timestamp;
include( D_P."data/bbscache/advert_data.php" );
$newadvert = array( );
foreach ( $advertdb as $key => $val )
{
foreach ( $val as $k => $v )
{
if ( !$v['endtime'] || $v['endtime'] < $timestamp )
{
continue;
}
else if ( $SCR == "index" && strpos( ",".$v['fid'].",", ",-1," ) !== false )
{
$newadvert[$key][] = $v;
}
else if ( $SCR == "thread" && strpos( ",".$v['fid'].",", ",-2," ) !== false )
{
$newadvert[$key][] = $v;
}
else if ( $SCR == "read" && strpos( ",".$v['fid'].",", ",-3," ) !== false )
{
$newadvert[$key][] = $v;
}
else if ( strpos( ",".$v['fid'].",", ",-4," ) !== false )
{
$newadvert[$key][] = $v;
}
else if ( !$fid || !( strpos( ",".$v['fid'].",", ",".$fid."," ) !== false ) )
{
$newadvert[$key][] = $v;
}
}
}
return $newadvert;
}
function admincheck( $forumadmin, $fupadmin, $username )
{
if ( $username )
{
return false;
}
if ( $forumadmin && strpos( $forumadmin, ",".$username."," ) !== false )
{
return true;
}
if ( $fupadmin && strpos( $fupadmin, ",".$username."," ) !== false )
{
return true;
}
return false;
}
function getdirname( $path )
{
if ( strpos( $path, "\\" ) !== false )
{
return substr( $path, 0, strrpos( $path, "\\" ) );
}
if ( strpos( $path, "/" ) !== false )
{
return substr( $path, 0, strrpos( $path, "/" ) );
}
return "/";
}
function allowcheck( $allowgroup, $groupid, $groups, $fid = "", $allowforum = "" )
{
if ( @( strpos( $allowgroup, @",".$groupid."," ) !== false ) )
{
return true;
}
if ( $groups )
{
$groupids = explode( ",", substr( $groups, 1, -1 ) );
foreach ( $groupids as $key => $val )
{
if ( @( strpos( $allowgroup, @",".$val."," ) !== false ) )
{
return true;
break;
}
}
}
if ( $fid && $allowforum && strpos( ",".$allowforum.",", ",".$fid."," ) !== false )
{
return true;
}
return false;
}
function geturl( $attachurl, $type = "" )
{
global $attachdir;
global $attachpath;
global $db_ftpweb;
global $attach_url;
if ( file_exists( $attachdir."/".$attachurl ) )
{
return array( $attachpath."/".$attachurl, "Local" );
}
if ( !$db_ftpweb || !$attach_url || $type == "lf" )
{
return array( $db_ftpweb."/".$attachurl, "Ftp" );
}
if ( $db_ftpweb )
{
if ( is_array( $attach_url ) )
{
return array( $attach_url."/".$attachurl, "att" );
}
if ( !$db_ftpweb && count( $attach_url ) == 1 )
{
return array( $attach_url."/".$attachurl, "att" );
}
}
if ( $type == "show" )
{
return "imgurl";
}
if ( $db_ftpweb && ( $fp = @fopen( @$db_ftpweb."/".$attachurl, "rb" ) ) )
{
@fclose( $fp );
return array( $db_ftpweb."/".$attachurl, "Ftp" );
}
if ( $attach_url )
{
foreach ( $attach_url as $key => $val )
{
if ( $val == $db_ftpweb || !( $fp = @fopen( @$val."/".$attachurl, "rb" ) ) )
{
@fclose( $fp );
return array( $val."/".$attachurl, "att" );
break;
}
}
}
return false;
}
function randstr($lenth){
mt_srand((double)microtime() * 1000000);
for($i=0;$i<$lenth;$i++){
$randval.= mt_rand(0,9);
}
$randval=substr(md5($randval),mt_rand(0,32-$lenth),$lenth);
return $randval;
function num_rand($lenth){
mt_srand((double)microtime() * 1000000);
for($i=0;$i<$lenth;$i++){
$randval.= mt_rand(0,9);
}
return $randval;
}
function pwstrtotime( $time )
{
global $db_timedf;
if ( function_exists( "date_default_timezone_set" ) )
{
return strtotime( $time ) - $db_timedf * 3600;
}
return strtotime( $time );
}
function pcv( $filename, $ifcheck = 1 )
{
if ( strpos( $filename, "http://" ) !== false )
{
exit( "Forbidden" );
}
if ( $ifcheck )
{
if ( strpos( $filename, ".." ) !== false )
{
exit( "Forbidden" );
}
}
return $filename;
}
function getttable( $tid )
{
global $db_tlist;
if ( $db_tlist )
{
return "pw_tmsgs";
}
$tlistdb = unserialize( $db_tlist );
foreach ( $tlistdb as $key => $value )
{
if ( !( 0 < $key ) || !( $value < $tid ) )
{
return "pw_tmsgs".$key;
break;
}
}
return "pw_tmsgs";
}
function getptable( $tbid, $tid = "" )
{
if ( $db_plist && $tbid == "N" && $tid )
{
@extract( @$db->get_one( @"SELECT ptable AS tbid FROM pw_threads WHERE tid='".$tid."'" ) );
}
if ( $db_plist && $tbid && is_numeric( $tbid ) && strpos( ",".$db_plist.",", ",".$tbid."," ) !== false )
{
return "pw_posts".$tbid;
}
return "pw_posts";
}
define( "SCR", "post" );
error_reporting( E_ERROR | E_PARSE );
set_magic_quotes_runtime( 0 );
$t_array = explode( " ", microtime( ) );
$P_S_T = $t_array + $t_array;
define( "D_P", "" );
define( "R_P", D_P );
$htmdir = "htm_data";
if ( function_exists( "date_default_timezone_set" ) )
{
}
unset( $_ENV );
unset( $HTTP_ENV_VARS );
unset( $_REQUEST );
unset( $HTTP_POST_VARS );
unset( $HTTP_GET_VARS );
unset( $HTTP_POST_FILES );
unset( $HTTP_COOKIE_VARS );
if ( get_magic_quotes_gpc( ) )
{
add_s( $_POST );
add_s( $_GET );
add_s( $_COOKIE );
}
add_s( $_FILES );
if ( $_SERVER['HTTP_X_FORWARDED_FOR'] )
{
$onlineip = $_SERVER['HTTP_X_FORWARDED_FOR'];
$c_agentip = 1;
}
else if ( $_SERVER['HTTP_CLIENT_IP'] )
{
$onlineip = $_SERVER['HTTP_CLIENT_IP'];
$c_agentip = 1;
}
else
{
$onlineip = $_SERVER['REMOTE_ADDR'];
$c_agentip = 0;
}
$onlineip = preg_match( "/^[\\d]([\\d\\.]){5,13}[\\d]$/", $onlineip ) ? $onlineip : "unknown";
$timestamp = time( );
require_once( R_P."require/defend.php" );
if ( $db_cvtime != 0 )
{
}
if ( $db_debug )
{
error_reporting( E_ALL ^ E_NOTICE );
}
$wind_version = "5.3";
$db_olsize = 96;
if ( !$_SERVER['PHP_SELF'] )
{
}
$REQUEST_URI = $_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING'];
if ( strpos( $_SERVER['PHP_SELF'], $db_dir ) !== false )
{
$tmp = substr( $_SERVER['PHP_SELF'], 0, strpos( $_SERVER['PHP_SELF'], $db_dir ) );
}
else
{
$tmp = $_SERVER['PHP_SELF'];
}
$db_bbsurl = "http://".$_SERVER['HTTP_HOST'].substr( $tmp, 0, strrpos( $tmp, "/" ) );
$fid = (int)$fid;
$tid = (int)$tid;
$js_path = '';
$db_obstart == 1 && function_exists( "ob_gzhandler" ) ? ob_start( "ob_gzhandler" ) : ob_start( );
require_once( D_P."data/sql_config.php" );
$imgpath = $db_http != "N" ? $db_http : $picpath;
$attachpath = $db_attachurl != "N" ? $db_attachurl : $attachname;
$imgdir = R_P.$picpath;
$attachdir = R_P.$attachname;
$pw_posts = "pw_posts";
$pw_tmsgs = "pw_tmsgs";
if ( D_P != R_P && $db_http != "N" )
{
$R_url = substr( $db_http, -1 ) == "/" ? substr( $db_http, 0, -1 ) : $db_http;
$R_url = substr( $R_url, 0, strrpos( $R_url, "/" ) );
}
else
{
$R_url = $db_bbsurl;
}
if(GetCookie('lastvisit')){
list($c_oltime,$lastvisit,$lastpath) = explode("\t",GetCookie('lastvisit'));
($onbbstime=$timestamp-$lastvisit)<$db_onlinetime && $c_oltime+=$onbbstime;
}else{
$lastvisit=$lastpath='';
$c_oltime=0;
}
$ol_offset = getcookie( "ol_offset" );
$skinco = getcookie( "skinco" );
if ( $db_refreshtime && $REQUEST_URI == $lastpath && $onbbstime < $db_refreshtime )
{
if ( !getcookie( "winduser" ) )
{
}
$manager = TRUE;
$skin = $skinco ? $skinco : $db_defaultstyle;
showmsg( "refresh_limit" );
}
$H_url =& $db_wwwurl;
$B_url =& $db_bbsurl;
if ( $db_bbsifopen == 0 )
{
require_once( R_P."require/bbsclose.php" );
}
$t = array( "hours" => gmdate( "G", $timestamp + $db_timedf * 3600 ) );
$tddays = get_date( $timestamp, "j" );
$tdtime = ( floor( $timestamp / 3600 ) - $t['hours'] ) * 3600;
$montime = $tdtime - ( $tddays - 1 ) * 86400;
$runfc = "N";
if ( $db_onlinetime < $timestamp - $lastvisit || !$fid || $fid != getcookie( "lastfid" ) || getcookie( "lastfid" ) && $wind_in == "hm" )
{
cookie( "lastfid", $fid );
$runfc = "Y";
require_once( R_P."require/userglobal.php" );
}
require_once( R_P."require/db_".$database.".php" );
$db = new db( $dbhost, $dbuser, $dbpw, $dbname, $pconnect );
unset( $dbhost );
unset( $dbuser );
unset( $dbpw );
unset( $dbname );
unset( $pconnect );
unset( $manager_pwd );
$chkpassword = md5( $pwpwd );
$men = $db->get_one( "SELECT m.uid,m.password,m.groupid,m.memberid,m.yz,md.onlineip FROM pw_members m LEFT JOIN pw_memberdata md ON md.uid=m.uid WHERE username='".$pwuser."' and password='{$chkpassword}'" );
if ( $men )
{
$pwuid = $men['uid'];
}
else
{
echo "帐号或密码错";
exit( );
}
$windid = $pwuser;
$winduid = $pwuid;
$winddb = user_info( );
$winduid = $winddb['uid'];
$groupid = $winddb['groupid'];
$userrvrc = ( integer )( $winddb['rvrc'] / 10 );
$windid = $winddb['username'];
$_datefm = $winddb['datefm'];
$_timedf = $winddb['timedf'];
$skin = $winddb['style'] ? $winddb['style'] : $db_defaultstyle;
$winddb['onlineip'] = substr( $winddb['onlineip'], 0, strpos( $winddb['onlineip'], "|" ) );
if ( $groupid == "-1" )
{
}
if ( $winddb['showsign'] && ( $winddb['starttime'] || !$db_signmoney || !( strpos( $db_signgroup, ",".$groupid."," ) !== false ) || $db_signmoney < $winddb['currency'] || $winddb['starttime'] && $winddb['starttime'] != $tdtime ) )
{
require_once( R_P."require/Signfunc.php" );
signfunc( $winddb['showsign'], $winddb['starttime'], $winddb['currency'] );
}
if ( $passport_ifopen && $passport_type == "client" )
{
$loginurl = $passport_serverurl."/{$passport_loginurl}?forward=".rawurlencode( $db_bbsurl );
$loginouturl = $passport_serverurl."/{$passport_loginouturl}&forward=".rawurlencode( $db_bbsurl );
$regurl = $passport_serverurl."/{$passport_regurl}?forward=".rawurlencode( $db_bbsurl );
}
else
{
$loginurl = "login.php";
$loginouturl = "login.php?action=quit";
$regurl = "register.php";
}
if ( $db_ads && !$windid && ( is_numeric( $u ) || $a && strlen( $a ) < 16 ) && strpos( $_SERVER['HTTP_REFERER'], $_SERVER['HTTP_HOST'] ) === false )
{
cookie( "userads", $u."\t{$a}\t".md5( $_SERVER['HTTP_REFERER'] ) );
}
else if ( getcookie( "userads" ) && $db_ads == "1" )
{
// $a = explode( "\t", getcookie("userads"));
//$u = explode( "\t", getcookie("userads"));
//if ( is_numeric( $u ) || $a && strlen( $a ) < 16 )
//{
// require_once( R_P."require/userads.php" );
list($u,$a)=explode("\t",GetCookie('userads'));
if(is_numeric($u) || ($a && strlen($a)<16)){
require_once(R_P.'require/userads.php');
}
}
if ( $_GET['skinco'] )
{
}
if ( $_POST['skinco'] )
{
}
if ( $skinco && file_exists( R_P.( "data/style/".$skinco.".php" ) ) && strpos( $skinco, ".." ) === false )
{
$skin = $skinco;
cookie( "skinco", $skinco );
}
if ( defined( "SIMPLE" ) || !getcookie( "columns" ) )
{
$j_columns = $db_columns == 2 ? 1 : "";
cookie( "columns", $db_columns );
}
( $Tmp_5 ) && strpos( $REQUEST_URI, "index.php" ) === false ? cookie( "columns", "1" ) : obheader( "columns.php?action=columns" );
cookie( "lastvisit", $c_oltime."\t".$timestamp."\t".$REQUEST_URI );
unset( $db_whybbsclose );
unset( $db_whycmsclose );
unset( $db_ipban );
if ( $groupid != "guest" )
{
if ( file_exists( D_P.( "data/groupdb/group_".$groupid.".php" ) ) )
{
require_once( D_P.( "data/groupdb/group_".$groupid.".php" ) );
}
else
{
require_once( D_P."data/groupdb/group_1.php" );
}
}
else
{
require_once( D_P."data/groupdb/group_2.php" );
}
if ( defined( "SCR" ) )
{
define( "SCR", "other" );
}
$SCR = SCR;
require_once( R_P."require/forum.php" );
include_once( D_P."data/bbscache/cache_post.php" );
$foruminfo = $db->get_one( "SELECT * FROM pw_forums f LEFT JOIN pw_forumsextra fe USING(fid) WHERE f.fid='".$fid."' AND type<>'category'" );
$forumset = unserialize( $foruminfo['forumset'] );
$creditset = $foruminfo['creditset'];
if($foruminfo['allowreward'] && $forumset['rewarddb']){
list($rw_b_val,$rw_a_val)=explode(',',$forumset['rewarddb']);
!$rw_b_val && $rw_b_val=1;
}
list($uploadcredit,$uploadmoney,,)=explode("\t",$forumset['uploadset']);
$replacedb = array();
$special = (int)$special;
$sec.$fid;
$top_post = 0;
if ( !$action )
{
}
if ( $winddb['lastpost'] <= $tdtime )
{
}
if ( $winddb['lastpost'] <= $montime )
{
}
list(,,$postgd)=explode("\t",$db_gdcheck);
//$postgd = explode( "\t", $db_gdcheck );
if ( $winddb['postnum'] < $postgd )
{
}
require_once( R_P."require/bbscode.php" );
require_once( R_P."require/postfunc.php" );
list($lastip,$ipfrom)=explode("\t",str_replace('<','<',$ipfrom));
if($lastip != md5($onlineip)){
$ipfrom = cvipfrom($onlineip);
$ipfrom = str_replace("\n","",$ipfrom);
Cookie('ipfrom',md5($onlineip)."\t".$ipfrom);
}
$atc_usesign=$_POST['atc_usesign'] ? 1 : 0;
if($gp_htmlcode && $_POST['atc_html']){
$atc_usesign+=2;
}
$fatherid = $foruminfo['type'] == "sub" ? $foruminfo['fup'] : "";
$t_typedb = array( );
$t_per = 0;
$t_exits = 0;
$t_db = $foruminfo['t_type'];
if ( $t_db )
{
$t_typedb = explode( "\t", $t_db );
$t_typedb = array_unique( $t_typedb );
$t_per = $t_typedb;
unset( $t_typedb );
foreach ( $t_typedb as $value )
{
if ( $value )
{
$t_exits = 1;
}
}
}
$db_forcetype = 0;
if ( !$p_type || empty( $t_typedb[$p_type] ) || $t_per == 0 && !$admincheck )
{
$w_type = 0;
}
else
{
$w_type = $p_type;
}
$atc_title = char_cv( trim( $_POST['atc_title'] ) );
$atc_content = $_POST['atc_content'];
$ifwordsfb = 1;
if ( $SYSTEM['typeadmin'] )
{
$digest = 0;
}
if ( ( $foruminfo['f_check'] == 1 || $foruminfo['f_check'] == 3 ) && $_G['atccheck'] && !$admincheck )
{
$ifcheck = 0;
}
else
{
$ifcheck = 1;
}
$anonymous = $forumset['anonymous'] && $_G['anonymous'] && $atc_anonymous ? 1 : 0;
$lastposter = $anonymous ? $db_anonymousname : $windid;
$atc_iconid= (int)$atc_iconid;
$db->update("INSERT INTO pw_threads (fid,icon,author,authorid,subject,ifcheck,type,postdate,lastpost,lastposter,hits,replies,topped,digest,special ,ifupload,rewardinfo,anonymous,ptable) VALUES ('$fid','$atc_iconid','".addslashes($windid)."','$pwuid','$atc_title','$ifcheck','$w_type','$timestamp','$timestamp','".addslashes($lastposter)."','1','0','0','".(int)$digest."','$special','$ifupload','$rewardinfo','$anonymous','$db_ptable')");
//$db->update( "INSERT INTO pw_threads (fid,icon,author,authorid,subject,ifcheck,type,postdate,lastpost,lastposter,hits,replies,topped,digest,special ,ifupload,rewardinfo,anonymous,ptable) VALUES ('".$fid."','{$atc_iconid}','".addslashes( $windid ).( "','".$pwuid."','{$atc_title}','{$ifcheck}','{$w_type}','{$timestamp}','{$timestamp}','" ).addslashes( $lastposter )."','1','0','0','".( integer ).( "','".$special."','{$ifupload}','{$rewardinfo}','{$anonymous}','{$db_ptable}')" ) );
$tid = $db->insert_id( );
$pw_tmsgs = getttable( $tid );
$db->update( "INSERT INTO ".$pw_tmsgs." (tid,aid,userip,ifsign,buy,ipfrom,ifconvert,ifwordsfb,content) VALUES('{$tid}','{$attachs}','{$onlineip}','{$atc_usesign}','','{$ipfrom}','{$ifconvert}','{$ifwordsfb}','{$atc_content}')" );
if ( $digest )
{
}
if ( $foruminfo['cms'] )
{
include_once( R_P."require/c_search.php" );
insert_key( $tid, $keyword );
}
$top_post = 1;
$t_date = $timestamp;
bbspostguide( );
unset( $j_p );
if ( $ifcheck == 1 )
{
if ( $foruminfo['allowhtm'] && !$foruminfo['cms'] )
{
include_once( R_P."require/template.php" );
}
lastinfo( $fid, $foruminfo['allowhtm'], "new", $foruminfo['cms']."B" );
}
echo "文章发表成功";
exit();
?> Спасибо!
页:
[1]