Esempio n. 1
0
File: showmod.php Progetto: nanfs/lt
}
$class1_info = $class_list[$class1]['releclass'] ? $class_list[$class_list[$class1]['releclass']] : $class_list[$class1];
$class2_info = $class_list[$class1]['releclass'] ? $class_list[$class1] : $class_list[$class2];
$class3_info = $class_list[$class3];
if ($pagemark > 2 && $pagemark < 6) {
    $mdmendy = 1;
}
if ($mdmendy) {
    $query1 = "select * from {$met_plist} where module='{$pagemark}' and listid='{$id}'";
    $result1 = $db->query($query1);
    while ($list1 = $db->fetch_array($result1)) {
        $nowpara1 = "para" . $list1['paraid'];
        $news[$nowpara1] = $list1['info'];
        $metparaaccess = $metpara[$list1['paraid']]['access'];
        if ($metpara[$list1['paraid']]['type'] == 5) {
            $fltp = metfiletype($list1['info']);
            $fltp = $fltp ? 'met_annex_' . $fltp : '';
            if (!$list1['imgname']) {
                $listinfos = explode('/', $list1['info']);
                $listinfoss = explode('.', $listinfos[3]);
                $list1['imgname'] = $listinfoss[0];
            }
            $news[$nowpara1] = "<a href='{$list1['info']}' {$metblank} class='met_annex {$fltp}' title='{$list1['imgname']}'>{$list1['imgname']}</a>";
            $news[$nowpara1 . 's'] = $list1['info'];
        }
        if (intval($metparaaccess) > 0 && $met_member_use) {
            $paracode = authcode($news[$nowpara1], 'ENCODE', $met_member_force);
            $paracode = codetra($paracode, 1);
            $news[$nowpara1] = "<script language='javascript' src='../include/access.php?metmemberforce={$metmemberforce}&metuser=para&metaccess=" . $metparaaccess . "&lang=" . $lang . "&listinfo=" . $paracode . "&paratype=" . $metpara[$list1['paraid']]['type'] . "'></script>";
        }
        $nowparaname = "";
Esempio n. 2
0
function methtml_getarray($mark, $type, $order, $module, $listmx = -1, $para = 0, $categoryname = 0, $marktype = 0, $txtmax = 0, $descmax = 0, $rand = 0)
{
    global $met_member_use, $class_index, $met_listtime, $metinfo_member_type, $db, $met_news, $met_product, $met_download, $met_img, $met_job, $met_parameter, $met_plist, $class_list, $metpara, $module_list2;
    global $index_news_no, $index_product_no, $index_download_no, $index_img_no, $index_job_no, $mobilesql;
    global $index, $navurl, $weburly, $lang, $pagename, $langmark, $met_htmpagename, $met_chtmtype, $met_htmtype, $met_pseudo, $met_webhtm;
    global $dataoptimize, $pagemark, $img_url, $met_hot, $m_now_date, $met_newsdays, $metmemberforce, $met_alt, $metblank, $met_agents_img;
    global $product_paralist, $download_paralist, $img_paralist, $m_now_time;
    if ($mark && strstr($mark, "-")) {
        $hngy5 = explode('-', $mark);
        if ($hngy5[1] == 'cm') {
            $mark = $hngy5[0];
            $marktype = 1;
        }
        if ($hngy5[1] == 'md') {
            $mark = '';
            $module = metmodname($hngy5[0]);
        }
    }
    $listmx = $listmx == '' ? -1 : $listmx;
    if ($met_member_use == 2) {
        $access_sql = " and access<={$metinfo_member_type}";
    }
    $numname = ' id,title,description,class1,class2,class3,updatetime,addtime,filename,access,top_ok,hits,issue,com_ok,no_order,';
    $listitem['news'] = array(0 => $numname . 'img_ok,imgurls,content,imgurl,links', 1 => $met_news, 2 => 'shownews');
    $listitem['product'] = array(0 => $numname . 'new_ok,imgurls,content,imgurl,displayimg,links', 1 => $met_product, 2 => 'showproduct');
    $listitem['download'] = array(0 => $numname . 'downloadurl,filesize,content,downloadaccess', 1 => $met_download, 2 => 'showdownload');
    $listitem['img'] = array(0 => $numname . 'new_ok,imgurls,content,imgurl,displayimg,links', 1 => $met_img, 2 => 'showimg');
    $listitem['job'] = array(0 => '*', 1 => $met_job, 2 => 'showjob');
    $sqlorder = $order == 'hits' ? ' order by top_ok desc,com_ok desc,no_order desc,hits desc,id desc' : ' order by top_ok desc,com_ok desc,no_order desc,updatetime desc,id desc';
    switch ($type) {
        default:
            $sqltype = "";
            break;
        case 'com':
            $sqltype = "and com_ok=1";
            break;
        case 'new':
            $sqltype = "and new_ok=1";
            break;
        case 'img':
            $sqltype = "and img_ok=1";
            break;
    }
    if ($mark) {
        if ($marktype) {
            $listnowid = $mark;
            $listnowclass = "class{$class_list[$mark]['classtype']}";
            if ($class_list[$mark]['releclass']) {
                $listnowclass = "class1";
            }
            $modulex = metmodname($class_list[$mark]['module']);
            $sqlorder = $order ? $sqlorder : list_order($class_list[$mark]['list_order']);
        } else {
            $listnowid = $class_index[$mark]['id'];
            $listnowclass = "{$class_index[$mark]['classtype']}";
            $modulex = metmodname($class_index[$mark]['module']);
            $sqlorder = $order ? $sqlorder : list_order($class_index[$mark]['list_order']);
        }
        $folderone = $db->get_one("SELECT * FROM {$met_column} WHERE bigclass='{$listnowid}' and module ='{$class_list[$listnowid][module]}' and releclass!='0' and lang='{$lang}'");
        if ($folderone) {
            $sqlclounm = "and ({$listnowclass}='{$listnowid}' or class1='{$folderone['id']}')";
        } else {
        }
        if ($listnowclass == 'class1') {
            $class1sql = " {$listnowclass}='{$listnowid}' ";
            foreach ($module_list2[$class_list[$listnowid]['module']] as $key => $val) {
                if ($val['releclass'] == $listnowid) {
                    $class1re .= " or {$listnowclass}='{$val['id']}' ";
                }
            }
            if ($class1re) {
                $class1sql = '(' . $class1sql . $class1re . ')';
            }
            $sqlclounm = ' and ' . $class1sql;
        } else {
            $sqlclounm = "and {$listnowclass}='{$listnowid}'";
        }
        if (!$modulex) {
            $module = $module ? $module : 'news';
            $sqlclounm = '';
        } else {
            $module = $modulex;
        }
    }
    $module = $module ? $module : 'news';
    switch ($module) {
        case 'news':
            $modulenunm = 2;
            break;
        case 'product':
            $modulenunm = 3;
            break;
        case 'download':
            $modulenunm = 4;
            break;
        case 'img':
            $modulenunm = 5;
            break;
        case 'job':
            $modulenunm = 6;
            break;
    }
    if ($listmx == -1) {
        switch ($module) {
            case 'news':
                $listmx = $index_news_no;
                break;
            case 'product':
                $listmx = $index_product_no;
                break;
            case 'download':
                $listmx = $index_download_no;
                break;
            case 'img':
                $listmx = $index_img_no;
                break;
            case 'job':
                $listmx = $index_job_no;
                break;
        }
    } else {
        $listmx = $listmx;
    }
    $select = $listitem[$module][0];
    $table = $listitem[$module][1];
    if ($module == 'news' || $module == 'product' || $module == 'download' || $module == 'img' || $module == 'job') {
        $displaytype_sql = "and displaytype='1'";
    } else {
        $displaytype_sql = "";
    }
    if ($modulenunm == 6) {
        if ($rand == 0) {
            $rand_query = "order by top_ok desc,no_order desc,addtime desc limit 0, {$listmx}";
        } else {
            if ($rand == '-1') {
                $rand_query = "ORDER BY RAND() LIMIT {$listmx} ";
            } else {
                $rand_query = "order by top_ok desc,no_order desc,addtime desc limit {$rand}, {$listmx}";
            }
        }
        $query = "SELECT {$select} FROM {$table} where lang='{$lang}' {$mobilesql} and ((TO_DAYS(NOW())-TO_DAYS(`addtime`)< useful_life) OR useful_life=0) and addtime<='{$m_now_date}' {$displaytype_sql} {$access_sql} {$rand_query}";
    } else {
        if ($rand == 0) {
            $rand_query = $sqlorder . " limit 0, {$listmx}";
        } else {
            if ($rand == '-1') {
                $rand_query = "ORDER BY RAND() LIMIT {$listmx}";
            } else {
                $rand_query = $sqlorder . " limit {$rand}, {$listmx}";
            }
        }
        $query = "SELECT {$select} FROM {$table} where lang='{$lang}' {$mobilesql} {$sqlclounm} {$access_sql} {$sqltype} and (recycle='0' or recycle='-1') and addtime<='{$m_now_date}' {$displaytype_sql} {$rand_query}";
    }
    $result = $db->query($query);
    while ($list = $db->fetch_array($result)) {
        if ($modulenunm == 6) {
            $list['updatetime'] = $list['addtime'];
            $list['title'] = $list['position'];
        }
        $list['updatetime_original'] = $list['updatetime'];
        $list['title_all'] = $list['title'];
        $list['description_all'] = $list['description'];
        if ($txtmax) {
            $list['title'] = utf8substr($list['title'], 0, $txtmax);
        }
        if ($descmax) {
            $list['description'] = utf8substr($list['description'], 0, $descmax);
        }
        if ($dataoptimize[$pagemark]['categoryname'] || $categoryname) {
            $list['class1_name'] = $class_list[$list['class1']]['name'];
            $list['class1_url'] = $class_list[$list['class1']]['url'];
            $list['class2_name'] = $list['class2'] ? $class_list[$list['class2']]['name'] : $list['class1_name'];
            $list['class2_url'] = $list['class2'] ? $class_list[$list['class2']]['url'] : $list['class1_url'];
            $list['class3_name'] = $list['class3'] ? $class_list[$list['class3']]['name'] : ($list['class2'] ? $class_list[$list['class2']]['name'] : $list['class1_name']);
            $list['class3_url'] = $list['class3'] ? $class_list[$list['class3']]['url'] : ($list['class2'] ? $class_list[$list['class2']]['url'] : $list['class1_url']);
        }
        if ($list['top_ok'] == 1) {
            $list['top'] = "<img class='listtop' src='" . $img_url . "top.gif" . "' alt='" . $met_alt . "' />";
            $list['hot'] = "";
            $list['news'] = "";
        } else {
            $list['top'] = "";
            $list['hot'] = $list['hits'] >= $met_hot ? "<img class='listhot' src='" . $img_url . "hot.gif" . "' alt='" . $met_alt . "' />" : "";
            $list['news'] = (strtotime($m_now_date) - strtotime($list['updatetime'])) / 86400 < $met_newsdays ? "<img class='listnew' src='" . $img_url . "news.gif" . "' alt='" . $met_alt . "' />" : "";
        }
        $list['status'] = $list['top'] . $list['hot'] . $list['news'];
        $weburly = "";
        if ($index[index] == "index") {
            if (!strstr($list['imgurls'], "http://")) {
                $listarray[imgurls] = explode("../", $list['imgurls']);
                $list[imgurls] = $weburly . $listarray['imgurls'][1];
            }
            if (!strstr($list['imgurl'], "http://")) {
                $listarray[imgurl] = explode("../", $list['imgurl']);
                $list[imgurl] = $weburly . $listarray['imgurl'][1];
            }
        }
        if (strstr($list['imgurls'], "http://")) {
            $list['imgurls'] = $list['imgurls'] != "" ? $list['imgurls'] : $list['imgurls'];
        } else {
            $list['imgurls'] = $list['imgurls'] != "" ? $list['imgurls'] : $weburly . $met_agents_img;
        }
        if (strstr($list['imgurl'], "http://")) {
            $list['imgurl'] = $list['imgurl'] != "" ? $list['imgurl'] : $list['imgurl'];
        } else {
            $list['imgurl'] = $list['imgurl'] != "" ? $list['imgurl'] : $weburly . $met_agents_img;
        }
        if (($dataoptimize[$pagemark]['para'][$modulenunm] and $dataoptimize[$pagemark]['parameter']) || $para) {
            switch ($modulenunm) {
                case 3:
                    $md_paralist = $product_paralist;
                    break;
                case 4:
                    $md_paralist = $download_paralist;
                    break;
                case 5:
                    $md_paralist = $img_paralist;
                    break;
            }
            $query1 = "select * from {$met_plist} where lang='{$lang}' and listid='{$list['id']}' and module='{$modulenunm}' order by id";
            $result1 = $db->query($query1);
            while ($list1 = $db->fetch_array($result1)) {
                $i = 0;
                $ik = 0;
                foreach ($md_paralist as $key => $val) {
                    $i++;
                    if ($list1['paraid'] == $val['id']) {
                        if ($metpara[$list1['paraid']]['class1'] == 0 or $metpara[$list1['paraid']]['class1'] == $list['class1'] and $metpara[$list1['paraid']]['class2'] == 0 and $metpara[$list1['paraid']]['class3'] == 0 or $metpara[$list1['paraid']]['class1'] == $list['class1'] and $metpara[$list1['paraid']]['class2'] == $list['class2'] and $metpara[$list1['paraid']]['class3'] == 0 or $metpara[$list1['paraid']]['class1'] == $list['class1'] and $metpara[$list1['paraid']]['class2'] == $list['class2'] and $metpara[$list1['paraid']]['class3'] == $list['class3']) {
                            $ik = $i;
                        }
                    }
                }
                $nowpara1 = "para" . $ik;
                $list[$nowpara1] = $list1['info'];
                $metparaaccess = $metpara[$list1['paraid']]['access'];
                if (intval($metparaaccess) > 0 && $met_member_use) {
                    $paracode = authcode($list1[$nowpara1], 'ENCODE', $met_member_force);
                    $paracode = codetra($paracode, 1);
                    $list[$nowpara1] = "<script language='javascript' src='" . $navurl . "include/access.php?metuser=para&metaccess=" . $metparaaccess . "&lang=" . $lang . "&listinfo=" . $paracode . "&paratype=" . $metpara[$list1['paraid']]['type'] . "&index=" . $index[index] . "'></script>";
                }
                $nowparaname = "";
                $nowparaname = $nowpara1 . "name";
                $list[$nowparaname] = $metpara[$list1['paraid']]['name'];
                if ($metpara[$list1['paraid']]['type'] == 5 && $index[index] == "index") {
                    $listarray['info'] = explode("../", $list1['info']);
                    $list1['info'] = $listarray['info'][1];
                }
                if ($metpara[$list1['paraid']]['type'] == 5) {
                    $fltp = metfiletype($list1['info']);
                    $fltp = $fltp ? 'met_annex_' . $fltp : '';
                    $list[$nowpara1] = "<a href='{$list1['info']}' {$metblank} class='met_annex {$fltp}' title='{$list1['imgname']}'>{$list1['imgname']}</a>";
                    $list[$nowpara1 . 's'] = $list1['info'];
                }
            }
            unset($list['para0']);
            unset($list['para0name']);
        }
        //URL地址
        $filename = $modulenunm == 6 ? $navurl . 'job' : $navurl . $class_list[$list['class1']]['foldername'];
        $filenamenow = $met_htmpagename == 2 ? $modulenunm == 6 ? 'job' : $class_list[$list['class1']]['foldername'] : ($met_htmpagename == 1 ? date('Ymd', strtotime($list['addtime'])) : $listitem[$module][2]);
        $htmname = $list['filename'] != "" ? $filename . "/" . $list['filename'] : $filename . "/" . $filenamenow . $list['id'];
        $panyid = $list['filename'] != '' ? $list['filename'] : $list['id'];
        $met_ahtmtype = $list['filename'] != "" ? $met_chtmtype : $met_htmtype;
        $phpname = $met_pseudo ? $filename . "/" . $panyid . '-' . $lang . '.html' : $filename . "/" . $listitem[$module][2] . ".php?" . $langmark . "&id=" . $list['id'];
        if ($list['links']) {
            $list['url'] = $list['links'];
        } else {
            $list['url'] = $met_pseudo ? $phpname : ($met_webhtm ? $htmname . $met_ahtmtype : $phpname);
        }
        $list['updatetime'] = date($met_listtime, strtotime($list['updatetime']));
        $list['img_x'] = met_imgxy(1, $module);
        $list['img_y'] = met_imgxy(2, $module);
        $relist[] = $list;
    }
    return $relist;
}