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


PHP parse_html函数代码示例

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


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

示例1: getCommentList

 /**
  * 获取评论列表,已在后台被使用
  * @param array $map 查询条件
  * @param string $order 排序条件,默认为comment_id ASC
  * @param integer $limit 结果集数目,默认为10
  * @param boolean $isReply 是否显示回复信息
  * @return array 评论列表信息
  */
 public function getCommentList($map = null, $order = 'comment_id ASC', $limit = 10, $isReply = false)
 {
     !$map['app'] && $this->_app && ($map['app'] = $this->_app);
     !$map['table'] && $this->_app_table && ($map['table'] = $this->_app_table);
     !isset($map['is_del']) && ($map['is_del'] = 0);
     $data = $this->where($map)->order($order)->findPage($limit);
     // dump($data);exit;
     // TODO:后续优化
     foreach ($data['data'] as &$v) {
         if (!empty($v['to_comment_id']) && $isReply) {
             $replyInfo = $this->setAppName($map['app'])->setAppTable($map['table'])->getCommentInfo(intval($v['to_comment_id']), false);
             $v['replyInfo'] = '//@{uid=' . $replyInfo['user_info']['uid'] . '|' . $replyInfo['user_info']['uname'] . '}:' . $replyInfo['content'];
         }
         $v['user_info'] = model('User')->getUserInfo($v['uid']);
         $groupData = static_cache('groupdata' . $v['uid']);
         if (!$groupData) {
             $groupData = model('UserGroupLink')->getUserGroupData($v['uid']);
             if (!$groupData) {
                 $groupData = 1;
             }
             static_cache('groupdata' . $v['uid'], $groupData);
         }
         $v['user_info']['groupData'] = $groupData;
         //获取用户组信息
         $v['content'] = parse_html($v['content'] . $v['replyInfo']);
         $v['sourceInfo'] = model('Source')->getSourceInfo($v['table'], $v['row_id'], false, $v['app']);
         //$v['data'] = unserialize($v['data']);
     }
     return $data;
 }
开发者ID:yang7hua,项目名称:hunshe,代码行数:38,代码来源:GroupCommentModel.class.php

示例2: notify

 /**
  * 系统通知
  * @return void
  */
 public function notify()
 {
     //$list = model('Notify')->getMessageList($this->mid);     //2012/12/27
     //下边这句是为了获取$count
     $limit = 20;
     $list = D('notify_message')->where('uid=' . $this->mid)->order('ctime desc')->findpage($limit);
     $count = $list['count'];
     $this->assign('count', $count);
     $page = $_GET['page'] ? intval($_GET['page']) : 1;
     $start = ($page - 1) * $limit;
     $list = D('notify_message')->where('uid=' . $this->mid)->order('ctime desc')->limit("{$start},{$limit}")->select();
     foreach ($list as $k => $v) {
         $list[$k]['body'] = parse_html($v['body']);
         if ($appname != 'public') {
             $list[$k]['app'] = model('App')->getAppByName($v['appname']);
         }
     }
     model('Notify')->setRead($this->mid);
     $this->assign('page', $page);
     $this->assign('list', $list);
     $this->setTitle(L('PUBLIC_MESSAGE_NOTIFY'));
     $this->setKeywords(L('PUBLIC_MESSAGE_NOTIFY'));
     $this->assign('headtitle', '系统通知');
     $this->display('mynotify');
 }
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:29,代码来源:MessageAction.class.php

示例3: parse_response

