Exemple #1
0
function acceptun($columnid, $listid, $langid)
{
    global $db, $met_column, $met_visit_detail, $met_langok;
    if ($columnid) {
        if (!$met_langok[$langid]) {
            $query = "delete from {$met_visit_detail} where lang='{$langid}' and type='2'";
            $db->query($query);
            return false;
        } else {
            if ($columnid == '10001') {
                $metinfo['title'] = $lang_htmHome;
            } else {
                $column = $db->get_one("SELECT * FROM {$met_column} where id='{$columnid}'");
                if (!$column) {
                    $query = "delete from {$met_visit_detail} where columnid='{$columnid}' and type='2'";
                    $db->query($query);
                    return false;
                }
                $metinfo['title'] = $column['name'];
                if ($listid && $column['module'] != 1 && $column['module'] != 8) {
                    $metdbname = moduledb($column['module']);
                    $list = $db->get_one("SELECT * FROM {$metdbname} where id='{$listid}'");
                    if (!$list) {
                        $query = "delete from {$met_visit_detail} where columnid='{$columnid}' and listid='{$listid}' and type='2'";
                        $db->query($query);
                        return false;
                    }
                    $metinfo['title'] = $column['module'] == 6 ? $list['position'] : $list['title'];
                }
            }
        }
    }
    return $metinfo;
}
Exemple #2
0
<?php

