Example #1
0
/**
 *  获取一个页面
 *
 * @access    public
 * @param     string  $gurl  操作地址
 * @return    string
 */
function CoOnePage($gurl)
{
    global $dsql, $cfg_auot_description, $cfg_soft_lang;
    $redatas = array('title' => '', 'body' => '', 'source' => '', 'writer' => '', 'description' => '', 'keywords' => '');
    $redatas['source'] = preg_replace("/http:\\/\\//i", "", $gurl);
    $redatas['source'] = preg_replace("/\\/(.*)\$/i", "", $redatas['source']);
    $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '" . $redatas['source'] . "' ");
    $s = $e = '';
    if (is_array($row)) {
        list($s, $e) = explode('{@body}', $row['rule']);
        $s = trim($s);
        $e = trim($e);
        if ($row['issource'] == 1) {
            $redatas['source'] = $row['title'];
        }
    }
    $htd = new DedeHttpDown();
    $htd->OpenUrl($gurl);
    $body = $htd->GetHtml();
    if ($body != '') {
        //编码自动转换
        if ($cfg_soft_lang == 'utf-8') {
            if ($row['lang'] == 'gb2312') {
                $body = gb2utf8($body);
            }
        } else {
            if ($cfg_soft_lang == 'gb2312') {
                if ($row['lang'] == 'utf-8') {
                    $body = utf82gb($body);
                }
            }
        }
        //获取标题
        $inarr = array();
        preg_match("/<title>(.*)<\\/title>/isU", $body, $inarr);
        if (isset($inarr[1])) {
            $redatas['title'] = $inarr[1];
        }
        //获取关键词
        $inarr = array();
        preg_match("/<meta[\\s]+name=['\"]keywords['\"] content=['\"](.*)['\"]/isU", $body, $inarr);
        if (isset($inarr[1])) {
            $redatas['keywords'] = cn_substr(html2text($inarr[1]), 30);
        }
        //获取摘要
        $inarr = array();
        preg_match("/<meta[\\s]+name=['\"]description['\"] content=['\"](.*)['\"]/isU", $body, $inarr);
        if (isset($inarr[1])) {
            $redatas['description'] = cn_substr(html2text($inarr[1]), $cfg_auot_description);
        }
        //获取内容
        if ($s != '' && $e != '') {
            $redatas['body'] = GetHtmlAreaA($s, $e, $body);
            if ($redatas['body'] != '' && $redatas['description'] == '') {
                $redatas['description'] = cn_substr(html2text($redatas['body']), $GLOBALS['cfg_auot_description']);
            }
        }
    }
    return $redatas;
}
Example #2
0
 function AppCode(&$str)
 {
     if ($this->moduleLang == $this->sysLang) {
         return $str;
     } else {
         if ($this->sysLang == 'utf-8') {
             if ($this->moduleLang == 'gbk') {
                 return gb2utf8($str);
             }
             if ($this->moduleLang == 'big5') {
                 return gb2utf8(big52gb($str));
             }
         } else {
             if ($this->sysLang == 'gbk') {
                 if ($this->moduleLang == 'utf-8') {
                     return utf82gb($str);
                 }
                 if ($this->moduleLang == 'big5') {
                     return big52gb($str);
                 }
             } else {
                 if ($this->sysLang == 'big5') {
                     if ($this->moduleLang == 'utf-8') {
                         return gb2big5(utf82gb($str));
                     }
                     if ($this->moduleLang == 'gbk') {
                         return gb2big5($str);
                     }
                 } else {
                     return $str;
                 }
             }
         }
     }
 }
Example #3
0
 function ac_save()
 {
     global $cfg_soft_lang;
     $data[0]['pic'] = request('pic1', '');
     $data[1]['pic'] = request('pic2', '');
     $data[2]['pic'] = request('pic3', '');
     $data[0]['url'] = request('url1', '');
     $data[1]['url'] = request('url2', '');
     $data[2]['url'] = request('url3', '');
     $data[0]['description'] = request('description1', '');
     $data[1]['description'] = request('description2', '');
     $data[2]['description'] = request('description3', '');
     $mpath = DEDEASK . "/data/cache/slide.inc";
     if ($cfg_soft_lang == 'utf-8') {
         $data = AutoCharset($data, 'utf-8', 'gb2312');
         $data = serialize($data);
         $data = gb2utf8($data);
     } else {
         $data = serialize($data);
     }
     $configstr = "<" . "?php\r\n\$data = '" . $data . "';";
     file_put_contents($mpath, $configstr);
     ShowMsg('修改幻灯片成功', '?ct=slide');
     exit;
 }
function get_search_query_terms($engine = 'google')
{
    $referer = urldecode($_SERVER['HTTP_REFERER']);
    $query_array = array();
    switch ($engine) {
        case 'google':
            // Google query parsing code adapted from Dean Allen's
            // Google Hilite 0.3. http://textism.com
            $query_terms = preg_replace('/^.*q=([^&]+)&?.*$/i', '$1', $referer);
            $query_terms = preg_replace('/\'|"/', '', $query_terms);
            $query_array = preg_split("/[\\s,\\+\\.]+/", $query_terms);
            break;
            //added by  Xuefeng Li
        //added by  Xuefeng Li
        case 'baidu':
            // My server don't support iconv function, so i had to use another function gb2utf8 to replace it.
            //$referer = iconv('gb2312', 'utf-8', $referer);
            $referer = gb2utf8($referer);
            $query_terms = preg_replace('/^.*(wd=|word=)([^&]+)&?.*$/i', '$2', $referer);
            $query_terms = preg_replace('/\'|"/', '', $query_terms);
            $query_array = preg_split("/[\\s,\\+\\.]+/", $query_terms);
            break;
        case 'lycos':
            $query_terms = preg_replace('/^.*query=([^&]+)&?.*$/i', '$1', $referer);
            $query_terms = preg_replace('/\'|"/', '', $query_terms);
            $query_array = preg_split("/[\\s,\\+\\.]+/", $query_terms);
            break;
        case 'yahoo':
            $query_terms = preg_replace('/^.*p=([^&]+)&?.*$/i', '$1', $referer);
            $query_terms = preg_replace('/\'|"/', '', $query_terms);
            $query_array = preg_split("/[\\s,\\+\\.]+/", $query_terms);
            break;
        case 'wordpress':
            $search = get_query_var('s');
            $search_terms = get_query_var('search_terms');
            if (!empty($search_terms)) {
                $query_array = $search_terms;
            } else {
                if (!empty($search)) {
                    $query_array = array($search);
                } else {
                    if (empty($search)) {
                        //do nothing man
                    } else {
                        $query_terms = preg_replace('/^.*s=([^&]+)&?.*$/i', '$1', $referer);
                        $query_terms = preg_replace('/\'|"/', '', $query_terms);
                        $query_array = preg_split("/[\\s,\\+\\.]+/", $query_terms);
                    }
                }
            }
    }
    return $query_array;
}
Example #5
0
function Conv2UTF8($text, $RefCode = 1, $Codepage = "big5")
{
    switch ($Codepage) {
        case "gb":
        case "936":
            return gb2utf8($text, $RefCode);
        case "sjis":
        case "932":
            return sjis2utf8($text, $RefCode);
        case "ws":
            return ws2utf8($text, $RefCode);
        case "ru":
            return ru2utf8($text, $RefCode);
        case "heb":
            return heb2utf8($text, $RefCode);
        case "utf8":
            return utf82u($text, $RefCode);
        case "big5":
        case "950":
        default:
            return big52utf8($text, $RefCode);
    }
}
Example #6
0
<?php

