Пример #1
0
    if ($arr['cross'] > 0) {
        $selquery = '';
        if ($arr['cross'] == 1) {
            $selquery = "SELECT id,topid FROM `#@__arctype` WHERE typename LIKE '{$arr['typename']}' AND id<>'{$tid}' AND topid<>'{$tid}'  ";
        } else {
            $arr['crossid'] = preg_replace("#[^0-9,]#", '', trim($arr['crossid']));
            if ($arr['crossid'] != '') {
                $selquery = "SELECT id,topid FROM `#@__arctype` WHERE id in('{$arr['crossid']}') AND id<>'{$tid}' AND topid<>'{$tid}'  ";
            }
        }
        if ($selquery != '') {
            $dsql->SetQuery($selquery);
            $dsql->Execute();
            while ($arr = $dsql->GetArray()) {
                $CrossID .= $CrossID == '' ? $arr['id'] : ',' . $arr['id'];
            }
        }
    }
    $typequery = " arc.typeid in({$CrossID}) And ";
}
$dlist = new Caicai();
$dlist->pageSize = 15;
$dlist->maxPageSize = 100;
$maxrc = $dlist->pageSize * $dlist->maxPageSize;
$query = "Select arc.*,m.userid,m.face,\n          tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath\n          From `#@__archives` arc left join `#@__arctype` tp on tp.id=arc.typeid left join `#@__member`  m on m.mid=arc.mid\n          where {$typequery} arc.arcrank>-1\n          order by arc.`{$sort}` desc limit {$maxrc} ";
$dlist->SetParameter('tid', $tid);
$dlist->SetParameter('sort', $sort);
$dlist->SetTemplate(DEDEMEMBER . '/templets/fx.htm');
$dlist->SetSource($query);
$dlist->Display();
//echo ExecTime() - $t1;