Ejemplo n.º 1
0
function make_more_article_html($comebackurl = '/', $type = '', $aidDB = '')
{
    global $db, $pre, $webdb, $webdb, $showHtml_Type;
    if ($webdb[NewsMakeHtml] != 1) {
        return;
    }
    foreach ($aidDB as $key => $value) {
        if ($value < 1) {
            unset($aidDB[$key]);
        } else {
            $aidDB[$key] = intval($aidDB[$key]);
        }
    }
    $string = implode(",", $aidDB);
    if (!$string) {
        return;
    }
    $query = $db->query("SELECT A.*,B.bencandy_html,B.list_html,D.aid FROM {$pre}article_db D LEFT JOIN  {$pre}article A ON D.aid=A.aid LEFT JOIN {$pre}sort B ON A.fid=B.fid WHERE D.aid IN ({$string})");
    while ($rs = $db->fetch_array($query)) {
        if (!$rs[title] && ($_rs = get_one_article($rs[aid]))) {
            $rs = $_rs + $rs;
        }
        $PageNum = $rs[pages] ? $rs[pages] : 1;
        $aid = $id = $rs[aid];
        $fid = $rs[fid];
        //删除文章前要把静态页先删除
        if ($type == 'del_0') {
            if ($rs[bencandy_html]) {
                $filename_b = $rs[bencandy_html];
            } else {
                $filename_b = $webdb[bencandy_filename];
            }
            $dirid = floor($aid / 1000);
            if (strstr($filename_b, '$time_')) {
                $time_Y = date("Y", $rs[posttime]);
                $time_y = date("y", $rs[posttime]);
                $time_m = date("m", $rs[posttime]);
                $time_d = date("d", $rs[posttime]);
                $time_W = date("W", $rs[posttime]);
                $time_H = date("H", $rs[posttime]);
                $time_i = date("i", $rs[posttime]);
                $time_s = date("s", $rs[posttime]);
            }
            if ($type == 'del_0') {
                $page = 1;
                while ($page) {
                    //对于内容页的首页把$page去除
                    if ($page == 1) {
                        $filename_b = preg_replace("/(.*)(-{\\\$page}|_{\\\$page})(.*)/is", "\\1\\3", $filename_b);
                    }
                    //对于内容页的栏目小于1000篇文章时,把DIR分目录去除
                    if ($dirid == 0) {
                        $filename_b = preg_replace("/(.*)(-{\\\$dirid}|_{\\\$dirid})(.*)/is", "\\1\\3", $filename_b);
                    }
                    eval("\$showurl=\"{$filename_b}\";");
                    if (is_file(ROOT_PATH . "{$showurl}")) {
                        unlink(ROOT_PATH . "{$showurl}");
                        $page++;
                    } else {
                        $page = 0;
                    }
                }
            }
        } else {
            $ids = '';
            for ($page = 1; $page <= $PageNum; $page++) {
                $ids .= "{$aid}-{$page},";
            }
            $showcode .= "\$fiddb[]='{$rs['fid']}';\$iddb[]='{$ids}';\r\n";
        }
        $f_db[$fid] = $fid;
        $star_fid || ($star_fid = $fid);
    }
    //删除文章后的操作
    if ($type == 'del_1') {
        global $Jump_url;
        header("location:{$Jump_url}");
        exit;
    } else {
        if (!is_dir('../cache/htm_cache')) {
            mkdir('../cache/htm_cache');
            chmod('../cache/htm_cache', 0777);
        }
        $cacheid = time();
        //修改与发表多页文章时,列表页都无须处理
        if ($type == 'reply') {
            $showJumpurl = $comebackurl;
        } else {
            $showJumpurl = "{$webdb['www_url']}/do/list_html.php?fid={$star_fid}&cacheid={$cacheid}";
            $allfid = implode(",", $f_db);
            write_file(ROOT_PATH . "cache/htm_cache/{$cacheid}_makelist.php", "<?php\r\n\$allfid='{$allfid}';\$JumpUrl='{$comebackurl}';");
        }
        write_file(ROOT_PATH . "cache/htm_cache/{$cacheid}_makeShow1.php", "<?php\r\n\$JumpUrl='{$showJumpurl}';{$showcode}");
        //删除文章前不能跳转
        if ($type == 'del_0') {
            global $Jump_url;
            $Jump_url = "{$webdb['www_url']}/do/bencandy_html.php?fid={$star_fid}&cacheid={$cacheid}";
        } else {
            header("location:{$webdb['www_url']}/do/bencandy_html.php?fid={$star_fid}&cacheid={$cacheid}");
            exit;
        }
    }
}
Ejemplo n.º 2
0
    echo '<meta http-equiv="Content-Type" content="text/html; charset=gb2312">';
    die("<CENTER>恭喜你,订单提交成功,请劳记你的订单号,方便查询,你的订单号是:<font color=red>{$orderid}</font><br><br><A HREF='{$webdb['www_url']}/'>点击返回首页</A></CENTER>");
}
$detail = explode(",", $buyid);
foreach ($detail as $key => $value) {
    if (!is_numeric($value)) {
        unset($detail[$key]);
    }
    $numdb[$value]++;
}
$fids = implode(",", $detail);
$totalmoney = 0;
if ($fids) {
    $query = $db->query("SELECT A.*,D.aid FROM {$pre}article_db D LEFT JOIN {$pre}article A ON D.aid=A.aid WHERE D.aid IN ({$fids})");
    while ($rs = $db->fetch_array($query)) {
        if (!$rs[title] && ($_rs = get_one_article($rs[aid]))) {
            $rs = $_rs + $rs;
        }
        if ($rs[mid]) {
            $rss = $db->get_one("SELECT * FROM {$pre}article_content_{$rs[mid]} WHERE aid={$rs['aid']} ");
            if ($rss) {
                $rs += $rss;
            }
        }
        $rs[num] = $numdb[$rs[aid]];
        $rs[nowprice] = str_replace(",", "", $rs[nowprice]);
        $rs[totalprice] = $numdb[$rs[aid]] * $rs[nowprice];
        $totalmoney += $rs[totalprice];
        $listdb[$rs[aid]] = $rs;
    }
}
Ejemplo n.º 3
0
 }
 $SQL = " ";
 if ($_POST[listdb] && $posttype == "fromarticle") {
     //从文章管理页POST过来的指定ID文章
     if (!$listdb) {
         showmsg("请选择一个文章");
     }
     $ar = '';
     foreach ($listdb as $key => $value) {
         $ar[] = $key;
     }
     if (!$fiddb[0]) {
         unset($fiddb);
         $query = $db->query("SELECT A.fid,D.aid FROM {$pre}article_db D LEFT JOIN {$pre}article A ON D.aid=A.aid WHERE D.aid IN (" . implode(',', $ar) . ")");
         while ($rs = $db->fetch_array($query)) {
             if (!$rs[fid] && ($_rs = get_one_article($rs[aid]))) {
                 //对于分表的情况
                 $rs = $_rs + $rs;
             }
             if (!$rs[fid]) {
                 continue;
             }
             $fid_d[$rs[fid]] || ($fiddb[] = $rs[fid]);
             $fid_d[$rs[fid]] = 1;
         }
     }
     $aids = implode(',', $ar);
     $SQL .= " AND aid IN ({$aids}) ";
 } elseif ($posttype == "fromarticle") {
     $SQL .= " AND aid IN ({$aids}) ";
     //$fiddb需要POST过来