function parse_response($api, $params)
{
    global $records;
    $page = $params['from'] / $params['size'] + 1;
    echo "Page {$page}\n";
    //compare the individual request parameters into k=>v pairs to the URL
    $qparams = array();
    foreach ($params as $k => $v) {
        $qparams[] = "{$k}=" . urlencode($v);
    }
    $service = $api . implode('&', $qparams);
    //request JSON from API
    $json = file_get_contents($service);
    $data = json_decode($json);
    //iterate through results
    foreach ($data->results as $result) {
        $record = array();
        $record['id'] = $result->priref;
        $record['uri'] = "http://data.fitzmuseum.cam.ac.uk/id/object/{$result->priref}";
        $record['objectnumber'] = $result->ObjectNumber;
        $record['title'] = "Fitzwilliam Museum - Object {$result->ObjectNumber}";
        $imageCount = 0;
        foreach ($result->images->thumbnailURI as $url) {
            switch ($imageCount) {
                case 0:
                    $record['obv_image'] = $url;
                    break;
                case 1:
                    $record['rev_image'] = $url;
            }
            $imageCount++;
        }
        //begin screen scraping
        $url = "http://webapps.fitzmuseum.cam.ac.uk/explorer/index.php?oid={$result->priref}";
        $fields = parse_html($url);
        if (isset($fields['reference'])) {
            $record['reference'] = $fields['reference'];
        }
        if (isset($fields['coinType'])) {
            $record['cointype'] = $fields['coinType'];
        }
        if (isset($fields['weight'])) {
            $record['weight'] = $fields['weight'];
        }
        if (isset($fields['axis'])) {
            $record['axis'] = $fields['axis'];
        }
        $records[] = $record;
    }
    //var_dump($records);
    //if there are more pages to parse, curse function
    $numFound = $data->total;
    if ($params['from'] + $params['size'] <= $numFound) {
        $params['from'] = $params['from'] + $params['size'];
        parse_response($api, $params);
    }
}
开发者ID:AmericanNumismaticSociety,项目名称:migration_scripts,代码行数:57,代码来源:process-api.php

示例4: getReplyList

 /**
  * 获取回复列表
  * @param array $map 查询条件
  * @param string $order 排序条件,默认为comment_id ASC
  * @param integer $limit 结果集数目,默认为10
  * @return array 评论列表信息
  */
 public function getReplyList($map = null, $order = 'reply_id desc', $limit = 10)
 {
     !isset($map['is_del']) && ($map['is_del'] = 0);
     $data = $this->where($map)->order($order)->findPage($limit);
     // // TODO:后续优化
     foreach ($data['data'] as &$v) {
         $v['user_info'] = model('User')->getUserInfo($v['uid']);
         $v['user_info']['groupData'] = model('UserGroupLink')->getUserGroupData($v['uid']);
         //获取用户组信息
         $v['content'] = parse_html(h(htmlspecialchars($v['content'])));
         //$v['sourceInfo'] = model('Source')->getSourceInfo($v['table'], $v['row_id'], false, $v['app']);
     }
     return $data;
 }
开发者ID:lyhiving,项目名称:icampus,代码行数:21,代码来源:WeibaReplyModel.class.php

示例5: tz

 public function tz()
 {
     $map['uid'] = $this->mid;
     $list = D('notify_message')->where($map)->order('ctime desc')->findpage(20);
     foreach ($list['data'] as $k => $v) {
         $list['data'][$k]['body'] = parse_html($v['body']);
         if ($v['appname'] != 'public') {
             $list['data'][$k]['app'] = model('App')->getAppByName($v['appname']);
         }
     }
     model('Notify')->setRead($this->mid);
     $this->assign('list', $list);
     $this->display();
 }
开发者ID:medz,项目名称:thinksns-4,代码行数:14,代码来源:WebMessageAction.class.php

示例6: notify

 /**
  * 系统通知
  * @return void
  */
 public function notify()
 {
     //$list = model('Notify')->getMessageList($this->mid);     //2012/12/27
     $list = D('notify_message')->where('uid=' . $this->mid)->order('ctime desc')->findpage(20);
     foreach ($list['data'] as $k => $v) {
         $list['data'][$k]['body'] = parse_html($v['body']);
         if ($appname != 'public') {
             $list['data'][$k]['app'] = model('App')->getAppByName($v['appname']);
         }
     }
     model('Notify')->setRead($this->mid);
     $this->assign('list', $list);
     // dump($list);
     $this->setTitle(L('PUBLIC_MESSAGE_NOTIFY'));
     $this->setKeywords(L('PUBLIC_MESSAGE_NOTIFY'));
     $this->display('mynotify');
 }
