当前位置: 首页>>代码示例>>PHP>>正文


PHP gb2utf8函数代码示例

本文整理汇总了PHP中gb2utf8函数的典型用法代码示例。如果您正苦于以下问题:PHP gb2utf8函数的具体用法?PHP gb2utf8怎么用?PHP gb2utf8使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了gb2utf8函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: CoOnePage

/**
 *  获取一个页面
 *
 * @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;
}
开发者ID:hensonvip,项目名称:ymroad,代码行数:67,代码来源:inc_coonepage.php

示例2: AppCode

 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;
                 }
             }
         }
     }
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:35,代码来源:dedemodule.class.php

示例3: ac_save

 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;
 }
开发者ID:healthguo,项目名称:PHP,代码行数:25,代码来源:slide.php

示例4: get_search_query_terms

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;
}
开发者ID:EddieRingle,项目名称:wicketpixie-old,代码行数:53,代码来源:search-highlight.php

示例5: Conv2UTF8

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);
    }
}
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:23,代码来源:txtrender.php

示例6: TO_DAYS

<?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") {
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:adminstatistics.php

示例7: RemoveXss

 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;
 }
开发者ID:CMS-CHINA,项目名称:secondary-development-of-Dedecms,代码行数:54,代码来源:datalistcp.class.php

示例8: array

            $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("友情连接操作成功"));
}
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:link.php

示例9: save_detail_excel


//.........这里部分代码省略.........
                    }
                    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);
}
开发者ID:qinlibingfeng,项目名称:CallCenter,代码行数:101,代码来源:pub_func.php

示例10: die

}
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("删除成功"));
}
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:scenic.php

示例11: toXml

    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;
    }
开发者ID:CMS-CHINA,项目名称:secondary-development-of-Dedecms,代码行数:88,代码来源:baiduxml.class.php

示例12: P_unlink

        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;
    }
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:member.php

示例13: Getincludefun

    }
}
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");
}
开发者ID:holin,项目名称:sstour,代码行数:31,代码来源:login.php

示例14: fgetposttoupdatd

<?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");
}
开发者ID:holin,项目名称:sstour,代码行数:29,代码来源:basic.php

示例15: GetIndexText

 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);
 }
开发者ID:klr2003,项目名称:sourceread,代码行数:51,代码来源:splitword.class.php


注:本文中的gb2utf8函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。