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


PHP uploader::encodeCharset方法代码示例

本文整理汇总了PHP中uploader::encodeCharset方法的典型用法代码示例。如果您正苦于以下问题:PHP uploader::encodeCharset方法的具体用法?PHP uploader::encodeCharset怎么用?PHP uploader::encodeCharset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在uploader的用法示例。


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

示例1: editWork

function editWork($uid, $params)
{
    $objResponse =& new xajaxResponse();
    if ($uid == null) {
        $uid = get_uid(false);
    }
    $uid = intval($uid);
    $work_id = intval($params['id']);
    if ($uid != get_uid(false) || !get_uid(false) || $work_id < 0 || is_emp()) {
        return $objResponse;
    }
    $params = stripslashes($params);
    parse_str($params, $params);
    $params['work_descr'] = _htmlentities($params['work_descr'], 'UTF-8');
    $params['work_name'] = _htmlentities($params['work_name'], 'UTF-8');
    $params = uploader::encodeCharset($params, array('utf-8', 'cp1251'));
    $edited = portfolio::editWork($uid, $params);
    if (is_array($edited)) {
        // Вернуло ошибки
        $errors = json_encode(array_map('win2utf', $edited));
        $objResponse->script("portfolio.viewError({$errors}, 'portfolio_work_edit')");
        return $objResponse;
    }
    if ($edited) {
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stop_words.php';
        require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/professions.php';
        $first_prof = intval($params['prof_id_first']);
        $second_prof = intval($params['work_category_db_id']);
        $objResponse->script("\$('portfolio_work_edit').getParent().dispose()");
        $stop_words = new stop_words(hasPermissions('users'));
        $profession = new professions();
        $portfolio = new portfolio();
        $user = new users();
        $user->login = $_SESSION['login'];
        $user->uid = $_SESSION['uid'];
        $user->is_pro = is_pro() ? 't' : 'f';
        $is_owner = $uid == $_SESSION['uid'];
        if ($first_prof != $second_prof) {
            $pinfo = current(portfolio::getPortfolioCategory($second_prof));
            $pinfo['mainprofname'] = $pinfo['group_name'];
            $pinfo['profname'] = $pinfo['prof_name'];
            $pinfo['gr_prevs'] = $pinfo['show_preview'];
            $pinfo = $profession->prepareCostText($pinfo, $stop_words);
            $works = $portfolio->GetPortf($uid, $second_prof, true);
            if (!empty($works)) {
                $result = portfolio::prepareDataPortfolio($works, $uid, $stop_words, true);
                extract($result);
                $work[0]['id'] = 100;
                $prof_id = $second_prof;
                ob_start();
                include $_SERVER['DOCUMENT_ROOT'] . '/user/tpl.portfolio.works.php';
                $second_works = ob_get_contents();
                ob_end_clean();
            } else {
                $work[0]['id'] = null;
                $prof_id = $first_prof;
                $pp_noblocks[$prof_id] = array();
                ob_start();
                include $_SERVER['DOCUMENT_ROOT'] . '/user/tpl.portfolio.works.php';
                $first_works = ob_get_contents();
                ob_end_clean();
            }
            $pinfo = current(portfolio::getPortfolioCategory($first_prof));
            $pinfo['mainprofname'] = $pinfo['group_name'];
            $pinfo['profname'] = $pinfo['prof_name'];
            $pinfo['gr_prevs'] = $pinfo['show_preview'];
            $pinfo = $profession->prepareCostText($pinfo, $stop_words);
            $works = $portfolio->GetPortf($uid, $first_prof, true);
            if (!empty($works)) {
                $result = portfolio::prepareDataPortfolio($works, $uid, $stop_words, true);
                extract($result);
                $work[0]['id'] = 100;
                $prof_id = $first_prof;
                ob_start();
                include $_SERVER['DOCUMENT_ROOT'] . '/user/tpl.portfolio.works.php';
                $first_works = ob_get_contents();
                ob_end_clean();
            } else {
                $work[0]['id'] = null;
                $prof_id = $first_prof;
                $pp_noblocks[$prof_id] = array();
                ob_start();
                include $_SERVER['DOCUMENT_ROOT'] . '/user/tpl.portfolio.works.php';
                $first_works = ob_get_contents();
                ob_end_clean();
            }
            if ($first_works != '') {
                $objResponse->assign("prof_works_{$first_prof}", 'innerHTML', $first_works);
            }
            if ($second_works != '') {
                $objResponse->assign("prof_works_{$second_prof}", 'innerHTML', $second_works);
            }
        } else {
            $pinfo = current(portfolio::getPortfolioCategory($second_prof));
            $pinfo['mainprofname'] = $pinfo['group_name'];
            $pinfo['profname'] = $pinfo['prof_name'];
            $pinfo['gr_prevs'] = $pinfo['show_preview'];
            $pinfo = $profession->prepareCostText($pinfo, $stop_words);
            $works = $portfolio->GetPortf($uid, $second_prof, true);
            if (!empty($works)) {
//.........这里部分代码省略.........
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:101,代码来源:portfolio.server.php


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