开发者ID:songhongyu,项目名称:THINKSNS,代码行数:21,代码来源:MessageAction.class.php

示例7: getReplyList

 /**
  * 获取回复列表
  * @param  array  $map   查询条件
  * @param  string $order 排序条件,默认为comment_id ASC
  * @param  int    $limit 结果集数目,默认为10
  * @return array  评论列表信息
  */
 public function getReplyList($map = null, $order = 'reply_id desc', $limit = 10)
 {
     !isset($map['is_del']) && ($map['is_del'] = 0);
     $data = $this->where($map)->order($order)->findPage($limit);
     // // TODO:后续优化
     foreach ($data['data'] as &$v) {
         $v['user_info'] = model('User')->getUserInfo($v['uid']);
         $v['user_info']['groupData'] = model('UserGroupLink')->getUserGroupData($v['uid']);
         //获取用户组信息
         $v['content'] = parse_html(h(htmlspecialchars($v['content'])));
         //$v['sourceInfo'] = model('Source')->getSourceInfo($v['table'], $v['row_id'], false, $v['app']);
         $v['attach_info'] = model('Attach')->getAttachById($v['attach_id']);
         if ($v['attach_info']['attach_type'] == 'weiba_comment_image' || $v['attach_info']['attach_type'] == 'feed_image') {
             $v['attach_info']['attach_url'] = getImageUrl($v['attach_info']['save_path'] . $v['attach_info']['save_name'], 590);
         }
     }
     return $data;
 }
开发者ID:medz,项目名称:thinksns-4,代码行数:25,代码来源:WeibaReplyModel.class.php

示例8: get_data

function get_data($num, $url)
{
    $str = file_get_contents($url);
    $str = trim($str);
    $str = strtolower($str);
    if ($str == '') {
        $str = file_get_contents($url);
    }
    if ($str == '') {
        // recode error
        $fp = fopen('cantdown_' . $num, 'a+');
        fputs($fp, $num . '\\r\\n');
        fclose($fp);
    } else {
        $data = parse_html($str);
        if (insert_db($num, $data)) {
            echo $num . "is ok \r\n";
        }
    }
}
开发者ID:laiello,项目名称:pef,代码行数:20,代码来源:get_ip138.php

示例9: edit

 public function edit($_id = '')
 {
     $this->assigns_layout["gnb_left"] = "contents";
     if ($_REQUEST["subject"]) {
         $content_parsed = parse_html($_REQUEST["contents"]);
         foreach ($content_parsed as $c) {
             if (strtolower(substr($c, 0, 4)) == "<img") {
                 $t = tag_barase($c);
                 if ($t["src"]) {
                     $_REQUEST["img"] = $t["src"];
                     break;
                 }
             }
         }
         $_id = $this->Content->add($_REQUEST);
         if ($_REQUEST["pic"]) {
             $img_temp_name = str_replace(" ", "", $_REQUEST['pic']);
             $ck = substr($img_temp_name, 0, 1);
             if ($ck == '/') {
                 $img_temp_name = substr($img_temp_name, 1, strlen($img_temp_name) - 1);
             }
             $file_ext = explode('.', $img_temp_name);
             //$filename = basename($_FILES['file']['name']);
             $file_ext = '.' . $file_ext[sizeof($file_ext) - 1];
             $original_file = $this->settings->root_path . $img_temp_name;
             $copy_file = $this->settings->root_path . 'media/contents/' . $_id . $file_ext;
             GD2_make_thumb_x(300, "", $original_file);
             //그림 파일 update 폴더로 옮긴 후 임시파일 삭제
             copy($original_file, $copy_file);
             unlink($original_file);
             $_pic = '/media/contents/' . $_id . $file_ext;
             $this->Content->add_picture($_id, $_pic);
         }
         header("Location: /admin_contents");
     }
     if ($_id) {
         $this->assigns["res"] = $this->Content->get($_id);
     }
     $this->assigns["cat"] = $this->Content_category->list_(1, 100);
 }
