Exemple #1
0
        $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';
    gImg2(DROOT . $f, 'http://www.0784.com' . $s);
    if (file_exists(DROOT . $f)) {
        cImg2(DROOT . $f, DROOT . $f, $nWidth, $nHeight);