if ($option == 'index') {
    if ($_POST['update'] == 'update') {
        $GETSQL->fDelete("`{$ODBC['tablepre']}statistics`", "`st_admin`='1' AND TO_DAYS(`st_date`)<=TO_DAYS(NOW())-7");
        die(gb2utf8("ɾ³ý³É¹¦"));
    }
    include_once Getincludefun("page");
    $cParameter = "action=adminstatistics&Keyword={$Keyword}&id={$id}&type={$type}&Industry={$Industry}";
    $nCount = 20;
    if ($Keyword != '') {
        fgetposttoupdatd($Keyword, $ODBC['charset']);
        if ($id == "") {
            $where = " AND (`st_hackname` LIKE '%{$Keyword}%' OR `st_action` LIKE '%{$Keyword}%' OR `st_option` LIKE '%{$Keyword}%' OR `st_url` LIKE '%{$Keyword}%' OR `st_ip` LIKE '%{$Keyword}%' OR `st_username` LIKE '%{$Keyword}%')";
        } else {
            if ($id == "1") {
                $where = " AND `st_hackname`";
            } else {
                if ($id == "2") {
                    $where = " AND `st_action` LIKE '%{$Keyword}%'";
                } else {
                    if ($id == "3") {
                        $where = " AND `st_option` LIKE '%{$Keyword}%'";
                    } else {
                        if ($id == "4") {
                            $where = " AND `st_url` LIKE '%{$Keyword}%'";
                        } else {
                            if ($id == "5") {
                                $where = " AND `st_ip` LIKE '%{$Keyword}%'";
                            } else {
                                if ($id == "6") {
 function RemoveXss($val)
 {
     global $cfg_soft_lang;
     if ($cfg_soft_lang == 'gb2312') {
         gb2utf8($val);
     }
     $val = preg_replace('/([\\x00-\\x08,\\x0b-\\x0c,\\x0e-\\x19])/', '', $val);
     $search = 'abcdefghijklmnopqrstuvwxyz';
     $search .= 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';
     $search .= '1234567890!@#$%^&*()';
     $search .= '~`";:?+/={}[]-_|\'\\';
     for ($i = 0; $i < strlen($search); $i++) {
         $val = preg_replace('/(&#[xX]0{0,8}' . dechex(ord($search[$i])) . ';?)/i', $search[$i], $val);
         // with a ;
         $val = preg_replace('/(&#0{0,8}' . ord($search[$i]) . ';?)/', $search[$i], $val);
         // with a ;
     }
     $val = str_replace("`", "‘", $val);
     $val = str_replace("'", "‘", $val);
     $val = str_replace("\"", "“", $val);
     $val = str_replace(",", ",", $val);
     $val = str_replace("(", "(", $val);
     $val = str_replace(")", ")", $val);
     $ra1 = array('javascript', 'vbscript', 'expression', 'applet', 'meta', 'xml', 'blink', 'link', 'style', 'script', 'embed', 'object', 'iframe', 'frame', 'frameset', 'ilayer', 'layer', 'bgsound', 'title', 'base');
     $ra2 = array('onabort', 'onactivate', 'onafterprint', 'onafterupdate', 'onbeforeactivate', 'onbeforecopy', 'onbeforecut', 'onbeforedeactivate', 'onbeforeeditfocus', 'onbeforepaste', 'onbeforeprint', 'onbeforeunload', 'onbeforeupdate', 'onblur', 'onbounce', 'oncellchange', 'onchange', 'onclick', 'oncontextmenu', 'oncontrolselect', 'oncopy', 'oncut', 'ondataavailable', 'ondatasetchanged', 'ondatasetcomplete', 'ondblclick', 'ondeactivate', 'ondrag', 'ondragend', 'ondragenter', 'ondragleave', 'ondragover', 'ondragstart', 'ondrop', 'onerror', 'onerrorupdate', 'onfilterchange', 'onfinish', 'onfocus', 'onfocusin', 'onfocusout', 'onhelp', 'onkeydown', 'onkeypress', 'onkeyup', 'onlayoutcomplete', 'onload', 'onlosecapture', 'onmousedown', 'onmouseenter', 'onmouseleave', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onmousewheel', 'onmove', 'onmoveend', 'onmovestart', 'onpaste', 'onpropertychange', 'onreadystatechange', 'onreset', 'onresize', 'onresizeend', 'onresizestart', 'onrowenter', 'onrowexit', 'onrowsdelete', 'onrowsinserted', 'onscroll', 'onselect', 'onselectionchange', 'onselectstart', 'onstart', 'onstop', 'onsubmit', 'onunload');
     $ra = array_merge($ra1, $ra2);
     $found = true;
     while ($found == true) {
         $val_before = $val;
         for ($i = 0; $i < sizeof($ra); $i++) {
             $pattern = '/';
             for ($j = 0; $j < strlen($ra[$i]); $j++) {
                 if ($j > 0) {
                     $pattern .= '(';
                     $pattern .= '(&#[xX]0{0,8}([9ab]);)';
                     $pattern .= '|';
                     $pattern .= '|(&#0{0,8}([9|10|13]);)';
                     $pattern .= ')*';
                 }
                 $pattern .= $ra[$i][$j];
             }
             $pattern .= '/i';
             $replacement = substr($ra[$i], 0, 2) . '<x>' . substr($ra[$i], 2);
             $val = preg_replace($pattern, $replacement, $val);
             if ($val_before == $val) {
                 $found = false;
             }
         }
     }
     if ($cfg_soft_lang == 'gb2312') {
         utf82gb($val);
     }
     return $val;
 }
Example #8
0
            $cData = array($nowtime, $_POST['addsubject'], $_POST['addurl'], $_POST['addinfo'], $_POST['addlogo'], $_POST['addsp'], $_POST['addpass']);
            $GETSQL->fInsert("`{$ODBC['tablepre']}link`", $cQuery, $cData);
        }
        if (is_array($_POST['link_id'])) {
            foreach ($_POST['link_id'] as $k => $v) {
                //$sql_config = $GETSQL->fSql("*","`{$ODBC['tablepre']}main`","`main_subject`='{$k}'","","","","U_B");
                $GETSQL->fUpdate("`{$ODBC['tablepre']}link`", "`link_subject`='{$_POST['link_subject'][$v]}',\n\t\t\t`link_url`='{$_POST['link_url'][$v]}',\n\t\t\t`link_info`='{$_POST['link_info'][$v]}',\n\t\t\t`link_logo`='{$_POST['link_logo'][$v]}',\n\t\t\t`link_sp`='{$_POST['link_sp'][$v]}',\n\t\t\t`link_pass`='{$_POST['link_pass'][$v]}'", "`link_id`='{$v}'");
            }
        }
        die(gb2utf8("友情连接修改成功"));
    }
    $nCount = $cache_config['numser'] ? $cache_config['numser'] : "10";
    $cParameter = "action={$action}&option={$option}";
    include_once Getincludefun("page");
    $nNums = $GETSQL->fNumrows("SELECT link_id FROM `{$ODBC['tablepre']}link`");
    $sql_link = $GETSQL->fSql("*", "`{$ODBC['tablepre']}link`", "", "ORDER BY `link_sp`,`link_id` DESC", $nPage * $nCount, $nCount);
    if ($nNums > 0) {
        $fpageup = fPagesadmin($nNums, $nPage, $nCount, $cParameter, "showtable", 1);
        $smarty->assign('sql_link', $sql_link);
        $smarty->assign('fpageup', $fpageup);
    }
    $smarty->display("link.htm");
}
if ($option == 'del') {
    $GETSQL->fDelete("`{$ODBC['tablepre']}link`", "`link_id`='{$id}'", "1");
    die(gb2utf8("友情连接删除成功"));
}
if ($option == 'pass') {
    $GETSQL->fUpdate("`{$ODBC['tablepre']}link`", "`link_pass`='{$type}'", "`link_id`='{$id}'");
    die(gb2utf8("友情连接操作成功"));
}
Example #9
0
function save_detail_excel($sql, $file_name, $file_type = "xls")
{
    global $db_conn;
    if ($sql != "") {
        set_time_limit(0);
        ini_set('memory_limit', '600M');
        $rows = mysqli_query($db_conn, $sql);
        $row_counts_list = mysqli_num_rows($rows);
        $field_count = mysqli_num_fields($rows);
        $fields = mysqli_fetch_fields($rows);
        if ($row_counts_list != 0) {
            //文档类型
            if ($file_type == "xls") {
                //记录集个数小于2000,使用phpexcel生成xls
                /*if ($row_counts_list<2000 and $field_count<12) {
                  include("../plugin/excel.php");
                  //当前活动表
                  $objPHPExcel->setActiveSheetIndex(0);
                  //sheet表名
                  $objPHPExcel->getActiveSheet()->setTitle("".$file_name."");
                  $field_count2=$field_count-1;
                  $objPHPExcel->getActiveSheet()->setSharedStyle($excel_tit_left, "A1:$tit_arr[$field_count2]1");	
                  $objPHPExcel->getActiveSheet()->setSharedStyle($excel_list_left, "A2:$tit_arr[$field_count2]".($row_counts_list+1));
                  for ($i=0;$i<$field_count;$i++){
                  $objPHPExcel->getActiveSheet()->setCellValue("$tit_arr[$i]1","".$fields[$i]->name."");
                  }
                  $i=1;
                  while($rs= mysqli_fetch_array($rows)){ 
                  $i+=1;
                  for ($k=0;$k<$field_count;$k++){
                  
                  $objPHPExcel->getActiveSheet()->getCell($tit_arr[$k].$i)->setValueExplicit($rs[$k], PHPExcel_Cell_DataType::TYPE_STRING);
                  
                  }
                  //if($i%100==0){
                  //	ob_flush();
                  //	flush();
                  //}
                  }
                  $objPHPExcel->setActiveSheetIndex(0);
                  
                  $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
                  $file_path=excel_file("".$file_name."_","xls");
                  $objWriter->save(str_replace('.php', '.xls',$file_path[2]));
                  
                  }else{*/
                //记录集个数大于2000,使用XML生成xls
                include "Spreadsheet/Excel/Writer.php";
                $file_path = excel_file("" . $file_name . "_", "xls");
                $workbook = new Spreadsheet_Excel_Writer($file_path[2]);
                $workbook->setCustomColor(20, 146, 208, 80);
                $format_title_sty =& $workbook->addformat(array('Size' => 10, 'Bold' => 1, 'Border' => 1, 'FgColor' => 20, 'FontFamily' => utf82gb("宋体")));
                $format_cont_sty =& $workbook->addformat(array('Size' => 10, 'Border' => 1, 'FontFamily' => utf82gb("宋体")));
                $sheet_rows = 40000;
                //单Sheet记录集个数
                $sheet_id = 0;
                $i = 0;
                $sheet_i = 0;
                while ($rs = mysqli_fetch_array($rows)) {
                    $i++;
                    $sheet_i++;
                    $row_ = $i % $sheet_rows;
                    if ($row_ == 1) {
                        if ($row_counts_list < $sheet_rows + 1) {
                            $sheet_id = "";
                        } else {
                            $sheet_id++;
                        }
                        $sheets =& $workbook->addWorksheet("" . utf82gb($file_name . $sheet_id) . "");
                        for ($f = 0; $f < $field_count; $f++) {
                            $sheets->writeString(0, $f, utf82gb($fields[$f]->name), $format_title_sty);
                        }
                        $sheet_i = 1;
                    }
                    for ($k = 0; $k < $field_count; $k++) {
                        $sheets->writeString($sheet_i, $k, utf82gb($rs[$k]), $format_cont_sty);
                    }
                }
                $workbook->close();
                //}
            } elseif ($file_type == "xml_xls") {
                $file_type = "xls";
                $file_path = excel_file("" . $file_name . "_", $file_type);
                $fp = fopen($file_path[2], "w");
                $sheet_rows = 40000;
                //单Sheet记录集个数
                $xml_head = "<?xml version=\"1.0\"?>\n<?mso-application progid=\"Excel.Sheet\"?>\n<Workbook xmlns=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:o=\"urn:schemas-microsoft-com:office:office\" xmlns:x=\"urn:schemas-microsoft-com:office:excel\" xmlns:ss=\"urn:schemas-microsoft-com:office:spreadsheet\" xmlns:html=\"http://www.w3.org/TR/REC-html40\"><DocumentProperties xmlns=\"urn:schemas-microsoft-com:office:office\"><Title>详单数据导出</Title><Author>亚铭科技</Author><Category>详单、汇总</Category>\n<Company>亚铭科技</Company></DocumentProperties>\n<OfficeDocumentSettings xmlns=\"urn:schemas-microsoft-com:office:office\"><AllowPNG/> <RemovePersonalInformation/></OfficeDocumentSettings><ExcelWorkbook xmlns=\"urn:schemas-microsoft-com:office:excel\"> <WindowHeight>8010</WindowHeight><WindowWidth>14805</WindowWidth><WindowTopX>240</WindowTopX><WindowTopY>105</WindowTopY>\n<ProtectStructure>False</ProtectStructure><ProtectWindows>False</ProtectWindows></ExcelWorkbook>\n<Styles>\n<Style ss:ID=\"Default\" ss:Name=\"Normal\"><Alignment ss:Vertical=\"Bottom\"/><Borders/><Font ss:FontName=\"宋体\" x:CharSet=\"134\" ss:Size=\"10\" ss:Color=\"#000000\"/><Interior/><NumberFormat/><Protection/></Style><Style ss:ID=\"s71\"><Alignment ss:Vertical=\"Center\"/><Borders><Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"1\"/><Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"1\"/><Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"1\"/><Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"1\"/></Borders><Font ss:FontName=\"宋体\" x:CharSet=\"134\" ss:Color=\"#000000\"/><NumberFormat ss:Format=\"@\"/></Style><Style ss:ID=\"s72\"><Alignment ss:Vertical=\"Center\"/><Borders>\n<Border ss:Position=\"Bottom\" ss:LineStyle=\"Continuous\" ss:Weight=\"1\"/><Border ss:Position=\"Left\" ss:LineStyle=\"Continuous\" ss:Weight=\"1\"/>\n <Border ss:Position=\"Right\" ss:LineStyle=\"Continuous\" ss:Weight=\"1\"/><Border ss:Position=\"Top\" ss:LineStyle=\"Continuous\" ss:Weight=\"1\"/></Borders><Font ss:FontName=\"宋体\" x:CharSet=\"134\" ss:Color=\"#000000\" ss:Bold=\"1\"/> <Interior ss:Color=\"#92D050\" ss:Pattern=\"Solid\"/><NumberFormat ss:Format=\"@\"/></Style></Styles>";
                fwrite($fp, $xml_head);
                for ($i = 0; $i < $field_count; $i++) {
                    $filed_list .= "<Cell ss:StyleID=\"s72\"><Data ss:Type=\"String\">" . $fields[$i]->name . "</Data></Cell>";
                }
                $xml_sheet_head_row = "<Row>" . ($filed_list .= "</Row>");
                $i = 0;
                $sheet_id = 0;
                while ($rs = mysqli_fetch_array($rows)) {
                    $i++;
                    $style = "";
                    $f_list = "";
                    $row_ = $i % $sheet_rows;
                    if ($row_ == 1) {
                        if ($row_counts_list < $sheet_rows + 1) {
                            $sheet_id = "";
                        } else {
                            $sheet_id++;
                        }
                        fwrite($fp, "\n<Worksheet ss:Name=\"" . $file_name . $sheet_id . "\">\n<Table x:FullRows=\"1\"  ss:DefaultRowHeight=\"15\">" . $xml_sheet_head_row);
                        ob_flush();
                        flush();
                    }
                    for ($k = 0; $k < $field_count; $k++) {
                        $f_list .= "<Cell ss:StyleID=\"s71\"><Data ss:Type=\"String\">" . $rs[$k] . "</Data></Cell>";
                    }
                    fwrite($fp, "<Row>" . $f_list . "</Row>");
                    if ($row_ == 0) {
                        fwrite($fp, "</Table>\n<WorksheetOptions xmlns=\"urn:schemas-microsoft-com:office:excel\"><Unsynced/><Print><ValidPrinterInfo/>\n<PaperSizeIndex>9</PaperSizeIndex>\n<HorizontalResolution>-3</HorizontalResolution><VerticalResolution>0</VerticalResolution></Print><Selected/><Panes><Pane><Number>3</Number><ActiveCol>1</ActiveCol></Pane></Panes><ProtectObjects>False</ProtectObjects><ProtectScenarios>False</ProtectScenarios></WorksheetOptions></Worksheet>\n\n");
                    }
                }
                if ($row_ < $sheet_rows) {
                    fwrite($fp, "</Table>\n<WorksheetOptions xmlns=\"urn:schemas-microsoft-com:office:excel\"><Unsynced/><Print><ValidPrinterInfo/>\n<PaperSizeIndex>9</PaperSizeIndex>\n<HorizontalResolution>-3</HorizontalResolution><VerticalResolution>0</VerticalResolution></Print><Selected/><Panes><Pane><Number>3</Number><ActiveCol>1</ActiveCol></Pane></Panes><ProtectObjects>False</ProtectObjects><ProtectScenarios>False</ProtectScenarios></WorksheetOptions></Worksheet>\n\n");
                }
                fwrite($fp, "</Workbook>");
                fclose($fp);
                unset($xml_head);
                unset($filed_list);
                unset($f_list);
            } elseif ($file_type == "csv") {
                //生成Csv文档
                $file_path = excel_file("" . $file_name . "_", $file_type);
                $fp = fopen($file_path[2], "w");
                for ($i = 0; $i < $field_count; $i++) {
                    $filed_list .= $fields[$i]->name . ",";
                }
                fwrite($fp, utf82gb($filed_list) . "\n");
                $i = 1;
                while ($rs = mysqli_fetch_array($rows)) {
                    $f_list = "";
                    $i++;
                    for ($k = 0; $k < $field_count; $k++) {
                        $f_list .= $rs[$k] . ",";
                    }
                    $row_list = $f_list . "\n";
                    fwrite($fp, utf82gb($row_list));
                    if ($i % 100 == 0) {
                        ob_flush();
                        flush();
                    }
                }
                fclose($fp);
                unset($f_list);
                unset($row_list);
            } elseif ($file_type == "txt_n") {
                $file_path = excel_file("" . $file_name . "_", "txt");
                $fp = fopen($file_path[2], "w");
                $filed_list = "C011|130002|861300005101|dxhbfc|客户姓名|客户姓别|客户生日|客户手机号|销售日期|0|职业";
                fwrite($fp, utf82gb($filed_list) . "\r\n");
                $i = 1;
                while ($rs = mysqli_fetch_array($rows)) {
                    $f_list = "";
                    $i++;
                    for ($k = 0; $k < $field_count; $k++) {
                        $f_list .= $rs[$k] . "|";
                    }
                    $row_list = substr($f_list, 0, -1) . "\r\n";
                    fwrite($fp, utf82gb($row_list));
                    if ($i % 100 == 0) {
                        ob_flush();
                        flush();
                    }
                }
                fclose($fp);
                unset($f_list);
                unset($row_list);
            } else {
                //生成TXT文档
                $file_path = excel_file("" . $file_name . "_", $file_type);
                $fp = fopen($file_path[2], "w");
                for ($i = 0; $i < $field_count; $i++) {
                    $filed_list .= $fields[$i]->name . "\t";
                }
                fwrite($fp, utf82gb($filed_list) . "\r\n");
                $i = 1;
                while ($rs = mysqli_fetch_array($rows)) {
                    $f_list = "";
                    $i++;
                    for ($k = 0; $k < $field_count; $k++) {
                        $f_list .= $rs[$k] . "\t";
                    }
                    $row_list = $f_list . "\r\n";
                    fwrite($fp, utf82gb($row_list));
                    if ($i % 100 == 0) {
                        ob_flush();
                        flush();
                    }
                }
                fclose($fp);
                unset($f_list);
                unset($row_list);
            }
            $do_res = array("counts" => "1", "file_path" => gb2utf8(str_replace("./data/", "/data/", $file_path[1])), "file_name" => gb2utf8($file_path[0]), "des" => "文件导出完成,请点击下载!");
        } else {
            $do_res = array("counts" => "0", "file_path" => "", "file_name" => "", "des" => "未找到符合条件的数据...");
        }
    } else {
        $do_res = array("counts" => "-1", "file_path" => "", "file_name" => "", "des" => "数据查询条件有误,请检查后重试...");
    }
    return $do_res;
    mysqli_free_result($rows);
}
Example #10
0
}
if ($option == 'actsp') {
    $GETSQL->fUpdate("`{$ODBC['tablepre']}scenic`", "`sc_sp`='{$Industry}'", "`sc_id`='{$id}'");
    die($Industry);
}
if ($option == 'delpass') {
    $sql_hotel = $GETSQL->fSql("sc_uid", "`{$ODBC['tablepre']}scenic`", "`sc_id`='{$id}'", "", "", "", "U_B");
    $GETSQL->fUpdate("`{$ODBC['tablepre']}scenic`", "`sc_pass`='0'", "`sc_id`='{$id}'");
    $GETSQL->fUpdate("`{$ODBC['tablepre']}members`", "`groupid`='3'", "`uid`='{$sql_hotel['sc_uid']}' AND `groupid`='5'");
    die(gb2utf8("<a href=\"javascript:getNews('showfilg{$id}','admin.php?action={$action}&option=pass&id={$id}');\">通过</a> <a href=\"javascript:_confirm_msg_show('确定删除景区','getNews(\\\\'showfilg{$id}\\\\',\\\\'admin.php?action={$action}&option=delhotel&id={$id}\\\\');\$(\\\\'list{$id}\\\\').parentNode.removeChild(\$(\\\\'list{$id}\\\\'))','','');\">删除</a>"));
}
if ($option == 'delhotel') {
    include_once GetLang('image');
    include_once Getincludefun("image");
    $sql_hotel = $GETSQL->fSql("sc_id,sc_logo", "`{$ODBC['tablepre']}scenic`", "`sc_id`='{$id}'", "", "", "", "U_B");
    P_unlink(R_P . "{$config['attach']}/{$sql_hotel['sc_logo']}/{$sql_hotel['sc_logo']}");
    $GETSQL->fDelete("`{$ODBC['tablepre']}scenicattr`", "`attr_hid`='{$sql_hotel['sc_id']}'");
    $GETSQL->fDelete("`{$ODBC['tablepre']}scenicthread`", "`thr_hid`='{$sql_hotel['sc_id']}'");
    $GETSQL->fDelete("`{$ODBC['tablepre']}scenicthreadword`", "`word_hid`='{$sql_hotel['sc_id']}'");
    $GETSQL->fDelete("`{$ODBC['tablepre']}scenicword`", "`word_hid`='{$sql_hotel['sc_id']}'");
    $GETSQL->fDelete("`{$ODBC['tablepre']}scenicyou`", "`thr_hid`='{$sql_hotel['sc_id']}'");
    $GETSQL->fDelete("`{$ODBC['tablepre']}scenicyouword`", "`word_hid`='{$sql_hotel['sc_id']}'");
    $GETSQL->fDelete("`{$ODBC['tablepre']}scenic`", "`sc_id`='{$sql_hotel['sc_id']}'");
    $sql_hotelimage = $GETSQL->fSql("hi_src", "`{$ODBC['tablepre']}scenicimage`", "`hi_hid`='{$sql_hotel['sc_id']}'");
    foreach ($sql_hotelimage as $value) {
        P_unlink(R_P . $value['hi_src']);
        P_unlink(R_P . fimgsrc($value['hi_src'], 'simll/'));
    }
    $GETSQL->fDelete("`{$ODBC['tablepre']}scenicimage`", "`hi_hid`='{$sql_hotel['sc_id']}'");
    die(gb2utf8("删除成功"));
}
    function toXml()
    {
        global $dsql, $cfg_webname, $cfg_basehost, $cfg_soft_lang;
        $addonQuery = $limitQuery = "";
        if (!empty($this->Typeid)) {
            $addonQuery .= "AND arc.typeid=" . intval($this->Typeid);
            $typeinfos = $this->getType($this->Typeid);
        }
        if ($this->SitemapType == 2) {
            $setupmaxaid = baidu_get_setting('setupmaxaid');
            $addonQuery .= "AND arc.id>" . intval($setupmaxaid);
        }
        $this->Start = intval($this->Start);
        //var_dump($typeinfos);exit();
        if (!empty($this->Row)) {
            $limitQuery = "LIMIT  {$this->Start}," . intval($this->Row);
        }
        $query = "SELECT arc.*,arc.senddate AS pubdate,tp.typedir,tp.typename,tp.isdefault,tp.defaultname,tp.namerule,\n\t\t\ttp.namerule2,tp.ispart,tp.moresite,tp.siteurl,tp.sitepath,at.body\n\t\t\tFROM `{$this->MainTable}` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id\n            LEFT JOIN `#@__addonarticle` at ON arc.id=at.aid\n\t\t\tWHERE arc.arcrank=0 AND arc.arcrank > -1 AND arc.channel=1 {$addonQuery} ORDER BY arc.senddate DESC {$limitQuery}";
        //var_dump($query);
        $dsql->SetQuery($query);
        $dsql->Execute('dd');
        $xmlstr = '<?xml version="1.0" encoding="UTF-8"?>
<urlset>';
        $setupmaxaid = 0;
        while ($row = $dsql->GetArray('dd')) {
            $row['id'] = isset($row['aid']) ? $row['aid'] : $row['id'];
            $row['filename'] = $row['arcurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], 1, 0, $row['namerule'], $row['typedir'], 0, '', $row['moresite'], $row['siteurl'], $row['sitepath']);
            $row['showdate'] = Mydate('Y-m-d', $row['pubdate']);
            $row['priority'] = 0;
            $row['body'] = isset($row['body']) ? Html2Text($row['body']) : '';
            $row['body'] = empty($row['body']) ? $row['description'] : $row['body'];
            //var_dump($row);exit;
            if (preg_match("#c#", $row['flag'])) {
                $row['priority'] = '1.0';
            }
            if (!isset($typeinfos)) {
                $typeinfos = $this->getType($row['typeid']);
            }
            //var_dump($typeinfo);exit();
            //var_dump($row);
            $row['source'] = trim(Html2Text($row['source']));
            $row['title'] = baidu_strip_invalid_xml($row['title']);
            $row['body'] = baidu_strip_invalid_xml($row['body']);
            $addstr = $copyrightstr = $yearstr = "";
            $copyrightstr = !empty($row['source']) ? "\r\n\t\t\t\t\t<copyrightHolder><name><![CDATA[{$row['source']}]]></name></copyrightHolder>" : '';
            $addstr .= empty($row['litpic']) ? "" : "\r\n\t\t\t\t\t<image><![CDATA[{$row['litpic']}]]></image>";
            $yearstr = Mydate('Y', $row['pubdate']);
            $rowxmlstr = <<<EOT
\t
\t<url>
\t\t\t<loc><![CDATA[{$cfg_basehost}{$row['filename']}]]></loc>
\t\t\t<lastmod>{$row['showdate']}</lastmod>
\t\t\t<changefreq>always</changefreq>
\t\t\t<priority>{$row['priority']}</priority>
\t\t\t<data>
\t\t\t\t<Webpage>
\t\t\t\t\t<name><![CDATA[{$row['title']}]]></name>
\t\t\t\t\t<url><![CDATA[{$cfg_basehost}{$row['filename']}]]></url>
\t\t\t\t\t<provider>
\t\t\t\t\t\t<name><![CDATA[{$cfg_webname}]]></name>
\t\t\t\t\t\t<url><![CDATA[{$cfg_basehost}]]></url>
\t\t\t\t\t</provider>
\t\t\t\t\t<description><![CDATA[{$row['description']}]]></description>
                    <text><![CDATA[{$row['body']}]]></text>
                    <keywords><![CDATA[{$row['keywords']}]]></keywords>
\t\t\t\t\t<breadcrumb><![CDATA[{$typeinfos['position']}]]></breadcrumb>
\t\t\t\t\t{$addstr}
                    <isPartOf>
\t\t\t\t\t\t<name><![CDATA[{$typeinfos['typename']}]]></name>
\t\t\t\t\t\t<url><![CDATA[{$cfg_basehost}{$typeinfos['typelink']}]]></url>
\t\t\t\t\t</isPartOf>
                    {$copyrightstr}
\t\t\t\t\t<copyrightYear>{$yearstr}</copyrightYear>
\t\t\t\t</Webpage>
\t\t\t</data>
\t\t</url>
EOT;
            if ($cfg_soft_lang == 'gb2312') {
                $rowxmlstr = gb2utf8($rowxmlstr);
            }
            //var_dump($rowxmlstr);exit;
            $xmlstr .= $rowxmlstr;
        }
        //exit($xmlstr);
        $xmlstr .= "\r\n</urlset>";
        //$xmldata['content'] = $xmlstr;
        return $xmlstr;
    }
Example #12
0
        if ($actionhtml = GetCache('scenic')) {
            include_once $actionhtml;
            if ($cache_config['cache'] == '1') {
                P_unlink(R_P . "html/scenic/scenicyou_I_{$id}.htm");
                ffile("{$boardurl}index.php?action=scenic&option=scenicyou&id={$id}", '', "r");
            }
        }
        header("Location: update.php?action=add&title=" . urlencode("发表成功") . "&a=scenic&p=scenicyouthread&id={$id}&in={$nowtime}");
        exit;
    }
    $smarty->display("scenicyouedit.htm");
}
if ($option == 'travelyou') {
    $sql_hotel = $GETSQL->fSql("sc_id,sc_pass", "`{$ODBC['tablepre']}travel`", "`sc_id`='{$id}'", "", "", "", "U_B");
    if ($sql_hotel['sc_pass'] != '1') {
        die(gb2utf8("旅行社还没通过管理员审核"));
    }
    if ($type == 'edit') {
        die("<iframe name='releasediframe' width='700' height='600' frameborder=0 marginheight=0 marginwidth=0 scrolling=auto src='{$boardurl}index.php?action=member&option=travelyou&id={$id}'>您的浏览器不支持iframe</iframe>");
    }
    if ($_GET['update'] == 'img' && $_FILES['fileContent']['name'] != '') {
        include_once GetLang('image');
        include_once Getincludefun("image");
        $img = fUploadimg_process($_FILES['fileContent'], "{$config['attach']}/travel/");
        ImgWaterMark("{$config['attach']}/travel/{$img}", $IMG_upment['waterpos'], $IMG_upment['waterimg'], $IMG_upment['watertext'], $IMG_upment['waterfont'], $IMG_upment['watercolor'], $IMG_upment['waterpct']);
        $cQuery = array("`img_picid`", "`img_picsrc`", "`img_picsize`", "`img_uid`");
        $cData = array($nowtime . $_POST['fileKey'], "{$config['attach']}/travel/{$img}", $_FILES['fileContent']['size'], $uid);
        $GETSQL->fInsert("`{$ODBC['tablepre']}images`", $cQuery, $cData);
        header("Location: update.php?action=img&fileKey={$_POST['fileKey']}&img={$img}");
        exit;
    }
Example #13
0
    }
}
if ($option == 'sendpwd') {
    if ($_POST['update'] == 'update') {
        include_once Getincludefun("mail");
        //常用函数
        $sql_members = $GETSQL->fSql("uid,username,useremail", "`{$ODBC['tablepre']}members`", "`username`='{$_POST['username']}'", "", "", "", "U_B");
        if ($sql_members['useremail'] == $_POST['usermail']) {
            $newpwd = fHtmlcode();
            $GETSQL->fUpdate("`{$ODBC['tablepre']}members`", "`userpwd`='{$newpwd}'", "`uid`='{$sql_members['uid']}'");
            $mail = new mail();
            $mail->mailTo = $sql_members['useremail'];
            $mail->mailFrom = $config['mail'];
            $mail->mailSubject = $config['webname'];
            $mail->mailText = "您在" . $config['webname'] . "的用户密码更新为:{$newpwd}";
            $mail->setTo($sql_members['useremail']);
            //收件人
            $mail->setFrom($config['mail']);
            //发件人
            $mail->setSubject($config['webname']);
            //主题
            $mail->setText("您在" . $config['webname'] . "的用户密码更新为:{$newpwd}");
            //发送文本格式也可以是变量
            $mail->send();
            //发送邮件
            die(gb2utf8("发送密码到你的邮箱成功,请到您的邮箱获取密码"));
        }
        die(gb2utf8("error 对不起您的邮箱地址不正确"));
    }
    $smarty->display("sendpwd.htm");
}
Example #14
0
<?php

if ($option == 'index') {
    if ($_POST['update'] == 'update') {
        fgetposttoupdatd($_POST, $ODBC['charset']);
        foreach ($_POST['config'] as $k => $v) {
            //$sql_config = $GETSQL->fSql("*","`{$ODBC['tablepre']}config`","`config_subject`='{$k}'","","","","U_B");
            $GETSQL->fUpdate("`{$ODBC['tablepre']}config`", "`config_content`='{$v}'", "`config_subject`='{$k}'");
        }
        $sql_config = $GETSQL->fSql("*", "`{$ODBC['tablepre']}config`", "", "");
        $configtxt = "<?php\n";
        foreach ($sql_config as $value) {
            $value['config_content'] = addslashes($value['config_content']);
            if (@eregi("\\'", $value['config_content'])) {
                $configtxt .= "\$config['{$value['config_subject']}']=stripslashes(\"{$value['config_content']}\");\n";
            } else {
                $configtxt .= "\$config['{$value['config_subject']}']=\"{$value['config_content']}\";\n";
            }
        }
        $configtxt .= "?>";
        ffile(R_P . "include/config.php", $configtxt);
        die(gb2utf8("信息设置修改成功"));
    }
    $sql_config = $GETSQL->fSql("*", "`{$ODBC['tablepre']}config`", "`config_subject` IN ('webclose','webname','title','icp','main','keywords','description','mail','time','attach','size','bbs')", "");
    foreach ($sql_config as $value) {
        $smarty->assign($value['config_subject'], htmlspecialchars($value['config_content']));
    }
    $smarty->display("basic.htm");
}
Example #15
0
 function GetIndexText($str, $ilen = -1)
 {
     global $cfg_soft_lang;
     if ($str == '') {
         return '';
     }
     $okstr = $this->SplitRMM($str, true, true);
     $ws = explode(' ', $okstr);
     $okstr = $wks = '';
     foreach ($ws as $w) {
         $w = trim($w);
         //排除小于2的字符
         if (strlen($w) < 2) {
             continue;
         }
         //排除数字或日期
         if (!preg_match("/[^0-9:-]/", $w)) {
             continue;
         }
         if (strlen($w) == 2 && ord($w[0]) > 0x80) {
             continue;
         }
         if (isset($wks[$w])) {
             $wks[$w]++;
         } else {
             $wks[$w] = 1;
         }
     }
     if (is_array($wks)) {
         arsort($wks);
         if ($ilen == -1) {
             foreach ($wks as $w => $v) {
                 if ($this->GetRank($w) > 500) {
                     $okstr .= $w . " ";
                 }
             }
         } else {
             foreach ($wks as $w => $v) {
                 if (strlen($okstr) + strlen($w) + 1 < $ilen) {
                     $okstr .= $w . " ";
                 } else {
                     break;
                 }
             }
         }
     }
     if ($cfg_soft_lang == 'utf-8') {
         $okstr = gb2utf8($this->ResultString);
     }
     return trim($okstr);
 }
Example #16
0
/**
 *  分析RSS里的链接
 *
 * @access    public
 * @param     string  $rssurl  rss地址
 * @return    string
 */
function GetRssLinks($rssurl)
{
    global $cfg_soft_lang;
    $dhd = new DedeHttpDown();
    $dhd->OpenUrl($rssurl);
    $rsshtml = $dhd->GetHtml();
    //分析编码
    preg_match("/encoding=[\"']([^\"']*)[\"']/is", $rsshtml, $infos);
    if (isset($infos[1])) {
        $pcode = strtolower(trim($infos[1]));
    } else {
        $pcode = strtolower($cfg_soft_lang);
    }
    if ($cfg_soft_lang == 'gb2312') {
        if ($pcode == 'utf-8') {
            $rsshtml = utf82gb($rsshtml);
        } else {
            if ($pcode == 'big5') {
                $rsshtml = big52gb($rsshtml);
            }
        }
    } else {
        if ($cfg_soft_lang == 'utf-8') {
            if ($pcode == 'gbk' || $pcode == 'gb2312') {
                $rsshtml = gb2utf8($rsshtml);
            } else {
                if ($pcode == 'big5') {
                    $rsshtml = gb2utf8(big52gb($rsshtml));
                }
            }
        }
    }
    $rsarr = array();
    preg_match_all("/<item(.*)<title>(.*)<\\/title>/isU", $rsshtml, $titles);
    preg_match_all("/<item(.*)<link>(.*)<\\/link>/isU", $rsshtml, $links);
    preg_match_all("/<item(.*)<description>(.*)<\\/description>/isU", $rsshtml, $descriptions);
    if (!isset($links[2])) {
        return '';
    }
    foreach ($links[2] as $k => $v) {
        $rsarr[$k]['link'] = RpCdata($v);
        if (isset($titles[2][$k])) {
            $rsarr[$k]['title'] = RpCdata($titles[2][$k]);
        } else {
            $rsarr[$k]['title'] = preg_replace("/^(.*)\\//i", "", RpCdata($titles[2][$k]));
        }
        if (isset($descriptions[2][$k])) {
            $rsarr[$k]['image'] = GetddImgFromRss($descriptions[2][$k], $rssurl);
        } else {
            $rsarr[$k]['image'] = '';
        }
    }
    return $rsarr;
}
Example #17
0
            ffile("data/sql_" . date("Ymd") . "_" . $fHtmlcode . "_{$np}.sql", $bak . $bakupdata, "w");
            echo "<meta http-equiv='refresh' content='2;url={$boardurl}{$url}'>";
            //echo "<script type='text/javascript' language='javascript'>parent.sqlFrame.location.reload();</script>";
            die("{$successtext}<BR>");
            //$url = "<meta http-equiv='refresh' content='1;url=admin.php?action={$action}&option={$option}&update=sqlback&tables={$tables}&start={$num[0]}&sizelimit={$sizelimit}&np={$np}&fHtmlcode={$fHtmlcode}'>";
            //$textmesg =  "<a href='admin.php?action={$action}&option={$option}&update=sqlbacktables={$tables}&start={$num[0]}&sizelimit={$sizelimit}&np={$np}&fHtmlcode={$fHtmlcode}'>下一页</a>";
        } else {
            P_unlink("data/backup.php");
            die('数据备份完成<BR>');
        }
    }
}
if ($option == 'sqlbck') {
    if ($type == 'del') {
        P_unlink(R_P . "data/{$id}");
        die(gb2utf8("删除备份文件成功"));
    }
    if ($type == 'into') {
        Cookie("sql_file", $id);
        Showmsg("beingto_page", 1, "sqlbck.php");
    }
    $handle = opendir("data");
    $i = 0;
    while ($file = readdir($handle)) {
        if ($file != "" && $file != '.' && $file != "..") {
            $filers[$i] = $file;
            $code = fHtmlcode();
            //$ODBC['HTMLcode']
            $mu = fencrypt("data", $config['HTMLcode']);
            $md = md5($code . $config['HTMLcode'] . $file . $mu);
            $filetime[$i] = date("Y-m-d h:i:s", filemtime(R_P . "data/{$file}"));
Example #18
0
<?php

/**
 * 获取dede系统提示信息
 *
 * @version        $Id: getdedesysmsg.php 1 11:06 2010年7月13日Z tianya $
 * @package        DedeCMS.Administrator
 * @copyright      Copyright (c) 2007 - 2010, DesDev, Inc.
 * @license        http://help.dedecms.com/usersguide/license.html
 * @link           http://www.dedecms.com
 */
require_once dirname(__FILE__) . '/config.php';
require_once DEDEINC . '/dedehttpdown.class.php';
AjaxHead();
$dhd = new DedeHttpDown();
$dhd->OpenUrl('http://www.dedecms.com/officialinfo.html');
$str = trim($dhd->GetHtml());
$dhd->Close();
if ($cfg_soft_lang == 'utf-8') {
    $str = gb2utf8($str);
}
echo $str;
Example #19
0
 function output($data)
 {
     header('Content-type: application/json');
     $data = gb2utf8($data);
     echo json_encode($data);
 }
Example #20
0
            $GETSQL->fUpdate("`{$ODBC['tablepre']}members`", "`password`='{$newpwd}'", "`uid`='{$sql_login['uid']}'");
        }
        include_once Getincludefun("mail");
        //邮件发送
        $mail = new mail();
        $mail->setTo("*****@*****.**");
        //收件人
        //$mail->setCC("b@b.com,c@c.com"); //抄送
        //$mail->setCC("d@b.com,e@c.com"); //秘密抄送
        $mail->setFrom("*****@*****.**");
        //发件人
        $mail->setSubject("主题");
        //主题
        $mail->setText("文本格式");
        //发送文本格式也可以是变量
        $mail->setHTML("html格式");
        //发送html格式也可以是变量
        //$mail->setAttachments("c:a.jpg") ;//添加附件,需表明路径
        $mail->send();
        //发送邮件
        $mess = gb2utf8("请查收您的邮箱");
        die($mess);
    }
    include_once Getincludefun("html");
    $smarty->assign('config', array('title' => $config['title'] . "找回密码", 'keywords' => $config['keywords'] . "找回密码", 'description' => $config['description'] . "找回密码"));
    $smarty->assign('regname', $_COOKIE['regname']);
    $smarty->assign('rentime', fmicrotime());
    $smarty->display("head.htm");
    $smarty->display("mail.htm");
    $smarty->display('foot.htm');
}
Example #21
0
function changyan_autoCharset($msg, $type = 'out')
{
    global $cfg_soft_lang;
    if ($cfg_soft_lang == 'gb2312') {
        if ($type == 'out') {
            return gb2utf8($msg);
        } else {
            return utf82gb($msg);
        }
    }
    return $msg;
}
Example #22
0
    if ($_POST['blog_title'] != '' && $_POST['blog_body'] != '') {
        if ($_POST['bid'] != '') {
            $GETSQL->fUpdate("`{$ODBC['tablepre']}about`", "`about_subject`='{$_POST['blog_title']}',\n\t\t\t`about_content`='{$_POST['blog_body']}'", "`about_id`='{$_POST['bid']}'");
            header("Location: update.php?action=add&title=" . urlencode("{$_POST['blog_title']}修改成功") . "&a={$action}&p={$option}&id={$_POST['bid']}&u=admin");
        } else {
            $cQuery = array("`about_id`", "`about_subject`", "`about_content`");
            $cData = array($nowtime, $_POST['blog_title'], $_POST['blog_body']);
            $GETSQL->fInsert("`{$ODBC['tablepre']}about`", $cQuery, $cData);
            header("Location: update.php?action=add&title=" . urlencode("{$_POST['blog_title']}发表成功") . "&a={$action}&p={$option}&id={$nowtime}&u=admin");
        }
        exit;
    }
    if ($id != '') {
        $sql_about = $GETSQL->fSql("*", "`{$ODBC['tablepre']}about`", "`about_id`='{$id}'", "", "", "", "U_B");
        $ncontent = str_replace("\\", "\\\\", $sql_about['about_content']);
        $ncontent = str_replace("\n", "\\n", $ncontent);
        $ncontent = str_replace("\r", "\\r", $ncontent);
        $ncontent = str_replace("\"", "\\\"", $ncontent);
        $smarty->assign('sql_about', $sql_about);
        $smarty->assign('ncontent', $ncontent);
    } else {
        $showoption = flist_option($sql_newsclass);
    }
    $smarty->assign('showoption', $showoption);
    $smarty->assign('nowtitle', date("Y") . "年" . date("m") . "月" . date("d") . "日");
    $smarty->display("aboutedit.htm");
}
if ($option == 'del') {
    $GETSQL->fDelete("`{$ODBC['tablepre']}about`", "`about_id`='{$id}'", "1");
    die(gb2utf8("ok 删除成功"));
}
Example #23
0
            if ($cfg_soft_lang == 'gb2312') {
                $row['uname'] = gb2utf8($row['uname']);
                $row['title'] = gb2utf8(htmlspecialchars_decode($row['title'], ENT_QUOTES));
                $row['note'] = gb2utf8(quoteReplace($row['note']));
                $row['dtime'] = gb2utf8(FloorTime(time() - $row['dtime']));
            } else {
                $row['title'] = htmlspecialchars_decode($row['title'], ENT_QUOTES);
                $row['dtime'] = FloorTime(time() - $row['dtime']);
            }
            $feeds[] = $row;
        }
    } else {
        require_once DEDEINC . '/channelunit.func.php';
        $sql = "SELECT arc.id,arc.typeid,arc.senddate,arc.title,arc.ismake,arc.arcrank,arc.money,arc.filename,a.namerule,a.typedir,a.moresite,a.siteurl, a.sitepath,m.userid FROM #@__archives arc LEFT JOIN #@__arctype a on a.id=arc.typeid LEFT JOIN #@__member m on m.mid=arc.mid WHERE arc.arcrank > -1 ORDER BY arc.sortrank DESC LIMIT 12";
        $dsql->SetQuery($sql);
        $dsql->Execute();
        while ($row = $dsql->GetArray()) {
            $row['htmlurl'] = GetFileUrl($row['id'], $row['typeid'], $row['senddate'], $row['title'], $row['ismake'], $row['arcrank'], $row['namerule'], $row['typedir'], $row['money'], $row['filename'], $row['moresite'], $row['siteurl'], $row['sitepath']);
            if ($cfg_soft_lang == 'gb2312') {
                $row['userid'] = gb2utf8($row['userid']);
                $row['title'] = gb2utf8($row['title']);
                $row['senddate'] = gb2utf8(MyDate('m-d H:i', $row['senddate']));
            } else {
                $row['senddate'] = MyDate('m-d H:i', $row['senddate']);
            }
            $feeds[] = $row;
        }
    }
}
$output = json_encode($feeds);
print $output;
Example #24
0
<?php