开发者ID:byyeong,项目名称:dc2016,代码行数:40,代码来源:admin_contents.php

示例10: reply_commentList

 /**
  * [ 获取评论的评论列表]
  * @return [type] [description]
  */
 public function reply_commentList()
 {
     if (!CheckPermission('weiba_normal', 'weiba_reply')) {
         return false;
     }
     $var = $_POST;
     $var['initNums'] = model('Xdata')->getConfig('weibo_nums', 'feed');
     $var['commentInfo'] = model('Comment')->getCommentInfo($var['comment_id'], false);
     $var['canrepost'] = $var['commentInfo']['table'] == 'feed' ? 1 : 0;
     $var['cancomment'] = 1;
     // 获取原作者信息
     $rowData = model('Feed')->get(intval($var['commentInfo']['row_id']));
     $appRowData = model('Feed')->get($rowData['app_row_id']);
     $var['user_info'] = $appRowData['user_info'];
     // 微博类型
     $var['feedtype'] = $rowData['type'];
     // $var['cancomment_old'] = ($var['commentInfo']['uid'] != $var['commentInfo']['app_uid'] && $var['commentInfo']['app_uid'] != $this->uid) ? 1 : 0;
     if ($var['flag'] != 1) {
         $var['initHtml'] = L('PUBLIC_STREAM_REPLY') . '@' . $var['commentInfo']['user_info']['uname'] . ' :';
     }
     //获取回评
     $commentList = D('weiba_reply')->where('is_del = 0 and to_reply_id=' . $var['to_reply_id'])->order('ctime')->select();
     foreach ($commentList as $k => $v) {
         $commentList[$k]['content'] = parse_html(h(htmlspecialchars($v['content'])));
     }
     $this->assign('commentList', $commentList);
     $uids = getSubByKey($commentList, 'uid');
     $this->_assignUserInfo($uids);
     $this->assign('reply_id', $var['to_reply_id']);
     $this->assign('var', $var);
     if ($var[type] == 2) {
         $con = $this->fetch('reply_commentList1');
     } else {
         $con = $this->fetch();
     }
     echo $con;
 }
开发者ID:a349944418,项目名称:kaopu,代码行数:41,代码来源:CommentAction.class.php