require_once '../login/login_check.php';
require_once './global.func.php';
$table = moduledb($module);
if ($id) {
    $contentslist = $db->get_one("select * from {$table} where id='{$id}'");
    if ($contentslist) {
        $query = "select * from {$met_plist} where module='{$module}' and listid='{$id}'";
        $result = $db->query($query);
        while ($list = $db->fetch_array($result)) {
            $nowpara = "para" . $list[paraid];
            $contentslist[$nowpara] = $list[info];
            $nowparaname = "";
            if ($list[imgname] != "") {
                $nowparaname = $nowpara . "name";
            }
            $contentslist[$nowparaname] = $list[imgname];
        }
    }
}
$str = '';
$para_list = para_list_with($contentslist);
foreach ($para_list as $key => $val) {
    $str .= "\n\t<div class='v52fmbx_dlbox' name='paralist'>\n\t<dl>\n\t\t\t<dt>{$val[name]}{$lang_marks}</dt>\n\t\t\t<dd>{$val[inputcont]}</dd>\n\t</dl>\n\t</div>\n\t";
}
echo $str;
function delimg($del, $type, $module = 0, $para_list = NULL)
{
    global $lang, $db, $met_deleteimg, $depth;
    global $met_admin_table, $met_column, $met_cv, $met_download, $met_feedback, $met_flist, $met_img, $met_job, $met_link, $met_list, $met_message, $met_news, $met_parameter, $met_plist, $met_product;
    if ($met_deleteimg) {
        $table = $module == 8 ? $met_feedback : $met_plist;
        if ($para_list == NULL && $module != 2) {
            $query = "select * from {$met_parameter} where lang='{$lang}' and module='{$module}' and (class1='{$del['class1']}' or class1=0) and type='5'";
            $para_list = $db->get_all($query);
        }
        if ($type == 1) {
            $delnow[] = $del;
        } else {
            if ($type == 2) {
                $delnow = $del;
            } else {
                $table = moduledb($module);
                $query = "select * from {$table} where id='{$id}'";
                echo $query;
                $del = $db->get_one($query);
                $delnow[] = $del;
            }
        }
        foreach ($delnow as $key => $val) {
            if ($val['recycle'] != 2 || $module != 2) {
                foreach ($para_list as $key1 => $val1) {
                    if (($module == $val1['module'] || $val['recycle'] == $val1['module']) && ($val1['class1'] == 0 || $val1['class1'] == $val['class1'])) {
                        $imagelist = $db->get_one("select * from {$table} where lang='{$lang}' and  paraid='{$val1['id']}' and listid='{$val['id']}'");
                        file_unlink($depth . "../" . $imagelist['info']);
                        $imagelist['info'] = str_replace('watermark/', '', $imagelist['info']);
                        file_unlink($depth . "../" . $imagelist['info']);
                    }
                }
            }
            if ($module == 6 || $module == 8) {
                continue;
            }
            if ($val['displayimg'] != NULL) {
                $displayimg = explode('|', $val['displayimg']);
                foreach ($displayimg as $key2 => $val2) {
                    $display_val = explode('*', $val2);
                    file_unlink($depth . "../" . $display_val[1]);
                    $display_val[1] = str_replace('watermark/', '', $display_val[1]);
                    file_unlink($depth . "../" . $display_val[1]);
                    $imgurl_diss = explode('/', $display_val[1]);
                    file_unlink($depth . "../" . $imgurl_diss[0] . '/' . $imgurl_diss[1] . '/' . $imgurl_diss[2] . '/thumb_dis/' . $imgurl_diss[count($imgurl_diss) - 1]);
                }
            }
            if ($val['downloadurl'] == NULL) {
                file_unlink($depth . "../" . $val['imgurl']);
                file_unlink($depth . "../" . $val['imgurls']);
                $val['imgurlbig'] = str_replace('watermark/', '', $val['imgurl']);
                file_unlink($depth . "../" . $val['imgurlbig']);
                $imgurl_diss = explode('/', $val['imgurlbig']);
                file_unlink($depth . "../" . $imgurl_diss[0] . '/' . $imgurl_diss[1] . '/' . $imgurl_diss[2] . '/thumb_dis/' . $imgurl_diss[count($imgurl_diss) - 1]);
            } else {
                file_unlink($depth . "../" . $val['downloadurl']);
            }
            $content[0] = $val[content];
            $content[1] = $val[content1];
            $content[2] = $val[content2];
            $content[3] = $val[content3];
            $content[4] = $val[content4];
            foreach ($content as $contentkey => $contentval) {
                if ($contentval) {
                    $tmp1 = explode("<", $contentval);
                    foreach ($tmp1 as $key => $val) {
                        $tmp2 = explode(">", $val);
                        if (strcasecmp(substr(trim($tmp2[0]), 0, 3), 'img') == 0) {
                            preg_match('/http:\\/\\/([^\\"]*)/i', $tmp2[0], $out);
                            $imgs[] = $out[1];
                        }
                    }
                }
            }
            foreach ($imgs as $key => $val) {
                $vals = explode('/', $val);
                file_unlink($depth . "../../upload/images/" . $vals[count($vals) - 1]);
                file_unlink($depth . "../../upload/images/watermark/" . $vals[count($vals) - 1]);
            }
        }
    }
}
Exemple #4
0
                        $query = "insert into {$met_list} set bigid='{$copy_para_list[$val[id]]}',info='{$val1['info']}',no_order='{$val1['no_order']}',lang='{$copylang}'";
                        $db->query($query);
                    }
                }
            }
        }
    }
}
foreach ($cpoy_bigclass_id as $key => $val) {
    $query = "update {$met_column} set bigclass='{$cpoy_list_id[$val]}' where id='{$key}'";
    $db->query($query);
}
//复制内容
if ($copycontent) {
    foreach ($content_class1 as $key => $val) {
        $table_name = moduledb($val[module]);
        switch ($val[module]) {
            case 2:
                $query = "SELECT * FROM {$met_news} where class1='{$val['id']}'";
                $result = $db->query($query);
                while ($list = $db->fetch_array($result)) {
                    $list[content] = str_replace('\'', '\'\'', $list[content]);
                    $list[title] = str_replace('\'', '\'\'', $list[title]);
                    $list[ctitle] = str_replace('\'', '\'\'', $list[ctitle]);
                    $list[keywords] = str_replace('\'', '\'\'', $list[keywords]);
                    $list[description] = str_replace('\'', '\'\'', $list[description]);
                    $query = "insert into {$met_news} set title='{$list['title']}',ctitle='{$list['ctitle']}',keywords='{$list['keywords']}',description='{$list['description']}',content='{$list['content']}',class1='{$cpoy_list_id[$list[class1]]}',class2='{$cpoy_list_id[$list[class2]]}',class3='{$cpoy_list_id[$list[class3]]}',no_order='{$list['no_order']}',wap_ok='{$list['wap_ok']}',img_ok='{$list['img_ok']}',imgurl='{$list['imgurl']}',imgurls='{$list['imgurls']}',com_ok='{$list['com_ok']}',issue='{$list['issue']}',hits='{$list['hits']}',updatetime='{$list['updatetime']}',addtime='{$list['addtime']}',access='{$list['access']}',top_ok='{$list['top_ok']}',lang='{$copylang}',recycle='{$list['recycle']}'";
                    $db->query($query);
                }
                break;
            case 3:
Exemple #5
0
# Copyright (C) MetInfo Co.,Ltd (http://www.metinfo.cn). All rights reserved.
$depth = '../';
require_once $depth . '../login/login_check.php';
$class = $class3 ? $class3 : ($class2 ? $class2 : $class1);
$classimg = $db->get_one("select * from {$met_column} where id='{$class}'");
$class1title = $db->get_one("select * from {$met_column} where id='{$class1}'");
$classtitle = $class1title['name'];
if ($class2) {
    $class2title = $db->get_one("select * from {$met_column} where id='{$class2}'");
    $classtitle .= "->{$class2title['name']}";
}
if ($class3) {
    $class3title = $db->get_one("select * from {$met_column} where id='{$class3}'");
    $classtitle .= "->{$class3title['name']}";
}
$table = moduledb($classimg['module']);
$errorones = explode(',', $error);
foreach ($errorones as $key => $val) {
    $errortone = explode('|', $val);
    $error_list[$errortone[0]] = $db->get_one("select * from {$table} where id='{$errortone['0']}'");
    $error_list[$errortone[0]]['bigerror'] = $errortone[1];
    $errordis = explode('/', $errortone[2]);
    foreach ($errordis as $key1 => $val1) {
        $errordisone = explode('-', $val1);
        $error_list[$errortone[0]]['diserror'][$errordisone[0]] = $errordisone[1];
    }
}
$css_url = $depth . "../templates/" . $met_skin . "/css";
$img_url = $depth . "../templates/" . $met_skin . "/images";
include template('app/batch/error');
footer();
Exemple #6
0
$depth = '../';
require_once $depth . '../login/login_check.php';
setlocale(LC_ALL, array('zh_CN.gbk', 'zh_CN.gb2312', 'zh_CN.gb18030'));
$codeold = 'gbk';
$codenew = 'utf-8';
$classflie = explode('_', $fileField);
$classflie = explode('-', $classflie[count($classflie) - 1]);
$class1 = $classflie[0];
$class2 = $classflie[1];
$class3 = $classflie[2];
$class = $class3 ? $class3 : ($class2 ? $class2 : $class1);
$classcsv = $db->get_one("select * from {$met_column} where id={$class}");
if (!$classcsv) {
    metsave("../app/batch/contentup.php?anyid={$anyid}&lang={$lang}", $lang_csvnocolumn, $depth);
}
$table = moduledb($classcsv['module']);
$file = fopen($flienamecsv, 'r');
$fdata = fgetcsv($file);
foreach ($fdata as $key => $val) {
    if (iconv($codeold, $codenew, $val) == $lang_columnhtmlname) {
        $staticnum = $key;
    }
}
$numcsv = 0;
while ($data = fgetcsv($file)) {
    $staticone = iconv($codeold, $codenew, $data[$staticnum]);
    if ($staticone != NULL) {
        $static[$numcsv + 1] = $staticone;
        $static_copy[] = $staticone;
    }
    $dataqrray[] = $data;