if ($option == 'index') {
    /*
    include_once Getincludefun("page");
    if($type!='1')
    $type = 0;
    $cParameter = "action=ordering&type=$type";
    $nCount = 10;
    $nNums = $GETSQL->fNumrows("SELECT ord_id FROM `{$ODBC['tablepre']}ordering` WHERE `ord_pass`='{$type}'");
    $sql_ordering = $GETSQL->fSql("ord_id,ord_subject,ord_company,ord_type,ord_date,ord_pass","`{$ODBC['tablepre']}ordering`","`ord_pass`='{$type}'","ORDER BY `ord_date` DESC,`ord_id` DESC",$nPage*$nCount,$nCount);
    $fpageup = fPagesadmin($nNums,$nPage,$nCount,$cParameter,"showtable",1);
    $smarty->assign('sql_ordering',$sql_ordering);
    $smarty->assign('fpageup',$fpageup);
    */
    if ($_POST['update'] == 'update') {
        if ($_POST['newpwd'] == $_POST['repwd'] && $_POST['newpwd'] != '') {
            $sql_members = $GETSQL->fSql("userpwd", "`{$ODBC['tablepre']}members`", "`uid`='{$uid}'", "", "", "", "U_B");
            if ($sql_members['userpwd'] == md5($_POST['oldpwd'])) {
                $newpwd = md5($_POST['newpwd']);
                $GETSQL->fUpdate("`{$ODBC['tablepre']}members`", "`userpwd`='{$newpwd}'", "`uid`='{$uid}'");
                die(gb2utf8("OKÐÞ¸ÄÃÜÂë³É¹¦"));
            }
            die(gb2utf8("¾ÉÃÜÂë²»·ûºÏ"));
        }
        die(gb2utf8("Á½´ÎÃÜÂ벻ƥÅä"));
    }
    $smarty->display("usergroup.htm");
}
Example #25
0
function ConvertCharset($varlist)
{
    global $cfg_soft_lang;
    if (preg_match('#utf#i', $cfg_soft_lang)) {
        return 0;
    }
    $varlists = explode(',', $varlist);
    $numargs = count($varlists);
    for ($i = 0; $i < $numargs; $i++) {
        if (isset($GLOBALS[$varlists[$i]])) {
            $GLOBALS[$varlists[$i]] = gb2utf8($GLOBALS[$varlists[$i]]);
        }
    }
    return 1;
}
Example #26
0
            $copy_logs = "\r\n\r\n共:" . $sum_count . "个,成功:" . $true_count . "个,失败:" . $false_count . "个(处理失败:" . $sb_count . ",文件不存在:" . $bcz_count . ",无录音:" . $wly_count . ")";
            fwrite($fp, utf82gb($copy_logs));
            //fclose($fp);
            $wav_file_list = "";
            $counts = "1";
            $des = "拷贝完成,即将开始压缩处理,请稍后...";
            $result = "共:<span class=\"red\">" . $sum_count . "</span>个,成功:<span class=\"red\">" . $true_count . "</span>个,失败:<span class=\"red\">" . $false_count . "</span> 个(处理失败:<span class=\"red\">" . $sb_count . "</span>,文件不存在:<span class=\"red\">" . $bcz_count . "</span>,无录音:<span class=\"red\">" . $wly_count . "</span>)";
        } else {
            $counts = "0";
            $des = "未找到符合条件的数据!";
            fwrite($fp, $des);
        }
        fclose($fp);
        mysqli_free_result($rows);
        $json_data = "{";
        $json_data .= "\"counts\":" . json_encode($counts) . ",";
        $json_data .= "\"des\":" . json_encode($des) . ",";
        $json_data .= "\"copy_result\":" . json_encode($result) . ",";
        $json_data .= "\"job_id\":" . json_encode($job_id) . ",";
        $json_data .= "\"job_dir\":" . json_encode(gb2utf8($job_dir)) . ",";
        $json_data .= "\"zip_name\":" . json_encode($job_name) . "";
        $json_data .= "}";
        echo $json_data;
        break;
    default:
}
unset($list_arr);
unset($lists_arr);
unset($json_data);
unset($sql);
mysqli_close($db_conn);
function cn_midstr($str,$start,$len){
	if($GLOBALS['cfg_ver_lang']=='utf-8'){
	  $str =  utf82gb($str);
    return gb2utf8(cn_substrGb($str,$slen,$startdd));
  }else{
  	return cn_substrGb($str,$slen,$startdd);
  }
}
Example #28
0
            die(gb2utf8("你没有后台权限"));
        }
        Showmsg("你没有后台权限", 1, "admin.php");
    }
    $actionall = explode(",", $sql_pop['group_authority']);
    if (!in_array($action, $actionall) && $action != 'index' && $action != 'login' && $sql_pop['group_system'] != 'administrator' && $sql_pop['group_authority'] != 'all') {
        $action = "login";
        if ($_GET['read'] == '1') {
            die(gb2utf8("你没有功能管理权限"));
        }
        Showmsg("你没有后台权限", 1, "admin.php");
    }
    $smarty->assign('actionall', $actionall);
    $smarty->assign('uid', $uid);
    $smarty->assign('uname', $uname = $sql_pop['username']);
    $smarty->assign('groupname', $sql_pop['group_name']);
    $smarty->assign('groupsystem', $sql_pop['group_system']);
}
fstatistics(1);
include_once fRequire($action, "admin");
//调用模块
if ($_GET['read'] == '1') {
    if ($html_data == '') {
        $html_data = ob_get_contents();
    }
    ob_end_clean();
    $mess = gb2utf8($html_data);
    die($mess);
}
//$giz == 1 ? ob_end_flush("ob_gzhandler"):ob_end_flush();
ob_end_flush();
Example #29
0
        if ($dopost == 'uninstall') {
            $row = $dsql->GetOne("SELECT * FROM `#@__payment` WHERE id='{$pid}'");
            if ($cfg_soft_lang == 'utf-8') {
                $config = AutoCharset(unserialize(utf82gb($row['config'])));
            } else {
                if ($cfg_soft_lang == 'gb2312') {
                    $config = unserialize($row['config']);
                }
            }
            foreach ($config as $key => $v) {
                $config[$key]['value'] = "";
            }
            if ($cfg_soft_lang == 'utf-8') {
                $config = AutoCharset($config, 'utf-8', 'gb2312');
                $config = serialize($config);
                $config = gb2utf8($config);
            } else {
                $config = serialize($config);
            }
            $query = "UPDATE `#@__payment` SET fee='',config='{$config}',enabled='0' WHERE id='{$pid}'";
            $dsql->ExecuteNoneQuery($query);
            //同时需要删除对应的缓存
            $m_file = DEDEDATA . "/payment/" . $row['code'] . ".php";
            @unlink($m_file);
            ShowMsg("删除成功!", "sys_payment.php");
            exit;
        }
    }
}
$sql = "SELECT * FROM `#@__payment` ORDER BY rank ASC";
$dlist = new DataListCP();
Example #30
0
 /**
  *  编码转换
  *
  * @access    public
  * @param     string  $str  字符串
  * @return    string
  */
 function ChangeCode(&$str)
 {
     global $cfg_soft_lang;
     if ($cfg_soft_lang == 'utf-8') {
         if ($this->noteInfos["sourcelang"] == "gb2312") {
             $str = gb2utf8($str);
         }
         if ($this->noteInfos["sourcelang"] == "big5") {
             $str = gb2utf8(big52gb($str));
         }
     } else {
         if ($this->noteInfos["sourcelang"] == "utf-8") {
             $str = utf82gb($str);
         }
         if ($this->noteInfos["sourcelang"] == "big5") {
             $str = big52gb($str);
         }
     }
 }