示例11: addComment

 /**
  * 添加评论操作
  * @param array $data 评论数据
  * @param boolean $forApi 是否用于API,默认为false
  * @param boolean $notCount 是否统计到未读评论
  * @param array $lessUids 除去@用户ID
  * @return boolean 是否添加评论成功 
  */
 public function addComment($data, $forApi = false, $notCount = false, $lessUids = null)
 {
     // 判断用户是否登录
     if (!$GLOBALS['ts']['mid']) {
         $this->error = L('PUBLIC_REGISTER_REQUIRED');
         // 请先登录
         return false;
     }
     if (isSubmitLocked()) {
         $this->error = '发布内容过于频繁,请稍后再试!';
         return false;
     }
     /* # 将Emoji编码 */
     $data['content'] = formatEmoji(true, $data['content']);
     // 检测数据安全性
     $add = $this->_escapeData($data);
     if ($add['content'] === '') {
         $this->error = L('PUBLIC_COMMENT_CONTENT_REQUIRED');
         // 评论内容不可为空
         return false;
     }
     $add['is_del'] = 0;
     //判断是否先审后发
     $filterStatus = filter_words($add['content']);
     $weiboSet = model('Xdata')->get('admin_Config:feed');
     $weibo_premission = $weiboSet['weibo_premission'];
     if (in_array('audit', $weibo_premission) || CheckPermission('core_normal', 'feed_audit') || $filterStatus['type'] == 2) {
         $add['is_audit'] = 0;
     } else {
         $add['is_audit'] = 1;
     }
     $add['client_ip'] = get_client_ip();
     $add['client_port'] = get_client_port();
     if ($res = $this->add($add)) {
         //锁定发布
         lockSubmit();
         //添加楼层信息 弃用 20130607
         /*             $storeyCount = $this->where("table='".$add['table']."' and row_id=".$data['row_id'].' and comment_id<'.$res)->count();
                     $this->where('comment_id='.$res)->setField('storey',$storeyCount+1); */
         if (!$add['is_audit']) {
             $touid = D('user_group_link')->where('user_group_id=1')->field('uid')->findAll();
             $touidArr = getSubByKey($touid, 'uid');
             model('Notify')->sendNotify($touidArr, 'comment_audit');
         }
         // 获取排除@用户ID
         $lessUids[] = intval($data['app_uid']);
         !empty($data['to_uid']) && ($lessUids[] = intval($data['to_uid']));
         // 获取用户发送的内容,仅仅以//进行分割
         $scream = explode('//', $data['content']);
         model('Atme')->setAppName('Public')->setAppTable('comment')->addAtme(trim($scream[0]), $res, null, $lessUids);
         // 被评论内容的“评论统计数”加1,同时可检测出app,table,row_id的有效性
         $pk = D($add['table'])->getPk();
         $where = "`{$pk}`={$add['row_id']}";
         D($add['table'])->setInc('comment_count', $where);
         //兼容旧版本app
         //            D($add['table'])->setInc('commentCount', $where);
         //            D($add['table'])->setInc('comment_all_count', $where);
         D($add['app'])->setInc('commentCount', $where);
         D($add['app'])->setInc('comment_all_count', $where);
         //评论时间
         M($add['app'])->where('feed_id=' . $add['row_id'])->setField('rTime', time());
         // 给应用UID添加一个未读的评论数 原作者
         if ($GLOBALS['ts']['mid'] != $add['app_uid'] && $add['app_uid'] != '' && $add['app_uid'] != $add['to_uid']) {
             !$notCount && model('UserData')->updateKey('unread_comment', 1, true, $add['app_uid']);
         }
         // 回复发送提示信息
         if (!empty($add['to_uid']) && $add['to_uid'] != $GLOBALS['ts']['mid']) {
             !$notCount && model('UserData')->updateKey('unread_comment', 1, true, $add['to_uid']);
         }
         // 加积分操作
         if ($add['table'] == 'feed') {
             model('Credit')->setUserCredit($GLOBALS['ts']['mid'], 'comment_weibo');
             model('Credit')->setUserCredit($data['app_uid'], 'commented_weibo');
             model('Feed')->cleanCache($add['row_id']);
         }
         // 发邮件
         if ($add['to_uid'] != $GLOBALS['ts']['mid'] || $add['app_uid'] != $GLOBALS['ts']['mid'] && $add['app_uid'] != '') {
             $author = model('User')->getUserInfo($GLOBALS['ts']['mid']);
             $config['name'] = $author['uname'];
             $config['space_url'] = $author['space_url'];
             $config['face'] = $author['avatar_small'];
             $sourceInfo = model('Source')->getCommentSource($add, $forApi);
             $config['content'] = parse_html($add['content']);
             $config['ctime'] = date('Y-m-d H:i:s', time());
             $config['sourceurl'] = $sourceInfo['source_url'];
             $config['source_content'] = parse_html($sourceInfo['source_content']);
             $config['source_ctime'] = isset($sourceInfo['ctime']) ? date('Y-m-d H:i:s', $sourceInfo['ctime']) : date('Y-m-d H:i:s');
             if (!empty($add['to_uid'])) {
                 // 回复
                 $config['comment_type'] = '回复 我 的评论:';
                 model('Notify')->sendNotify($add['to_uid'], 'comment', $config);
             } else {
//.........这里部分代码省略.........
开发者ID:omusico,项目名称:ThinkSNS-4,代码行数:101,代码来源:CommentModel.class.php

示例12: addComment

 /**
  * 添加评论操作
  * @param array $data 评论数据
  * @param boolean $forApi 是否用于API,默认为false
  * @param boolean $notCount 是否统计到未读评论
  * @param array $lessUids 除去@用户ID
  * @return boolean 是否添加评论成功 
  */
 public function addComment($data, $forApi = false, $notCount = false, $lessUids = null)
 {
     // 判断用户是否登录
     if (!$GLOBALS['ts']['mid']) {
         $this->error = L('PUBLIC_REGISTER_REQUIRED');
         // 请先登录
         return false;
     }
     // 设置评论绝对楼层
     //$data['data']['storey'] = $this->getStorey($data['row_id'], $data['app'], $data['table']);
     // 检测数据安全性
     $add = $this->_escapeData($data);
     if ($add['content'] === '') {
         $this->error = L('PUBLIC_COMMENT_CONTENT_REQUIRED');
         // 评论内容不可为空
         return false;
     }
     $add['is_del'] = 0;
     //判断是否先审后发
     $weiboSet = model('Xdata')->get('admin_Config:feed');
     $weibo_premission = $weiboSet['weibo_premission'];
     if (in_array('audit', $weibo_premission) || CheckPermission('core_normal', 'feed_audit')) {
         $add['is_audit'] = 0;
     } else {
         $add['is_audit'] = 1;
     }
     if ($res = $this->add($add)) {
         //添加楼层信息
         $storeyCount = $this->where('row_id=' . $data['row_id'] . ' and comment_id<' . $res)->count();
         $this->where('comment_id=' . $res)->setField('storey', $storeyCount + 1);
         if (!$add['is_audit']) {
             $touid = D('user_group_link')->where('user_group_id=1')->field('uid')->findAll();
             foreach ($touid as $k => $v) {
                 model('Notify')->sendNotify($v['uid'], 'comment_audit');
             }
         }
         // 获取排除@用户ID
         $lessUids[] = intval($data['app_uid']);
         !empty($data['to_uid']) && ($lessUids[] = intval($data['to_uid']));
         // 获取用户发送的内容,仅仅以//进行分割
         $scream = explode('//', $data['content']);
         model('Atme')->setAppName('Public')->setAppTable('comment')->addAtme(trim($scream[0]), $res, null, $lessUids);
         // 被评论内容的“评论统计数”加1,同时可检测出app,table,row_id的有效性
         $pk = D($add['table'])->getPk();
         D($add['table'])->setInc('comment_count', "`{$pk}`={$add['row_id']}", 1);
         D($add['table'])->setInc('comment_all_count', "`{$pk}`={$add['row_id']}", 1);
         // 给应用UID添加一个未读的评论数 原作者
         if ($GLOBALS['ts']['mid'] != $add['app_uid'] && $add['app_uid'] != '') {
             !$notCount && model('UserData')->updateKey('unread_comment', 1, true, $add['app_uid']);
         }
         // 回复发送提示信息
         if (!empty($add['to_uid']) && $add['to_uid'] != $GLOBALS['ts']['mid']) {
             !$notCount && model('UserData')->updateKey('unread_comment', 1, true, $add['to_uid']);
         }
         // 加积分操作
         if ($add['table'] == 'feed') {
             model('Credit')->setUserCredit($GLOBALS['ts']['mid'], 'comment_weibo');
             model('Credit')->setUserCredit($data['app_uid'], 'commented_weibo');
             model('Feed')->cleanCache($add['row_id']);
         }
         // 发邮件
         if ($add['to_uid'] != $GLOBALS['ts']['mid'] || $add['app_uid'] != $GLOBALS['ts']['mid'] && $add['app_uid'] != '') {
             $author = model('User')->getUserInfo($GLOBALS['ts']['mid']);
             $config['name'] = $author['uname'];
             $config['space_url'] = $author['space_url'];
             $config['face'] = $author['avatar_middle'];
             $sourceInfo = model('Source')->getSourceInfo($add['table'], $add['row_id'], $forApi, $add['app']);
             $config['content'] = parse_html($add['content']);
             $config['ctime'] = date('Y-m-d H:i:s', time());
             $config['sourceurl'] = $sourceInfo['source_url'];
             $config['source_content'] = parse_html($sourceInfo['source_content']);
             $config['source_ctime'] = date('Y-m-d H:i:s', $sourceInfo['ctime']);
             if (!empty($add['to_uid'])) {
                 // 回复
                 $config['comment_type'] = '回复 我 的评论:';
                 model('Notify')->sendNotify($add['to_uid'], 'comment', $config);
             } else {
                 // 评论
                 $config['comment_type'] = '评论 我 的微博:';
                 if (!empty($add['app_uid'])) {
                     model('Notify')->sendNotify($add['app_uid'], 'comment', $config);
                 }
             }
         }
     }
     $this->error = $res ? L('PUBLIC_CONCENT_IS_OK') : L('PUBLIC_CONCENT_IS_ERROR');
     // 评论成功,评论失败
     return $res;
 }
开发者ID:naliduo,项目名称:ThinkSNS,代码行数:97,代码来源:CommentModel.class.php

示例13: regular_express

function regular_express($regexp_array, $thevar)
{
    #$regexp_array[2].='S'; # in benchmarks, this 'optimization' appeared to not do anything at all, or possibly even slow things down
    if ($regexp_array[0] == 1) {
        $newvar = preg_replace($regexp_array[2], $regexp_array[3], $thevar);
    } elseif ($regexp_array[0] == 2) {
        $addproxy = isset($regexp_array[4]) ? $regexp_array[4] : true;
        $framify = isset($regexp_array[5]) ? $regexp_array[5] : false;
        $newvar = parse_html($regexp_array[2], $regexp_array[3], $thevar, $addproxy, $framify);
    }
    return $newvar;
}
开发者ID:469306621,项目名称:Languages,代码行数:12,代码来源:surrogafier2.php

示例14: mysql_query

$sql = "select server, user, password, race, main_village, last_report from accounts where id = {$account}";
$res = mysql_query($sql);
if (!$res) {
    die(mysql_error());
}
$row = mysql_fetch_row($res);
if (!$row) {
    die("Account not found. {$account} \n");
}
$server = $row[0];
$url = "http://{$server}/dorf1.php";
$ch = my_curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
curl_close($ch);
$all_id = parse_html($result);
$db_all = array();
$sql = "select id from villages where account = {$account}";
$res = mysql_query($sql);
if (!$res) {
    die(mysql_error());
}
while ($row = mysql_fetch_row($res)) {
    $id = $row[0];
    array_push($db_all, $id);
}
foreach ($all_id as $id => $val) {
    $name = mysql_escape_string($val[0]);
    $x = $val[1];
    $y = $val[2];
    if (in_array($id, $db_all)) {
开发者ID:GaryHuang-CL,项目名称:y1910061,代码行数:31,代码来源:reset.php

示例15: elseif

         echo '</fieldset>' . "\n";
         echo '</form>' . "\n";
     } else {
         echo 'nothing to do.';
     }
     // $file
 } elseif (isset($_POST['valider']) and !empty($_FILES['file']['tmp_name'])) {
     $message = array();
     switch ($_POST['imp-format']) {
         case 'jsonbak':
             $json = file_get_contents($_FILES['file']['tmp_name']);
             $message = importer_json($json);
             break;
         case 'htmllinks':
             $html = file_get_contents($_FILES['file']['tmp_name']);
             $message['links'] = insert_table_links(parse_html($html));
             break;
         case 'xmlwp':
             $xml = file_get_contents($_FILES['file']['tmp_name']);
             $message = importer_wordpress($xml);
             break;
         case 'rssopml':
             $xml = file_get_contents($_FILES['file']['tmp_name']);
             $message['feeds'] = importer_opml($xml);
             break;
         default:
             die('nothing');
             break;
     }
     if (!empty($message)) {
         echo '<form action="maintenance.php" method="get" class="bordered-formbloc">' . "\n";
开发者ID:CamTosh,项目名称:blogotext,代码行数:31,代码来源:maintenance.php


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