Example #1
0
} else {
    define('DROOT', dirname(__FILE__) . '/../');
}
if (empty($_SERVER['QUERY_STRING'])) {
    define('ARGV', $_SERVER['argv'][0]);
} else {
    define('ARGV', $_SERVER['QUERY_STRING']);
}
include DROOT . 'inc/func.php';
include DROOT . 'inc/mysql.php';
include DROOT . 'inc/strip.php';
$sUser = '******';
$sPass = '******';
$sData = 'edudo';
//$sUser='******'; $sPass='******';$sData='edudo';
$gDB = new cMysql($sUser, $sPass, $sData, '', 'utf8');
$aTem = $gDB->select(' select `char`,`value` from var order by id asc ');
if (!empty($aTem)) {
    foreach ($aTem as $a) {
        $G[$a['char']] = $a['value'];
    }
}
$aConf = $gDB->select(' select * from conf order by id asc ', 'cid', 'id');
$aTem = $gDB->select(' select id,name from clas where cid = 0 order by ord asc,id asc ');
$aMenu = $gDB->select(' select id,url,name from clas where cid = 4 and status = 1 order by ord asc,id asc ', 'id');
if (!empty($aTem)) {
    foreach ($aTem as $n => $a) {
        $aType[$a['id']] = $a['name'];
    }
}
header("content-type:text/html; charset=" . CHAR);
Example #2
0
        $a['content'] = gcon($a['content']);
        $a['pic'] = gpic($a['pic']);
        $a['content'] = preg_replace('/&[a-z]+;/', '', $a['content']);
        $sSql = ' insert into arc(id,cid,uid,bid,mid,oid,status,ctime,etime,view,good,bad,fen,title,`key`,`write`,pic,tag,file,url,ku,fn,ph) values(' . $id . ',0,0,0,0,0,0,' . $a['ctime'] . ',0,0,0,0,0,\'' . addslashes($a['title']) . '\',\'\',\'\',\'' . $a['pic'] . '\',\'\',\'\',\'\',2,\'\',\'\')';
        if ($gDB->query($sSql)) {
            if (!$gDB->query(' insert into arcs(id,txt)values(' . $id . ',\'' . addslashes(rh($a['content'])) . '\') ')) {
                $gDB->query(' delete from arc where id = ' . $id);
            } else {
                $aSql[] = ' update arc set dao = 1 where id = ' . $a['id'];
            }
        }
        //}else {
        //$aSql[] = ' update arc set dao = 1 where id = '.$a['id'];
        //}
    }
    $gDB = new cMysql($su, $sp, 'edit', '', 'gb2312', '183.136.130.41');
    if (!empty($aSql)) {
        foreach ($aSql as $s) {
            $gDB->query($s);
        }
    }
}
echo 'end.';
function gpic($s)
{
    global $nWidth, $nHeight;
    if (empty($s)) {
        return '';
    }
    global $G;
    $f = $G['ipic'] . time() . substr(microtime(), 2, 3) . '.jpg';