function getFormFieldList() { $s = ''; $c = ''; $splstr = ''; $fieldName = ''; $splstr = aspSplit(@$_POST, '&'); foreach ($splstr as $key => $s) { $fieldName = lCase(mid($s, 1, inStr($s, '=') - 1)); if ($c != '') { $c = $c . '|'; } $c = $c . $fieldName; } $getFormFieldList = $c; return @$getFormFieldList; }
function loadWebConfig() { $GLOBALS['conn='] = OpenConn(); //判断表存在 if (inStr(getHandleTableList(), '|' . $GLOBALS['db_PREFIX'] . 'website' . '|') > 0) { $rsObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'website'); if (@mysql_num_rows($rsObj) != 0) { $rs = mysql_fetch_array($rsObj); $GLOBALS['cfg_webSiteUrl'] = $rs['websiteurl'] . ''; //网址 $GLOBALS['cfg_webTitle'] = $rs['webtitle'] . ''; //网址标题 $GLOBALS['cfg_flags'] = $rs['flags'] . ''; //旗 $GLOBALS['cfg_webtemplate'] = $rs['webtemplate'] . ''; //模板路径 } } }
function OperationSystem() { $httpAgent = ''; $SystemVer = ''; $httpAgent = serverVariables('HTTP_USER_AGENT'); if (inStr($httpAgent, 'NT 5.2') > 0) { $SystemVer = 'Windows Server 2003'; } else { if (inStr($httpAgent, 'NT 5.1') > 0) { $SystemVer = 'Windows XP'; } else { if (inStr($httpAgent, 'NT 5') > 0) { $SystemVer = 'Windows 2000'; } else { if (inStr($httpAgent, 'NT 4') > 0) { $SystemVer = 'Windows NT4'; } else { if (inStr($httpAgent, '4.9') > 0) { $SystemVer = 'Windows ME'; } else { if (inStr($httpAgent, '98') > 0) { $SystemVer = 'Windows 98'; } else { if (inStr($httpAgent, '95') > 0) { $SystemVer = 'Windows 95'; } else { $SystemVer = $httpAgent; } } } } } } } $OperationSystem = $httpAgent; return @$OperationSystem; }
/** POST 파싱 * @class view * @param $data: DB 데이터 $mode: parse Mode [list|view|mhot 등] $ret: return 모드 * @return */ function parsePost(&$data, $mode = 'list', $ret = 0) { global $mini; iss($data['prev']); iss($data['next']); // 외부 게시판 설정 적용 $board_data = !empty($mini['board_data']) ? $mini['board_data'] : $mini['board']; // decode foreach ($data as $key => $val) { str($data[$key], 'decode'); } // 주소설정 //+ .htaccess 설정에 따라 다르게 해야함 if (true) { $data['url_pdir'] = "{$mini['pdir']}mini.php?id={$board_data['id']}&no={$data['no']}"; $data['url_trackback'] = "{$mini['pdir']}trackback.php?id={$board_data['id']}&no={$data['no']}"; } else { } if ($mode == 'pdir') { return str_replace("&", "&", $data['url_pdir']); } // 추가필드 iss($data['field']); if ($data['field']) { $data['field'] = unserialize($data['field']); if (is_array($data['field'])) { ksort($data['field']); } } // 링크 iss($data['link']); if ($data['link']) { $data['link'] = unserialize($data['link']); } // 권한 뽑음 $data['permit_handle'] = !empty($mini['member']['level_admin']) || !empty($data['target_member']) && !empty($mini['log']) && $data['target_member'] == $mini['member']['no'] || empty($data['target_member']) && empty($mini['log']); // 링크 설정 $data['url_view'] = getPermit("name:view") ? "{$mini['dir']}mini.php?id={$board_data['id']}&no={$data['no']}" . getURI("no, id") : ""; $data['url_del'] = $data['permit_handle'] && !empty($_SESSION['pageKey']) ? "{$mini['dir']}write.x.php?mode=del&no={$data['no']}&pageKey={$_SESSION['pageKey']}" . getURI("no") : ""; $data['url_modify'] = $data['permit_handle'] || getPermit("name:edit") ? "{$mini['dir']}write.php?mode=modify&no={$data['no']}" . getURI("no, mode") : ""; $data['url_cmt'] = "{$mini['dir']}mini.php?id={$board_data['id']}&no={$data['no']}&new=1" . getURI("id, no, start, div, sort, s, quick, and, is_cmt"); $data['url_report'] = "{$mini['dir']}report.php?id={$board_data['id']}&mode=post&no={$data['no']}"; $data['pop_report'] = "iiPopup.init({ url: \"{$data['url_report']}\", width:iiSize[\"report\"][0], height:iiSize[\"report\"][1] });"; $data['pop_cmt'] = "iiPopup.init({ url: \"{$data['url_cmt']}\", width:iiSize[\"cmt\"][0], height:iiSize[\"cmt\"][1] }); return false;"; $data['js_vote'] = "onclick='votes({ mode: \"vote\", id: \"{$board_data['id']}\", no: \"{$data['no']}\" });'"; $data['js_hate'] = "onclick='votes({ mode: \"hate\", id: \"{$board_data['id']}\", no: \"{$data['no']}\" });'"; $data['url_manage'] = "{$mini['dir']}manage.php?id={$board_data['id']}&group={$_REQUEST['group']}&mode=post&no[]={$data['no']}&url=" . url(); $data['pop_manage'] = "iiPopup.init({ url: \"{$data['url_manage']}\", width:iiSize[\"manage\"][0], height:iiSize[\"manage\"][1] }); return false;"; $data['url_manage_report'] = "{$mini['dir']}manage.php?id={$board_data['id']}&group={$_REQUEST['group']}&mode=post&report=1&no[]={$data['no']}&url=" . url(); $data['pop_manage_report'] = "iiPopup.init({ url: \"{$data['url_manage_report']}\", width:iiSize[\"manage\"][0], height:iiSize[\"manage\"][1] }); return false;"; $data['url_report_view'] = "{$mini['dir']}manage.php?id={$board_data['id']}&mode=post&no={$data['no']}&url=" . url(); $data['pop_report_view'] = "iiPopup.init({ url: \"{$data['url_report_view']}\", width:iiSize[\"manage\"][0], height:iiSize[\"manage\"][1] }); return false;"; $data['js_name'] = "onclick='view_member.open(event, { target_member: \"{$data['target_member']}\", id: \"{$board_data['id']}\", post_no: \"{$data['no']}\" })'"; $data['js_trackback_view'] = "onclick='getTrackback(\"{$data['no']}\"); return false;'"; // 조회기록 기능 if (!empty($board_data['use_unique_view']) && !empty($mini['member']) && inStr($mini['member']['no'], $data['history_hit'])) { $data['is_read'] = 1; } // 댓글수 if (!empty($data['count_trackback']) && $mode == 'list') { $data['count_comment'] += $data['count_trackback']; } // 번호 $data['view_no'] = $board_data['use_view_no'] ? 4294967296 - $data['num'] : $data['no']; // 이름 parseName($data); // 관리자 체크박스 $data['checkbox'] = !empty($mini['member']['level_admin']) ? "<input type='checkbox' name='no[]' value='{$data['no']}' class='middle' />" : ""; // 현재글 $data['is_now'] = !empty($_REQUEST['no']) && $_REQUEST['no'] == $data['no'] ? 1 : 0; // 반대 $data['is_hate'] = !empty($mini['member']['level_admin']) || !empty($mini['member']['no']) && $mini['member']['no'] == $data['target_member']; // 글 상태 설정 if (empty($data['status'])) { if (!empty($board_data['status_hit']) && $data['hit'] >= $board_data['status_hit']) { $data['status'] = 'hit'; } if (!empty($board_data['status_hate']) && $data['hate'] >= $board_data['status_hate']) { $data['status'] = 'hate'; } if (!empty($board_data['status_vote']) && $data['vote'] >= $board_data['status_vote']) { $data['status'] = 'vote'; } } // 날짜 if ($data['date_notice'] == '0000-00-00 00:00:00') { $data['date_notice'] = ''; } if ($data['date_popup'] == '0000-00-00 00:00:00') { $data['date_popup'] = ''; } if ($data['date_issue'] == '0000-00-00 00:00:00') { $data['date_issue'] = ''; } $data['time'] = strtotime($data['date']); $data['date_out'] = $mode == 'view' ? date($board_data['date_view'], $data['time']) : date($board_data['date_list'], $data['time']); $data['date_str'] = $mini['time'] - $data['time'] < $mini['set']['date_str'] * 86400 ? dateSec($mini['time'] - $data['time']) . "전" : ""; $data['date_simple'] = date("H:i", $data['time']); $data['date_notice_str'] = !empty($data['date_notice']) ? dateSec(strtotime($data['date_notice']) - $mini['time']) : ""; $data['date_popup_str'] = !empty($data['date_popup']) ? dateSec(strtotime($data['date_popup']) - $mini['time']) : ""; $data['date_issue_str'] = !empty($data['date_issue']) ? dateSec(strtotime($data['date_issue']) - $mini['time']) : ""; // 마지막 댓글 iss($data['date_comment_str']); iss($data['date_comment_time']); if (!empty($data['date_comment']) && $data['date_comment'] != '0000-00-00 00:00:00') { $data['date_comment_time'] = strtotime($data['date_comment']); $data['date_comment_str'] = $mini['time'] - $data['date_comment_time'] < $mini['set']['date_str'] * 86400 ? dateSec($mini['time'] - $data['date_comment_time']) . "전" : date("m/d H:i", $data['date_comment_time']); } // 이슈글 가중치 $data['issue_point'] = $data['issue'] * 999999 + $data['hit'] + $data['vote'] * 10; // 카테고리 if (!empty($data['category'])) { $data['category'] = getStr($data['category']); $data['category_name'] = array(); if (!empty($data['category'])) { foreach ($data['category'] as $key => $val) { $data['category_name'][$key] = $board_data['category_name'][$val]; } } } // 태그 if ($data['tag']) { $data['tag'] = getStr($data['tag']); } // 내용 if (!empty($data['ment']) && !empty($data['autobr'])) { $data['ment'] = nl2br($data['ment']); } $data['ment'] = str_replace("<br /><!--n-->", "\n", $data['ment']); if (strpos($data['ment'], "<pre title='code'") !== false) { $mini['is_syntax'] = 1; } // 제목 $data['title_text'] = $data['title']; if (!empty($mini['setting']['title_cut'])) { $data['title'] = strCut($data['title'], $mini['setting']['title_cut']); } if (!empty($board_data['cut_title']) && $mode == 'list') { $data['title'] = strCut($data['title'], $board_data['cut_title']); } // 제목 앞에 태그가 있을 경우 태그를 이어줌 if (strpos($data['title_text'], '<') === 0) { $mat = array(); preg_match("/^\\<([^\\>]+)\\>/i", $data['title_text'], $mat); if (!empty($mat)) { $tmp_mat = explode(" ", $mat[1]); if (preg_match("/^(b|i|u|strike|strong|span|font|h1|h2|h3|h4|h5|h6)\$/i", $tmp_mat[0])) { $data['title'] = "{$mat[0]}{$data['title']}</{$tmp_mat[0]}>"; } else { if (preg_match("/^img\$/i", $tmp_mat[0])) { $data['title'] = "{$mat[0]}{$data['title']}"; } } } } // 파일 $data['is_file'] = 0; if (!empty($data['file'])) { unset($file); $file = sql("\n\t\t\t\tq: SELECT * FROM {$mini['name']['file']} WHERE " . sqlSel($data['file']) . " " . ($mode != 'view' ? "LIMIT 1" : "") . "\n\t\t\t\tmode: array\n\t\t\t"); if (!empty($file)) { $data['is_file'] = 1; $data['file_data'] = array(); // 파일 링크 만들기 foreach ($file as $key => $val) { $tmp_no = $key + 1; $data["url_file{$tmp_no}"] = "{$mini['dir']}download.php?mode=view&no={$val['no']}"; $data["link_file{$tmp_no}"] = "href='{$mini['dir']}download.php?no={$val['no']}'"; $data['file_data'][$tmp_no] = parseFile($val, 1); } unset($file); } } // XHTML 설정 $data['ment'] = str_replace(array("&lt;script", "&lt;/script"), array("<script", "</script"), $data['ment']); $data['title'] = str_replace(array("&lt;script", "&lt;/script"), array("<script", "</script"), $data['title']); // 경고 if (!empty($data['alert']) && !empty($board_data['use_alert'])) { $data['ment'] = "<div class='alertDiv'>경고(!) 클릭하시면 내용이 펼쳐집니다. 위험한 내용이나 스포일러성 내용이 포함되어 있을 수 있습니다.</div><span style='display:none;'>{$data['ment']}</span>"; } // 댓글 $data['cmt'] = ''; if ($data['count_comment']) { $data['cmt'] = str_replace(array("[:data:]", "[:link:]"), array($data['count_comment'], ''), $mini['time'] - $data['date_comment_time'] <= $board_data['status_new_cmt'] * 3600 ? $board_data['cmt_skin_new'] : $board_data['cmt_skin']); str($data['cmt'], 'decode'); } // 댓글 점수 없앰 if (empty($board_data['use_cmt_point'])) { $data['point'] = 0; } // 핑백보낸것 $data['pingback_arr'] = getStr($data['pingback']); $data['pingback_count'] = count($data['pingback_arr']); // 수정 시간제한 if (!empty($board_data['limit_edit_post']) && empty($mini['member']['level_admin'])) { if (strtotime($data['date']) + $board_data['limit_edit_post'] * 60 >= $mini['time']) { $data['edit_left'] = dateSec($board_data['limit_edit_post'] * 60 - ($mini['time'] - strtotime($data['date']))); } } // 라이센스 처리 if (!empty($data['license'])) { $data['license_out'] = getLicense($data['license']); } // 아이피 if (!empty($data['ip'])) { $data['ip_hide'] = preg_replace("/([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+)/", "\\1.*.\\3.*", $data['ip']); } // link 변수 생성 urlToLink($data); // 비밀글 처리 if ($data['secret'] && !getPermit("name:secret") && (empty($mini['log']) || $data['target_member'] != $mini['member']['no'])) { if ($mode != 'view') { $data['ment'] = "비밀글 입니다."; } if ($data['pass']) { $data['link_view'] = "href='#' onclick='iiPopup.init({ url: \"{$mini['dir']}pass.php?id={$board_data['id']}&group={$_REQUEST['group']}&target=_parent&url=" . urlencode($data['url_view']) . "\", width:iiSize[\"pass\"][0], height:iiSize[\"pass\"][1] }); return false;'"; if ($mode != 'view') { $data['ment'] .= " <a {$data['link_view']}>여기를 눌러 비밀번호를 입력하세요.</a>"; } } else { $data['link_view'] = "href='#' onclick='alert(\"비밀글을 볼 수 있는 권한이 없습니다\"); return false;'"; } } // 비밀번호 입력 처리 if (!empty($data['pass']) && empty($mini['member']['level_admin'])) { $data['link_modify'] = "href='#' onclick='iiPopup.init({ url: \"{$mini['dir']}pass.php?id={$board_data['id']}&group={$_REQUEST['group']}&target=_parent&url=" . urlencode($data['url_modify']) . "\", width:iiSize[\"pass\"][0], height:iiSize[\"pass\"][1] }); return false;'"; $data['js_modify'] = "onclick='iiPopup.init({ url: \"{$mini['dir']}pass.php?id={$board_data['id']}&group={$_REQUEST['group']}&target=_parent&url=" . urlencode($data['url_modify']) . "\", width:iiSize[\"pass\"][0], height:iiSize[\"pass\"][1] }); return false;'"; $data['link_del'] = "href='#' onclick='iiPopup.init({ url: \"{$mini['dir']}pass.php?id={$board_data['id']}&group={$_REQUEST['group']}&target=_parent&url=" . urlencode($data['url_del']) . "\", width:iiSize[\"pass\"][0], height:iiSize[\"pass\"][1] }); return false;'"; $data['js_del'] = "onclick='iiPopup.init({ url: \"{$mini['dir']}pass.php?id={$board_data['id']}&group={$_REQUEST['group']}&target=_parent&url=" . urlencode($data['url_del']) . "\", width:iiSize[\"pass\"][0], height:iiSize[\"pass\"][1] }); return false;'"; } // 통합제목 $data['title_out'] = "<a {$data['link_view']} class='postView'" . (!empty($mini['setting']['title_cut']) && $data['title_text'] != $data['title'] ? " title='" . nl2br2(addSlashes($data['title_text'])) . "'" : "") . ">{$data['title']}</a> <a href='#' onclick='{$data['pop_cmt']}'>{$data['cmt']}</a>"; // 태그 없는 변수 $data['ment_notag'] = strip_tags($data['ment']); if ($ret) { return $data; } }
public function getLink() { $tmp = array('link', 'guid'); $through = array('headlines.yahoo.co.jp', 'youtube.com', 'groups.google.com/forum', 'facebook.com'); foreach ($tmp as $v) { $c = xpath($this->content, $v); if (strrpos($c, '?') && !inStr($c, $through)) { $c = substr($c, 0, strrpos($c, '?')); } if ($c && !strpos($c, 'rss')) { return $c; } } }
function getStrIntContentNumb($content, $findStr) { $splStr = ''; if (inStr($content, $findStr) > 0) { $splStr = aspSplit($content, $findStr); $getStrIntContentNumb = uBound($splStr); } else { $getStrIntContentNumb = 0; } return @$getStrIntContentNumb; }
function moduleFindContent($action, $ModuleName) { $defaultStr = ''; $startStr = ''; $endStr = ''; $defaultStr = rParam($action, $ModuleName); //把转小写LCase去掉 (20151008) $startStr = '<!--#' . $defaultStr . ' start#-->'; $endStr = '<!--#' . $defaultStr . ' end#-->'; //[_18年独家一次性祛斑第一品牌2014年10月21日 10时59分] //Call Echo("Default",Default) //判断是否存在 if (inStr($GLOBALS['code'], $startStr) > 0 && inStr($GLOBALS['code'], $endStr) > 0) { $defaultStr = getStrCut($GLOBALS['code'], $startStr, $endStr, 2); } else { if ($defaultStr != '') { $startStr = '<!--#' . $defaultStr; $endStr = '#-->'; if (inStr($GLOBALS['code'], $startStr) > 0 && inStr($GLOBALS['code'], $endStr) > 0) { $defaultStr = getStrCut($GLOBALS['code'], $startStr, $endStr, 2); } } } //删除默认值20150712 $deletedefault = ''; $deletedefault = rParam($action, 'deletedefault'); if ($deletedefault == 'true') { addModuleReplaceArray('【删除】', $startStr . $defaultStr . $endStr); } $moduleFindContent = $defaultStr; return @$moduleFindContent; }
/** 쪽지 쓰기 * @class memo * @param $data: 자료 $from_no: 보내는사람번호 $data_target: 받는회원자료 $data_from: 보내는회원자료 $ret: return 모드 */ function sendMemo($data, $from_no = '', $data_target = '', $data_from = '', $ret = 0) { global $mini; unset($data['from_member']); if (!is_array($data)) { $data = param($data); } if (empty($data['target_member'])) { __error('받는사람이 없습니다'); } if (empty($data['ment'])) { __error('내용이 없습니다'); } // 회원정보 if (empty($data_target)) { check($data['target_member'], 'type:num, name:받는사람번호'); $data_target = sql("SELECT * FROM {$mini['name']['member']} WHERE no={$data['target_member']}"); if (!is_array($data_target)) { __error('존재하지 않는 회원 입니다'); } $data_target = parseMember($data_target, 1); } if (empty($data_from)) { if (!empty($from_no)) { check($from_no, 'type:num, name:보내는사람번호'); $data_from = sql("SELECT * FROM {$mini['name']['member']} WHERE no={$from_no}"); if (!is_array($data_from)) { __error('존재하지 않는 회원 입니다'); } $data_from = parseMember($data_from, 1); } else { if (!empty($mini['log'])) { $data_from = $mini['member']; } else { __error('보내는사람 정보가 없습니다'); } } } $data['target_member'] = $data_target['no']; $data['from_member'] = $data_from['no']; $data['name_target'] = $data_target['name']; $data['name_from'] = $data_from['name']; // 친구메세지만 허용 확인 if (!empty($data_target['ini']['memo']) && !empty($data_target['ini']['memo']['use_friend']) && empty($mini['member']['level_admin'])) { if (empty($data_target['ini']['friend']) || !empty($data_target['ini']['friend']) && !in_array($from_no, $data_target['ini']['friend'])) { __error('메세지를 보낼 수 없습니다. 상대방이 친구에게만 메세지를 받도록 설정했습니다.'); } } // 차단 확인 if (!empty($data_target['ini']['memo']['block']) && inStr($from_no, $data_target['ini']['memo']['block'])) { $data['is_block'] = 1; } // 내용 필터 if (empty($data['skip_filter'])) { filter($data['ment'], 'encode'); } // 기본정보 입력 $data['date'] = $mini['date']; $data['ip'] = $mini['ip']; // 없는 것 빼기 $col = getColumns($mini['name']['memo']); foreach ($data as $key => $val) { if (!inStr($key, $col)) { unset($data[$key]); } } // 쿼리 sql("INSERT INTO {$mini['name']['memo']} " . query($data, 'insert')); // 리턴 if ($ret) { return $data; } }
function checkHtmlFormatting($content) { $splStr = ''; $s = ''; $c = ''; $splxx = ''; $nLable = ''; $lableStr = ''; $content = lCase($content); $splStr = aspSplit('ul|li|dt|dd|dl|div|span', '|'); foreach ($splStr as $key => $s) { $s = PHPTrim($s); if ($s != '') { $nLable = 0; $lableStr = '<' . $s . ' '; if (inStr($content, $lableStr) > 0) { $splxx = aspSplit($content, $lableStr); $nLable = $nLable + uBound($splxx); } $lableStr = '<' . $s . '>'; if (inStr($content, $lableStr) > 0) { $splxx = aspSplit($content, $lableStr); $nLable = $nLable + uBound($splxx); } $lableStr = '</' . $s . '>'; if (inStr($content, $lableStr) > 0) { $splxx = aspSplit($content, $lableStr); $nLable = $nLable - uBound($splxx); } //call echo(ShowHtml(lableStr),nLable) if ($nLable != 0) { $checkHtmlFormatting = false; return @$checkHtmlFormatting; } } } $checkHtmlFormatting = true; return @$checkHtmlFormatting; }
function getPostSql($id, $tableName, $fieldNameList) { $valueStr = ''; $editValueStr = ''; $sql = ''; $splStr = ''; $splxx = ''; $s = ''; $fieldList = ''; $fieldName = ''; $defaultFieldValue = ''; //字段名称 $fieldSetType = ''; //字段设置类型 $fieldValue = ''; //字段值 $systemFieldList = ''; //表字段列表 $systemFieldList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段配置列表'); $postFieldList = ''; //post字段列表 $splPost = ''; $fieldContent = ''; $fieldConfig = ''; $postFieldList = getFormFieldList(); //以后再把下面与上面这两种处理方法事成一种看看行不行 $splPost = aspSplit($postFieldList, '|'); foreach ($splPost as $key => $fieldName) { $fieldContent = @$_POST[$fieldName]; if (inStr($systemFieldList, ',' . $fieldName . '|') > 0 && inStr(',' . $fieldList . ',', ',' . $fieldName . ',') == false) { //为自定义的 if (inStr($fieldNameList, ',' . $fieldName . '|') > 0) { $fieldConfig = mid($fieldNameList, inStr($fieldNameList, ',' . $fieldName . '|') + 1, -1); } else { $fieldConfig = mid($systemFieldList, inStr($systemFieldList, ',' . $fieldName . '|') + 1, -1); } $fieldConfig = mid($fieldConfig, 1, inStr($fieldConfig, ',') - 1); //call echo("config",fieldConfig) //call echo(fieldName,fieldContent) //call echo("fieldConfig",fieldConfig) $splxx = aspSplit($fieldConfig . '|||', '|'); $fieldName = $splxx[0]; //字段名称 $fieldSetType = $splxx[1]; //字段设置类型 $defaultFieldValue = $splxx[2]; //默认字段值 $fieldValue = ADSqlRf($fieldName); //代替上面,因为它处理了'符号 //call echo("fieldValue",fieldValue) //排序密码不处理 if ($fieldValue != '#NO******NO#') { //md5加密 if ($fieldSetType == 'md5') { $fieldValue = myMD5($fieldValue); } if ($fieldSetType == 'yesno') { if ($fieldValue == '') { $fieldValue = $defaultFieldValue; } //不为数字类型加单引号 } else { if ($fieldSetType == 'numb') { if ($fieldValue == '') { $fieldValue = $defaultFieldValue; } } else { if ($fieldName == 'flags') { //PHP里用法 if (EDITORTYPE == 'php') { if ($fieldValue != '') { $fieldValue = '|' . arrayToString($fieldValue, '|'); } } else { $fieldValue = '|' . arrayToString(aspSplit($fieldValue, ', '), '|'); } $fieldValue = '\'' . $fieldValue . '\''; //为时间 } else { if ($fieldSetType == 'time' || $fieldSetType == 'now') { if ($fieldValue == '') { $fieldValue = now(); } $fieldValue = '\'' . $fieldValue . '\''; //为时期 } else { if ($fieldSetType == 'date') { if ($fieldValue == '') { $fieldValue = aspDate(); } $fieldValue = '\'' . $fieldValue . '\''; } else { $fieldValue = '\'' . $fieldValue . '\''; } } } } } $fieldValue = unescape($fieldValue); //解码20160418 if ($valueStr != '') { $valueStr = $valueStr . ','; $editValueStr = $editValueStr . ','; } $valueStr = $valueStr . $fieldValue; $editValueStr = $editValueStr . $fieldName . '=' . $fieldValue; } if ($fieldList != '') { $fieldList = $fieldList . ','; } $fieldList = $fieldList . $fieldName; } } //自定义字段是否需要写入默认值 有的 $splStr = aspSplit($fieldNameList, ','); foreach ($splStr as $key => $s) { if (inStr($s, '|') > 0) { $splxx = aspSplit($s . '|||', '|'); $fieldName = $splxx[0]; //字段名称 $fieldSetType = $splxx[1]; //字段设置类型 $fieldValue = $splxx[2]; //默认字段值 if (inStr($systemFieldList, ',' . $fieldName . '|') > 0 && inStr(',' . $fieldList . ',', ',' . $fieldName . ',') == false) { if ($fieldSetType == 'date' && $fieldValue == '') { $fieldValue = aspDate(); } else { if (($fieldSetType == 'time' || $fieldSetType == 'now') && $fieldValue == '') { $fieldValue = now(); } } if ($fieldSetType != 'yesno' && $fieldSetType != 'numb') { $fieldValue = '\'' . $fieldValue . '\''; } if ($fieldList != '') { $fieldList = $fieldList . ','; $valueStr = $valueStr . ','; $editValueStr = $editValueStr . ','; } $fieldList = $fieldList . $fieldName; $valueStr = $valueStr . $fieldValue; $editValueStr = $editValueStr . $fieldName . '=' . $fieldValue; //call echo(fieldName,fieldSetType) } } } if ($id == '') { $sql = 'insert into ' . $GLOBALS['db_PREFIX'] . '' . $tableName . ' (' . $fieldList . ',updatetime) values(' . $valueStr . ',\'' . now() . '\')'; } else { $sql = 'update ' . $GLOBALS['db_PREFIX'] . '' . $tableName . ' set ' . $editValueStr . ',updatetime=\'' . now() . '\' where id=' . $id; } $getPostSql = $sql; return @$getPostSql; }
function handleReadCssContent($cssFilePath, $LabelName, $isHandleCss) { $c = ''; $startStr = ''; $endStr = ''; $c = getFText($cssFilePath); //截取CSS $startStr = '/*CssCodeStart*/'; $endStr = '/*CssCodeEnd*/'; if (inStr($c, $startStr) > 0 && inStr($c, $endStr) > 0) { $c = StrCut($c, $startStr, $endStr, 2); } //处理CSS if ($isHandleCss == true) { $c = cssCompression($c, 0); } if ($LabelName != '') { $c = '/*' . $LabelName . ' start*/' . $c . '/*' . $LabelName . ' end*/'; } $handleReadCssContent = $c; return @$handleReadCssContent; }
function saveSiteMap() { $isWebRunHtml = ''; //是否为html方式显示网站 $changefreg = ''; //更新频率 $priority = ''; //优先级 $s = ''; $c = ''; $url = ''; handlePower('修改生成SiteMap'); //管理权限处理 $changefreg = @$_REQUEST['changefreg']; $priority = @$_REQUEST['priority']; loadWebConfig(); //加载配置 //call eerr("cfg_flags",cfg_flags) if (inStr($GLOBALS['cfg_flags'], '|htmlrun|') > 0) { $isWebRunHtml = true; } else { $isWebRunHtml = false; } $c = $c . '<?xml version="1.0" encoding="UTF-8"?>' . vbCrlf(); $c = $c . vbTab() . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">' . vbCrlf(); //栏目 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn where isonhtml<>0 order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { $c = $c . copyStr(vbTab(), 2) . '<url>' . vbCrlf(); if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/nav' . $rsx['id']); $url = handleAction($url); } else { $url = escape('?act=nav&columnName=' . $rsx['columnname']); } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //call echo(cfg_webSiteUrl,url) $c = $c . copyStr(vbTab(), 3) . '<loc>' . $url . '</loc>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<lastmod>' . Format_Time($rsx['updatetime'], 2) . '</lastmod>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<changefreq>' . $changefreg . '</changefreq>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<priority>' . $priority . '</priority>' . vbCrlf(); $c = $c . copyStr(vbTab(), 2) . '</url>' . vbCrlf(); aspEcho('栏目', '<a href="' . $url . '" target=\'_blank\'>' . $url . '</a>'); } } //文章 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where isonhtml<>0 order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { $c = $c . copyStr(vbTab(), 2) . '<url>' . vbCrlf(); if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/detail/detail' . $rsx['id']); $url = handleAction($url); } else { $url = '?act=detail&id=' . $rsx['id']; } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //call echo(cfg_webSiteUrl,url) $c = $c . copyStr(vbTab(), 3) . '<loc>' . $url . '</loc>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<lastmod>' . Format_Time($rsx['updatetime'], 2) . '</lastmod>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<changefreq>' . $changefreg . '</changefreq>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<priority>' . $priority . '</priority>' . vbCrlf(); $c = $c . copyStr(vbTab(), 2) . '</url>' . vbCrlf(); aspEcho('文章', '<a href="' . $url . '">' . $url . '</a>'); } } //单页 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'onepage where isonhtml<>0 order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { $c = $c . copyStr(vbTab(), 2) . '<url>' . vbCrlf(); if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/page/detail' . $rsx['id']); $url = handleAction($url); } else { $url = '?act=onepage&id=' . $rsx['id']; } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //call echo(cfg_webSiteUrl,url) $c = $c . copyStr(vbTab(), 3) . '<loc>' . $url . '</loc>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<lastmod>' . Format_Time($rsx['updatetime'], 2) . '</lastmod>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<changefreq>' . $changefreg . '</changefreq>' . vbCrlf(); $c = $c . copyStr(vbTab(), 3) . '<priority>' . $priority . '</priority>' . vbCrlf(); $c = $c . copyStr(vbTab(), 2) . '</url>' . vbCrlf(); aspEcho('单页', '<a href="' . $url . '">' . $url . '</a>'); } } $c = $c . vbTab() . '</urlset>' . vbCrlf(); loadWebConfig(); createFile('sitemap.xml', $c); aspEcho('生成sitemap.xml文件成功', '<a href=\'/sitemap.xml\' target=\'_blank\'>点击预览sitemap.xml</a>'); //判断是否生成sitemap.html if (@$_REQUEST['issitemaphtml'] == '1') { $c = ''; //第二种 //栏目 $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'webcolumn order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/nav' . $rsx['id']); $url = handleAction($url); } else { $url = escape('?act=nav&columnName=' . $rsx['columnname']); } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //判断是否生成html if ($rsx['isonhtml'] == true) { $s = '<a href="' . $url . '">' . $rsx['columnname'] . '</a>'; } else { $s = '<span>' . $rsx['columnname'] . '</span>'; } $c = $c . '<li style="width:20%;">' . $s . vbCrlf() . '<ul>' . vbCrlf(); //文章 $rssObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'articledetail where parentId=' . $rsx['id'] . ' order by sortrank asc'); while ($rss = $GLOBALS['conn']->fetch_array($rssObj)) { if ($rss['nofollow'] == false) { if ($isWebRunHtml == true) { $url = getRsUrl($rss['filename'], $rss['customaurl'], '/detail/detail' . $rss['id']); $url = handleAction($url); } else { $url = '?act=detail&id=' . $rss['id']; } $url = urlAddHttpUrl($GLOBALS['cfg_webSiteUrl'], $url); //判断是否生成html if ($rss['isonhtml'] == true) { $s = '<a href="' . $url . '">' . $rss['title'] . '</a>'; } else { $s = '<span>' . $rss['title'] . '</span>'; } $c = $c . '<li style="width:20%;">' . $s . '</li>' . vbCrlf(); } } $c = $c . '</ul>' . vbCrlf() . '</li>' . vbCrlf(); } } //单面 $c = $c . '<li style="width:20%;"><a href="javascript:;">单面列表</a>' . vbCrlf() . '<ul>' . vbCrlf(); $rsxObj = $GLOBALS['conn']->query('select * from ' . $GLOBALS['db_PREFIX'] . 'onepage order by sortrank asc'); while ($rsx = $GLOBALS['conn']->fetch_array($rsxObj)) { if ($rsx['nofollow'] == false) { $c = $c . copyStr(vbTab(), 2) . '<url>' . vbCrlf(); if ($isWebRunHtml == true) { $url = getRsUrl($rsx['filename'], $rsx['customaurl'], '/page/detail' . $rsx['id']); $url = handleAction($url); } else { $url = '?act=onepage&id=' . $rsx['id']; } //判断是否生成html if ($rsx['isonhtml'] == true) { $s = '<a href="' . $url . '">' . $rsx['title'] . '</a>'; } else { $s = '<span>' . $rsx['title'] . '</span>'; } $c = $c . '<li style="width:20%;">' . $s . '</li>' . vbCrlf(); // target=""_blank"" 去掉 } } $c = $c . '</ul>' . vbCrlf() . '</li>' . vbCrlf(); $templateContent = ''; $templateContent = getFText($GLOBALS['adminDir'] . '/template_SiteMap.html'); $templateContent = replace($templateContent, '{$content$}', $c); $templateContent = replace($templateContent, '{$Web_Title$}', $GLOBALS['cfg_webTitle']); createFile('sitemap.html', $templateContent); aspEcho('生成sitemap.html文件成功', '<a href=\'/sitemap.html\' target=\'_blank\'>点击预览sitemap.html</a>'); } writeSystemLog('', '保存sitemap.xml'); //系统日志 }
/** * 로그인 * @class login * @param $data: POST array -site: 그룹번호 -board: 게시판번호 -is_passed: 무조건로그인[0!|1] */ function setLogin(&$data, $param) { global $mini; $param = param($param); iss($data['uid']); iss($data['pass']); iss($data['pass_encode']); iss($data['autologin']); iss($mini['set']['use_login_session']); iss($pass_after); iss($key_login); iss($autologin_after); def($mini['this']['script'], $_REQUEST['script']); def($mini['this']['script'], 'back'); def($mini['set']['lock_login'], 5); def($param['is_passed'], 0); $site_data = $board_data = array(); $site = ''; if (empty($param['site'])) { __error('선택된 그룹이 없습니다.' . ' (' . __FILE__ . ' line ' . __LINE__ . ' in ' . __FUNCTION__ . ')'); } //// 그룹 로드 if (!empty($mini['site']) && $mini['site']['no'] == $param['site']) { $site_data = $mini['site']; } else { $site_data = getSite($param['site'], 1); } //// 게시판 로드 if (!empty($param['board'])) { if (!empty($mini['board']) && $mini['board']['no'] == $param['board']) { $board_data = $mini['board']; } else { $board_data = getBoard($param['board'], 1); } } else { if (!empty($mini['board']['site']) && $mini['board']['site'] == $site_data['no']) { $board_data = $mini['board']; } } //// 변수 검사 check($data['uid'], "name: 아이디"); if (!$param['is_passed']) { check($data['pass_encode'], "type:id, name:암호화된 비밀번호, min:16, max:40"); } if (!isset($site_data)) { __error('선택된 그룹이 없습니다.'); } $data['uid'] = mysql_escape_string($data['uid']); //// 미니아이 로그인 if (preg_match("/^\\@/", $data['uid'])) { __error('준비중 입니다.'); } else { $site = "[{$site_data['no']}]"; // 그룹의 그룹연결 if (!empty($site_data['site_link'])) { $site .= $site_data['site_link']; } // 게시판의 그룹연결 if (!empty($board_data['site_link'])) { $site .= $board_data['site_link']; } } //// 데이터 로드 $tmp_data = sql("q:SELECT * FROM {$mini['name']['member']} WHERE uid='{$data['uid']}', mode:array"); //// 아이디 확인 if (!is_array($tmp_data)) { __error('일치하는 회원이 없습니다'); } //// 그룹 확인 $check = 0; foreach ($tmp_data as $key => $val) { if (inStr($val['site'], $site) || count(array_intersect(getStr($site), getStr($val['site_link']))) || inStr('god', $val['admin']) || inStr('admin', $val['admin'])) { $check = 1; $data_ex = $val; } } if (!$check) { __error('일치하는 회원이 없습니다'); } //// 컨버팅 회원 확인 if (preg_match("/^\\!/", $data_ex['pass'])) { if (!empty($mini['complete']['ajax'])) { __complete(array('mode' => 'ajax,reload.parent', 'script' => "window.open(\"{$mini['dir']}login.conv.php?no={$data_ex['no']}\", \"conv\", \"width=400, height=400, scrollbars=2\");")); } else { __complete(array('mode' => 'move', 'url' => "{$mini['dir']}login.conv.php?no={$data_ex['no']}")); } } //// 실패 회수 확인 if ($data_ex['lock_login'] >= $mini['set']['lock_login'] && $data_ex['no'] != 1) { __error("로그인을 {$mini['set']['lock_login']}회 이상 실패하여 아이디가 잠겼습니다. 관리자에게 문의하세요"); } //// 비밀번호 확인 if (!$param['is_passed'] && $data['pass_encode'] != md5("{$data_ex['pass']}|{$mini['ip']}|" . session_id())) { if ($data_ex['pass'] == 'reset!') { __error('비밀번호가 초기화 되었습니다. 아이디/비밀번호 찾기를 통해 새 비밀번호로 설정해 주세요'); } sql("UPDATE {$mini['name']['member']} SET lock_login = lock_login + 1 WHERE no={$data_ex['no']}"); addLog("\n\t\t\t\tmode: login_lock_login\n\t\t\t\ttarget_member: {$data_ex['no']}\n\t\t\t\tfield1: {$data_ex['lock_login']}\n\t\t\t"); __error("비밀번호가 일치하지 않습니다 (" . ($data_ex['lock_login'] + 1) . "회 오류)"); } //// 암호화 // 자동 로그인 if ($data['autologin']) { $pass_after = ''; $key_login = md5($mini['date']); $autologin_after = md5("{$data_ex['pass']}|{$mini['ip']}|{$key_login}"); $interval = time() + 2592000; // 30 days after } else { $pass_after = md5("{$data_ex['pass']}|{$mini['ip']}"); $key_login = $autologin_after = ''; $interval = 0; } //// 굽기 // 세션 if ($mini['set']['use_login_session']) { $_SESSION['m_no'] = $data_ex['no']; $_SESSION['m_pass'] = $pass_after; } else { setcookie("m_no", $data_ex['no'], $interval, '/'); setcookie("m_pass", $pass_after, $interval, '/'); } // 자동로그인 if ($data['autologin']) { setcookie("m_no", $data_ex['no'], $interval, '/'); setcookie("m_autologin", $autologin_after, $interval, '/'); } else { setcookie("m_autologin", '', 0, '/'); } //// 로그인 기록 추가 def($mini['set']['login_history_count'], 10); $data_ex['history_login'] .= "{$mini['ip']}|{$mini['date']}\n"; $tmp = explode("\n", $data_ex['history_login']); if (count($tmp) > $mini['set']['login_history_count']) { unset($tmp[0]); } $data_ex['history_login'] = is_array($tmp) ? implode("\n", $tmp) : ""; //// 로그인 포인트 설정 if (!empty($site_data['point_login'])) { if (!sql("SELECT COUNT(*) FROM {$mini['name']['log']} WHERE mode='point' and target_member={$data_ex['no']} and field3='로그인' and date >= '" . date("Y/m/d 00:00:00", $mini['time']) . "'")) { setPoint("\n\t\t\t\t\ttarget: {$data_ex['no']}\n\t\t\t\t\tmsg: 로그인\n\t\t\t\t\tpoint: {$site_data['point_login']}\n\t\t\t\t"); } } //// 다중 자동로그인 설정 //+ 정식버젼에서 지울 구문임 if (!empty($data_ex['ip']) && strpos($data_ex['ip'], '[') === false) { $data_ex['ip'] = "[{$data_ex['ip']}]"; } if (!empty($data_ex['key_login']) && strpos($data_ex['key_login'], '[') === false) { $data_ex['key_login'] = "******"; } if (empty($key_login)) { $key_login = '******'; } // 입력 $data_ex['ip'] .= "[{$mini['ip']}]"; $data_ex['key_login'] .= "[{$key_login}]"; // 3개 한정 $arr_ip = getStr($data_ex['ip']); if (count($arr_ip) > 5) { unset($arr_ip[0]); $data_ex['ip'] = "[" . implode("][", $arr_ip) . "]"; } $arr_key_login = getStr($data_ex['key_login']); if (count($arr_key_login) > 5) { unset($arr_key_login[0]); $data_ex['key_login'] = "******" . implode("][", $arr_key_login) . "]"; } //// DB수정 sql("UPDATE {$mini['name']['member']} SET ip='{$data_ex['ip']}', date_login='******'date']}', key_login='******'key_login']}', lock_login=0, count_login=count_login+1, history_login='******'history_login']}' WHERE no={$data_ex['no']}"); }
<?php require_once 'functions.php'; require_once 'config.php'; /** * @param string $class * @return bool|null * @throws ClassNotFoundException * @todo enable functions.php to be included */ spl_autoload_register(function ($class) { if (inStr("\\", $class)) { $parts = explode("\\", $class); $path = ''; foreach ($parts as $value) { $path .= $value . '/'; } $path = substr($path, 0, strlen($path) - 1); } else { $path = $class; } if (file_exists(HOME_DIR . CLASS_DIR . $path . '.php')) { require_once HOME_DIR . CLASS_DIR . $path . '.php'; } elseif (file_exists(HOME_DIR . CLASS_DIR . $path . '.class.php')) { require_once HOME_DIR . CLASS_DIR . $path . '.class.php'; } if (!class_exists($class)) { if (!interface_exists($class)) { if (!trait_exists($class)) { return false; }
/** 검색 처리 * @class list * @param -name: 리스팅 변수배열 이름 -is_simple: key table 사용 여부 -where_and: 기본 and 검색조건 -where: 기본 검색조건 -other: 뒤에 들어갈 절 -quickName: quick 검색 변수명 -sName: 검색 변수명 -andName: and 검색 변수명 */ function setSearch($param = '') { global $mini; $param = param($param); /* 리스팅 변수배열 멤버변수 table keyTable list start div nowDiv key is_total fieldName where order order_desc 검색 조건에 따라 total 이 들어가야 한다 */ def($param['name'], 'default'); def($mini['list'][$param['name']], ''); def($_REQUEST['target'], ''); def($_REQUEST['id'], ''); def($param['quickName'], 'quick'); def($param['sName'], 's'); def($param['andName'], 'and'); def($_REQUEST[$param['sName']], ''); $where = $where_and = $both = ''; $is_all = 0; $sep = !empty($_REQUEST[$param['andName']]) ? "and" : "or "; $data =& $mini['list'][$param['name']]; def($data['key'], 0); def($data['is_total'], 0); $s = array(); if (!empty($param['other'])) { $data['other_query_after'] = $param['other']; } //// 기본 검색조건 적용 if (!empty($param['where_and'])) { $where_and .= " and {$param['where_and']}"; } if (!empty($param['where'])) { $where .= " {$sep} {$param['where']}"; } //// 모드 없는 검색 설정 if (!empty($_REQUEST[$param['quickName']]) && empty($param['is_simple'])) { $s = array('title' => $_REQUEST[$param['quickName']], 'ment' => $_REQUEST[$param['quickName']], 'name' => $_REQUEST[$param['quickName']], 'tag' => $_REQUEST[$param['quickName']]); } else { if (!empty($_REQUEST['category']) && empty($_REQUEST[$param['sName']])) { $s = array('category!' => $_REQUEST['category']); } } //// 일반 if (!empty($_REQUEST[$param['sName']])) { $s = array_merge($s, $_REQUEST[$param['sName']]); } //// 검색 루프 시작 if (!empty($s) && is_array($s)) { // 키 테이블만 사용할 수 있는 조건인지 확인(PHP5 에서는 array_diff_key로 한번에 해결, 4.0.4에서 array_diff가 깨질 수 있음!) $tmp_keys = "[" . implode("][", array_keys($s)) . "]"; $tmp_keys = str_replace(array('!', '^', '$', '@', '+', '-', '*', '~'), '', $tmp_keys); $is_key = array_diff(getStr($tmp_keys), array('category', 'tag', 'title', 'ment', 'target_member', 'name')) || !empty($param['is_simple']) ? 0 : 1; foreach ($s as $key => $val) { // 조건 뽑기 preg_match("/(\\+|\\-|\\@|\\^|\\!|\$|\\~)\$/i", $key, $mat); $is_special = preg_match("/^\\@/i", $key); $key = str_replace(array('@', '^', '!', '$', '+', '-', '*', '~'), '', trim($key)); $option = $mat[1]; // 검색어 언어셋 변경 $val = convChar($val); $val = str_replace("\\'", "'", $val); $val = str_replace("\\\\'", "'", $val); $val = str_replace("\\\"", "\"", $val); // 검색어 쪼개기 // if (empty($param['is_simple']) && (!empty($_REQUEST[$param['quickName']]) || (!empty($_REQUEST[$param['sName']]) && count($_REQUEST[$param['sName']]) == 1))) { // $val_arr = array(); // $val_arr = getIndex($val, 'search'); // $count_val_arr = count($val_arr); // } $val_arr = array(); if ($key != 'ip' && $key != 'date' && $key != 'target_member' && $key != 'name') { $val_arr = getIndex($val, 'search'); } else { $val_arr = array($val); } $count_val_arr = count($val_arr); // 특수검색(@모드) if ($is_special) { switch ($key) { // 모든 게시판에서 검색 case 'all': $is_all = 1; break; /* case 'date': break; case 'private': break; */ /* case 'date': break; case 'private': break; */ default: __error("정의되지 않은 특별검색 입니다"); } } // 검색테이블 사용 if ($is_key) { $data['key'] = 1; $tmp_q = empty($_REQUEST['is_cmt']) ? " and cmt_no=0" : ""; if ($key == 'target_member' && preg_match("/[^0-9]/", $val)) { continue; } $tmp_sep = $option == '~' ? " and" : " or "; $where_name = $option == '~' ? "where_and" : "where"; if ($option == '!') { foreach ($val_arr as $key2 => $val2) { ${$where_name} .= $key == 'target_member' ? "{$tmp_sep} (target_member={$val2}{$tmp_q})" : "{$tmp_sep} (mode='{$key}'{$tmp_q} and ment='{$val2}')"; } // 총 게시물 수를 저장한 검색조건이라면 전체 검색을 할 수 있게 is_total 변수를 지정한다 if ($key == 'category' && count($s) == 1) { $data['is_total'] = 1; $data['key'] = 1; $data['is_only_category'] = 1; // if (!isset($mini['board']['total'][$key][$val])) // __error("존재하지 않는 {$key} 입니다."); if (isset($mini['board']['total'][$key][$val])) { $data['total'] = $mini['board']['total'][$key][$val]; } else { $data['total'] = 0; } } } else { foreach ($val_arr as $key2 => $val2) { ${$where_name} .= $key == 'target_member' ? "{$tmp_sep} (target_member={$val2}{$tmp_q})" : "{$tmp_sep} (mode='{$key}'{$tmp_q} and ment LIKE '{$val2}%')"; } } } else { $tmp_sep = $option == '~' ? "and" : $sep; $where_name = $sep == 'and' ? "where_and" : "where"; // +- 가 동시에 적용될 경우 두개는 and로 묶기(date between) if ($option == '-' || $option == '+') { if (isset($s["{$key}-"]) && isset($s["{$key}+"])) { ${$where_name} .= "{$tmp_sep} ({$key} <= '{$s[$key . '-']}' and {$key} >= '{$s[$key . '+']}')"; $both .= "[{$key}]"; } } // :keyword: 검색 적용(high, low) if (preg_match("/:[a-z]+:\$/i", $val)) { $mat = array(); preg_match("/:([a-z]+):\$/i", $val, $mat); $val = preg_replace("/:[a-z]+:/i", "", $val); switch ($mat[1]) { case 'high': if ($val !== '') { ${$where_name} .= " {$tmp_sep} {$key} >= '{$val}'"; } break; case 'low': if ($val !== '') { ${$where_name} .= " {$tmp_sep} {$key} <= '{$val}'"; } break; } } else { if (is_array($val_arr)) { foreach ($val_arr as $key2 => $val2) { switch ($option) { case '!': ${$where_name} .= " {$tmp_sep} {$key}='{$val2}'"; break; case '^': if ($val2 !== '') { ${$where_name} .= " {$tmp_sep} {$key} LIKE '{$val2}%'"; } break; case '$': if ($val2 !== '') { ${$where_name} .= " {$tmp_sep} {$key} LIKE '%{$val2}'"; } break; case '*': if ($val2 !== '') { ${$where_name} .= " {$tmp_sep} {$key} LIKE '%[{$val2}]%'"; } break; case '+': if ($val2 !== '' && !inStr($key, $both)) { ${$where_name} .= " {$tmp_sep} {$key} >= '{$val2}'"; } break; case '-': if ($val2 !== '' && !inStr($key, $both)) { ${$where_name} .= " {$tmp_sep} {$key} <= '{$val2}'"; } break; default: if ($val2 !== '') { ${$where_name} .= " {$tmp_sep} {$key} LIKE '%{$val2}%'"; } } } } } } } } //// 검색 조건이 있을 떄 if ($where || $where_and) { // and와 합침 if ($where && $where_and) { $where = " and (" . substr($where, 4) . "){$where_and}"; } else { if (!$where && $where_and) { $where = $where_and; } } if (!empty($is_key)) { // 다중 게시판 검색 시(총 게시물 수가 없어야 가능) if (!empty($_REQUEST['target']) && !$data['is_total']) { $tmp = array(); $tmp = explode(",", trim($_REQUEST['target'])); $tmp_where = ''; foreach ($tmp as $key => $val) { $val = trim($val); if ($val && !preg_match("/[^0-9]/", $val)) { $tmp_where .= " or id={$val}"; } } if ($tmp_where) { $where = " and (" . substr($tmp_where, 3) . ") and (" . substr($where, 4) . ")"; } } else { if ($_REQUEST['id'] && (!$is_all || $data['is_total'])) { $where = " and id='{$mini['board']['no']}' and (" . substr($where, 4) . ")"; } } } $data['where'] = "WHERE " . substr($where, 4); if (!empty($is_key) && !empty($_REQUEST[$param['andName']]) && !empty($count_val_arr)) { $data['where'] .= " GROUP BY num HAVING count(num) >= {$count_val_arr}"; $data['is_group'] = 1; } } else { $data['is_total'] = 1; } }
function readTemplateFileSource($templateFilePath, $id) { $startStr = ''; $endStr = ''; $s = ''; $c = ''; $startStr = '<!--#sourceHtml' . replace($id, '.html', '') . 'Start#-->'; $endStr = '<!--#sourceHtml' . replace($id, '.html', '') . 'End#-->'; $s = readTemplateFileModular($templateFilePath, $startStr, $endStr); if ($s == '[$NO$]') { //加一个读取本文本里配置列表(20150815) $c = getStrCut($GLOBALS['pubCode'], $startStr, $endStr, 2); if ($c != '') { $readTemplateFileSource = $c; //call rwend(c) return @$readTemplateFileSource; } $c = getFText($templateFilePath); //存在 <!--#TemplateSplitStart#--> 就返回当前全部内容 if (inStr($c, '<!--#DialogStart#-->') > 0) { $readTemplateFileSource = $c; return @$readTemplateFileSource; } $s = '模板资源ID[' . $id . ']不存在,路径TemplateFilePath=' . HandlePath($templateFilePath); } $readTemplateFileSource = $s; return @$readTemplateFileSource; }
{ if(!$builtIn[$function]) { if(!$parse['func'][$function]) tlog(false, $function.' in '.$parse2['files'][$decl], 'OK', 'fail'); else $okCount1++; } } tlog(true, 'Other declarations: '.$okCount1, 'OK', 'fail'); tsection('Unused Code'); ksort($parse['func']); foreach($parse['func'] as $function => $decl) if(!strStartsWith($parse2['files'][$decl], './plugins/') && !strStartsWith($parse2['files'][$decl], './log/') && !strStartsWith($parse2['files'][$decl], './static/')) { if(!inStr($parse2['files'][$decl], 'controller') && substr($function, 0, 1) != '_' && substr($function, 0, 1) != '(' && !strStartsWith($parse2['files'][$decl], './msg') && !$ignoreCallCheck[$function] && !strEndsWith($function, 'callback()') && !strStartsWith($function, 'js_') && !strStartsWith($function, 'dyn_') && $function != 'h2_exceptionhandler()') { if(!$parse['call'][$function]) tlog(false, $function.' in '.$parse2['files'][$decl], 'OK', 'fail'); else $okCount2++; } } tlog(true, 'Other calls: '.$okCount2, 'OK', 'fail'); tsection_end(); ?><!--<pre> <?
function displayTemplatesList($content) { $templatesFolder = ''; $templatePath = ''; $templatePath2 = ''; $templateName = ''; $defaultList = ''; $folderList = ''; $splStr = ''; $s = ''; $c = ''; $s1 = ''; $s2 = ''; $s3 = ''; $splTemplatesFolder = ''; //加载网址配置 loadWebConfig(); $defaultList = getStrCut($content, '[list]', '[/list]', 2); $splTemplatesFolder = aspSplit('/Templates/|/Templates2015/|/Templates2016/', '|'); foreach ($splTemplatesFolder as $key => $templatesFolder) { if ($templatesFolder != '') { $folderList = getDirFolderNameList($templatesFolder); $splStr = aspSplit($folderList, vbCrlf()); foreach ($splStr as $key => $templateName) { if ($templateName != '' && inStr('#_', left($templateName, 1)) == false) { $templatePath = $templatesFolder . $templateName; $templatePath2 = $templatePath; $s = $defaultList; $s1 = getStrCut($content, '<!--启用 start-->', '<!--启用 end-->', 2); $s2 = getStrCut($content, '<!--恢复数据 start-->', '<!--恢复数据 end-->', 2); $s3 = getStrCut($content, '<!--删除模板 start-->', '<!--删除模板 end-->', 2); if (lCase($GLOBALS['cfg_webtemplate']) == lCase($templatePath)) { $templateName = '<font color=red>' . $templateName . '</font>'; $templatePath2 = '<font color=red>' . $templatePath2 . '</font>'; $s = replace(replace($s, $s1, ''), $s3, ''); } else { $s = replace($s, $s2, ''); } $s = replaceValueParam($s, 'templatename', $templateName); $s = replaceValueParam($s, 'templatepath', $templatePath); $s = replaceValueParam($s, 'templatepath2', $templatePath2); $c = $c . $s . vbCrlf(); } } } } $content = replace($content, '[list]' . $defaultList . '[/list]', $c); $displayTemplatesList = $content; return @$displayTemplatesList; }
function setHtmlParam($content, $ParamList) { $splStr = ''; $startStr = ''; $endStr = ''; $c = ''; $paramValue = ''; $ReplaceStartStr = ''; $endStr = '\''; $splStr = aspSplit($ParamList, '|'); foreach ($splStr as $key => $startStr) { $startStr = aspTrim($startStr); if ($startStr != '') { //替换开始字符 因为开始字符类型可变 不同 $ReplaceStartStr = $startStr; if (left($ReplaceStartStr, 3) == 'img') { $ReplaceStartStr = mid($ReplaceStartStr, 4, -1); } else { if (left($ReplaceStartStr, 1) == 'a') { $ReplaceStartStr = mid($ReplaceStartStr, 2, -1); } else { if (inStr('|ul|li|', '|' . left($ReplaceStartStr, 2) . '|') > 0) { $ReplaceStartStr = mid($ReplaceStartStr, 3, -1); } } } $ReplaceStartStr = ' ' . $ReplaceStartStr . '=\''; $startStr = ' ' . $startStr . '=\''; if (inStr($content, $startStr) > 0 && inStr($content, $endStr) > 0) { $paramValue = StrCut($content, $startStr, $endStr, 2); $paramValue = HandleInModule($paramValue, 'end'); //处理内部模块 $c = $c . $ReplaceStartStr . $paramValue . $endStr; } } } $setHtmlParam = $c; return @$setHtmlParam; }
function handleHaveStr($content, $zd) { $s = ''; $i = ''; $handleHaveStr = false; for ($i = 1; $i <= len($zd); $i++) { $s = mid($zd, $i, 1); if (inStr($content, $s) > 0) { $handleHaveStr = true; return @$handleHaveStr; } } return @$handleHaveStr; }
function jsCodeConfusion($content) { $splStr = ''; $i = ''; $YesJs = ''; $YesWord = ''; $Sx = ''; $s = ''; $Wc = ''; $Zc = ''; $s1 = ''; $AspCode = ''; $SYHCount = ''; $UpWord = ''; $UpWordn = ''; $tempS = ''; $DimList = ''; $YesFunction = ''; //函数是否为真 $StartFunction = ''; //开始函数 目的是为了让function default 处理函数后面没有() 20150218 $StartFunction = false; //默认开始函数为假 //If nType="" Then nType = 0 $yesJs = false; //是ASP 默认为假 $YesFunction = false; //是函数 默认为假 $YesWord = false; //是单词 默认为假 $SYHCount = 0; //双引号默认为0 $splStr = aspSplit($content, vbCrlf()); //分割行 $wcType = ''; //输入文本类型,如 " 或 ' $isAddToSYH = ''; //是否累加双引号 $beforeStr = ''; $afterStr = ''; $endCode = ''; $nSYHCount = ''; //循环分行 foreach ($splStr as $key => $s) { //循环每个字符 for ($i = 1; $i <= len($s); $i++) { $Sx = mid($s, $i, 1); //Asp开始 if ($Sx == '<' && $Wc == '') { //输出文本必需为空 Wc为输出内容 如"<%" 排除 修改于20140412 if (mid($s, $i + 1, 6) == 'script') { $yesJs = true; //ASP为真 $i = $i + 1; //加1而不能加2,要不然<%function Test() 就截取不到 $Sx = mid($s, $i, 1); $AspCode = $AspCode . '<'; } //ASP结束 } else { if ($Sx == '<' && mid($s, $i + 1, 8) == '/script>' && $Wc == '') { //Wc为输出内容 $yesJs = false; //ASP为假 $i = $i + 1; //不能加2,只能加1,因为这里定义ASP为假,它会在下一次显示上面的 'ASP运行为假 $Sx = mid($s, $i, 8); $AspCode = $AspCode . '/script>'; } } if ($yesJs == true) { $beforeStr = right(replace(mid($s, 1, $i - 1), ' ', ''), 1); //上一个字符 $afterStr = left(replace(mid($s, $i + 1, -1), ' ', ''), 1); //下一个字符 $endCode = mid($s, $i + 1, -1); //当前字符往后面代码 一行 //输入文本 if ($sx == '"' || $sx == '\'' && $wcType == '' || $sx == $wcType || $wc != '') { $isAddToSYH = true; //这是一种简单的方法,等完善(20150914) if ($isAddToSYH == true && $beforeStr == '\\') { if (len($wc) >= 1) { if (isStrTransferred($wc) == true) { //为转义字符为真 //call echo(wc,isStrTransferred(wc)) $isAddToSYH = false; } } else { $isAddToSYH = false; } //call echo(wc,isAddToSYH) } if ($wc == '') { $wcType = $sx; } //双引号累加 if ($sx == $wcType && $isAddToSYH == true) { $nSYHCount = $nSYHCount + 1; } //排除上一个字符为\这个转义字符(20150914) //判断是否"在最后 if ($nSYHCount % 2 == 0 && $beforeStr != '\\') { if (mid($s, $i + 1, 1) != $wcType) { $wc = $wc . $sx; $AspCode = $AspCode . $wc; //行代码累加 //call echo("wc",wc) $nSYHCount = 0; $wc = ''; //清除 $wcType = ''; } else { $wc = $wc . $sx; } } else { $wc = $wc . $sx; } } else { if ($Sx == '\'') { //注释则退出 $AspCode = $AspCode . mid($s, $i, -1); break; //字母 } else { if (checkABC($Sx) == true || $Sx == '_' && $Zc != '' || $Zc != '') { $Zc = $Zc . $Sx; $s1 = lCase(mid($s . ' ', $i + 1, 1)); if (inStr('abcdefghijklmnopqrstuvwxyz0123456789', $s1) == 0 && ($s1 == '_' && $Zc != '')) { //最简单判断 $tempS = mid($s, $i + 1, -1); if (inStr('|function|sub|', '|' . lCase($Zc) . '|')) { //函数开始 if ($YesFunction == false && lCase($UpWord) != 'end') { $YesFunction = true; $DimList = getFunDimName($tempS); $StartFunction = true; } else { if ($YesFunction == true && lCase($UpWord) == 'end') { //获得上一个单词 $YesFunction = false; } } } else { if ($YesFunction == true && lCase($Zc) == 'var') { $DimList = $DimList . ',' . getVarName($tempS); } else { if ($YesFunction == true) { //排除函数后面每一个名称 if ($StartFunction == false) { $Zc = replaceDim2($DimList, $Zc); } $StartFunction = false; } } } $UpWord = $Zc; //记住当前单词 $AspCode = $AspCode . $Zc; $Zc = ''; } } else { $AspCode = $AspCode . $Sx; } } } } else { $AspCode = $AspCode . $Sx; } doEvents(); } $AspCode = aspRTrim($AspCode); //去除右边空格 $AspCode = $AspCode . vbCrlf(); //Asp换行 doEvents(); } $jsCodeConfusion = $AspCode; return @$jsCodeConfusion; }
$temp = $temp[1]; $temp = explode("OKNOW", $temp); $temp = $temp[0]; fputs($usenet, $temp); } elseif (inStr("HISTIMEWEWILLGIVEYOU", @decrypt_final("tobrute", $kp))) { $temp = @decrypt_final("tobrute", $kp); $temp = explode("DLERIGHTHERE", $temp); $temp = $temp[1]; $temp = explode("OKNOW", $temp); $temp = $temp[0]; fputs($usenet, $temp); } elseif (inStr("HISTIMEWEWILLGIVEYOU", @decrypt_final("dictionary", $kp))) { $temp = @decrypt_final("tobrute", $kp); $temp = explode("DLERIGHTHERE", $temp); $temp = $temp[1]; $temp = explode("OKNOW", $temp); $temp = $temp[0]; fputs($usenet, $temp); } elseif (inStr("HISTIMEWEWILLGIVEYOU", @decrypt_final("diary", $kp))) { $temp = @decrypt_final("diary", $kp); $temp = explode("DLERIGHTHERE", $temp); $temp = $temp[1]; $temp = explode("OKNOW", $temp); $temp = $temp[0]; fputs($usenet, $temp); } fputs($usenet, "\n"); $kp = fgets($usenet, 8192); echo $kp; } }
function orAndSearch($addSql, $SeectField, $SearchValue) { $splStr = ''; $s = ''; $c = ''; $SearchValue = regExp_Replace($SearchValue, ' or ', ' Or '); $SearchValue = regExp_Replace($SearchValue, ' and ', ' And '); if (inStr($SearchValue, ' Or ') > 0) { $splStr = aspSplit($SearchValue, ' Or '); foreach ($splStr as $key => $s) { if ($s != '') { if ($c != '') { $c = $c . ' Or '; } $c = $c . ' ' . $SeectField . ' Like \'%' . $s . '%\''; } } } else { if (inStr($SearchValue, ' And ') > 0) { $splStr = aspSplit($SearchValue, ' And '); foreach ($splStr as $key => $s) { if ($s != '') { if ($c != '') { $c = $c . ' And '; } $c = $c . ' ' . $SeectField . ' Like \'%' . $s . '%\''; } } } else { if ($SearchValue != '') { $splStr = aspSplit($SearchValue, ' And '); foreach ($splStr as $key => $s) { if ($s != '') { if ($c != '') { $c = $c . ' And '; } $c = $c . ' ' . $SeectField . ' Like \'%' . $s . '%\''; } } } } } if ($c != '') { if (inStr(lCase($addSql), ' where ') == 0) { $c = ' Where ' . $c; } else { $c = ' And ' . $c; } $addSql = $addSql . $c; } $orAndSearch = $addSql; return @$orAndSearch; }
function getBrType($theInfo) { $strType = ''; $tmp1 = ''; $s = ''; $s = 'Other Unknown'; if ($theInfo == '') { $theInfo = uCase(serverVariables('HTTP_USER_AGENT')); } if (inStr($theInfo, uCase('mozilla')) > 0) { $s = 'Mozilla'; } if (inStr($theInfo, uCase('icab')) > 0) { $s = 'iCab'; } if (inStr($theInfo, uCase('lynx')) > 0) { $s = 'Lynx'; } if (inStr($theInfo, uCase('links')) > 0) { $s = 'Links'; } if (inStr($theInfo, uCase('elinks')) > 0) { $s = 'ELinks'; } if (inStr($theInfo, uCase('jbrowser')) > 0) { $s = 'JBrowser'; } if (inStr($theInfo, uCase('konqueror')) > 0) { $s = 'konqueror'; } if (inStr($theInfo, uCase('wget')) > 0) { $s = 'wget'; } if (inStr($theInfo, uCase('ask jeeves')) > 0 || inStr($theInfo, uCase('teoma')) > 0) { $s = 'Ask Jeeves/Teoma'; } if (inStr($theInfo, uCase('wget')) > 0) { $s = 'wget'; } if (inStr($theInfo, uCase('opera')) > 0) { $s = 'opera'; } if (inStr($theInfo, uCase('NOKIAN')) > 0) { $s = 'NOKIAN(诺基亚手机)'; } if (inStr($theInfo, uCase('SPV')) > 0) { $s = 'SPV(多普达手机)'; } if (inStr($theInfo, uCase('Jakarta Commons')) > 0) { $s = 'Jakarta Commons-HttpClient'; } if (inStr($theInfo, uCase('Gecko')) > 0) { $strType = '[Gecko] '; $s = 'Mozilla Series'; if (inStr($theInfo, uCase('aol')) > 0) { $s = 'AOL'; } if (inStr($theInfo, uCase('netscape')) > 0) { $s = 'Netscape'; } if (inStr($theInfo, uCase('firefox')) > 0) { $s = 'FireFox'; } if (inStr($theInfo, uCase('chimera')) > 0) { $s = 'Chimera'; } if (inStr($theInfo, uCase('camino')) > 0) { $s = 'Camino'; } if (inStr($theInfo, uCase('galeon')) > 0) { $s = 'Galeon'; } if (inStr($theInfo, uCase('k-meleon')) > 0) { $s = 'K-Meleon'; } $s = $strType . $s; } if (inStr($theInfo, uCase('bot')) > 0 || inStr($theInfo, uCase('crawl')) > 0) { $strType = '[Bot/Crawler]'; if (inStr($theInfo, uCase('grub')) > 0) { $s = 'Grub'; } if (inStr($theInfo, uCase('googlebot')) > 0) { $s = 'GoogleBot'; } if (inStr($theInfo, uCase('msnbot')) > 0) { $s = 'MSN Bot'; } if (inStr($theInfo, uCase('slurp')) > 0) { $s = 'Yahoo! Slurp'; } $s = $strType . $s; } if (inStr($theInfo, uCase('applewebkit')) > 0) { $strType = '[AppleWebKit]'; $s = ''; if (inStr($theInfo, uCase('omniweb')) > 0) { $s = 'OmniWeb'; } if (inStr($theInfo, uCase('safari')) > 0) { $s = 'Safari'; } $s = $strType . $s; } if (inStr($theInfo, uCase('msie')) > 0) { $strType = '[MSIE'; $tmp1 = mid($theInfo, inStr($theInfo, uCase('MSIE')) + 4, 6); $tmp1 = left($tmp1, inStr($tmp1, ';') - 1); $strType = $strType . $tmp1 . ']'; $s = 'Internet Explorer'; $s = $strType . $s; } if (inStr($theInfo, uCase('msn')) > 0) { $s = 'MSN'; } if (inStr($theInfo, uCase('aol')) > 0) { $s = 'AOL'; } if (inStr($theInfo, uCase('webtv')) > 0) { $s = 'WebTV'; } if (inStr($theInfo, uCase('myie2')) > 0) { $s = 'MyIE2'; } if (inStr($theInfo, uCase('maxthon')) > 0) { $s = 'Maxthon(傲游浏览器)'; } if (inStr($theInfo, uCase('gosurf')) > 0) { $s = 'GoSurf(冲浪高手浏览器)'; } if (inStr($theInfo, uCase('netcaptor')) > 0) { $s = 'NetCaptor'; } if (inStr($theInfo, uCase('sleipnir')) > 0) { $s = 'Sleipnir'; } if (inStr($theInfo, uCase('avant browser')) > 0) { $s = 'AvantBrowser'; } if (inStr($theInfo, uCase('greenbrowser')) > 0) { $s = 'GreenBrowser'; } if (inStr($theInfo, uCase('slimbrowser')) > 0) { $s = 'SlimBrowser'; } if (inStr($theInfo, uCase('360SE')) > 0) { $s = $s . '-360SE(360安全浏览器)'; } if (inStr($theInfo, uCase('QQDownload')) > 0) { $s = $s . '-QQDownload(QQ下载器)'; } if (inStr($theInfo, uCase('TheWorld')) > 0) { $s = $s . '-TheWorld(世界之窗浏览器)'; } if (inStr($theInfo, uCase('icafe8')) > 0) { $s = $s . '-icafe8(网维大师网吧管理插件)'; } if (inStr($theInfo, uCase('TencentTraveler')) > 0) { $s = $s . '-TencentTraveler(腾讯TT浏览器)'; } if (inStr($theInfo, uCase('baiduie8')) > 0) { $s = $s . '-baiduie8(百度IE8.0)'; } if (inStr($theInfo, uCase('iCafeMedia')) > 0) { $s = $s . '-iCafeMedia(网吧网媒趋势插件)'; } if (inStr($theInfo, uCase('DigExt')) > 0) { $s = $s . '-DigExt(IE5允许脱机阅读模式特殊标记)'; } if (inStr($theInfo, uCase('baiduds')) > 0) { $s = $s . '-baiduds(百度硬盘搜索)'; } if (inStr($theInfo, uCase('CNCDialer')) > 0) { $s = $s . '-CNCDialer(数控拨号)'; } if (inStr($theInfo, uCase('NOKIAN85')) > 0) { $s = $s . '-NOKIAN85(诺基亚手机)'; } if (inStr($theInfo, uCase('SPV_C600')) > 0) { $s = $s . '-SPV_C600(多普达C600)'; } if (inStr($theInfo, uCase('Smartphone')) > 0) { $s = $s . '-Smartphone(Windows Mobile for Smartphone Edition 操作系统的智能手机)'; } $getBrType = $s; return @$getBrType; }
function getParamValue($content, $paramName) { $LCaseContent = ''; $s = ''; $splStart = ''; $splEnd = ''; $i = ''; $startStr = ''; $endStr = ''; $LCaseContent = lCase($content); $splStart = array('="', '=\'', '='); $splEnd = array('"', '\'', '>'); for ($i = 0; $i <= uBound($splStart); $i++) { $startStr = $paramName . $splStart[$i]; $endStr = $splEnd[$i]; if (inStr($LCaseContent, $startStr) > 0 && inStr($LCaseContent, $endStr) > 0) { $s = StrCut($content, $startStr, $endStr, 2); if ($s != '') { $getParamValue = $s; return @$getParamValue; } } } return @$getParamValue; }
function XY_handleGetTableBody($action, $tableName, $fieldParamName, $defaultFileName, $adminUrl) { $url = ''; $content = ''; $id = ''; $sql = ''; $addSql = ''; $fieldName = ''; $fieldParamValue = ''; $fieldNameList = ''; $nLen = ''; $delHtmlYes = ''; $trimYes = ''; $defaultStr = ''; $noisonhtml = ''; $intoFieldStr = ''; $valuesStr = ''; $nonull = ''; $fieldName = RParam($action, 'fieldname'); //字段名称 $noisonhtml = RParam($action, 'noisonhtml'); //不生成html $nonull = RParam($action, 'noisonhtml'); //内容不能为空20160716 home if ($noisonhtml == 'true') { $intoFieldStr = ',isonhtml'; $valuesStr = ',0'; } $fieldNameList = getHandleFieldList($GLOBALS['db_PREFIX'] . $tableName, '字段列表'); //字段名称不为空,并且要在表字段里 if ($fieldName == '' || inStr($fieldNameList, ',' . $fieldName . ',') == false) { $fieldName = $defaultFileName; } $fieldName = lCase($fieldName); //转为小写,因为在PHP里是全小写的 $fieldParamValue = RParam($action, $fieldParamName); //截取字段内容 $id = handleNumber(RParam($action, 'id')); //获得ID $addSql = ' where ' . $fieldParamName . '=\'' . $fieldParamValue . '\''; if ($id != '') { $addSql = ' where id=' . $id; } $content = getDefaultValue($action); $defaultStr = $content; //获得默认内容 $sql = 'select * from ' . $GLOBALS['db_PREFIX'] . $tableName . $addSql; $rsObj = $GLOBALS['conn']->query($sql); if (@mysql_num_rows($rsObj) == 0) { $rs = mysql_fetch_array($rsObj); //自动添加 20160113 if (RParam($action, 'autoadd') == 'true') { connexecute('insert into ' . $GLOBALS['db_PREFIX'] . $tableName . ' (' . $fieldParamName . ',' . $fieldName . $intoFieldStr . ') values(\'' . $fieldParamValue . '\',\'' . ADSql($content) . '\'' . $valuesStr . ')'); } } else { $id = $rs['id']; $content = $rs[$fieldName]; if (len($content) <= 0) { $content = $defaultStr; connexecute('update ' . $GLOBALS['db_PREFIX'] . $tableName . ' set ' . $fieldName . '=\'' . $content . '\' where id=' . $rs['id']); } } //删除Html $delHtmlYes = RParam($action, 'delHtml'); //是否删除Html if ($delHtmlYes == 'true') { $content = replace(delHtml($content), '<', '<'); } //HTML处理 //删除两边空格 $trimYes = RParam($action, 'trim'); //是否删除两边空格 if ($trimYes == 'true') { $content = TrimVbCrlf($content); } //截取字符处理 $nLen = RParam($action, 'len'); //字符长度值 $nLen = handleNumber($nLen); //If nLen<>"" Then ReplaceStr = CutStr(ReplaceStr,nLen,"null")' Left(ReplaceStr,nLen) if ($nLen != '') { $content = CutStr($content, $nLen, '...'); } //Left(ReplaceStr,nLen) if ($id == '') { $id = XY_AP_GetFieldValue('', $sql, 'id'); } $url = $adminUrl . '&id=' . $id . '&n=' . getRnd(11); if (@$_REQUEST['gl'] == 'edit') { $content = '<span>' . $content . '</span>'; } //call echo(sql,url) $content = handleDisplayOnlineEditDialog($url, $content, '', 'span'); $XY_handleGetTableBody = $content; return @$XY_handleGetTableBody; }
function handleDifferenceWebSiteList($httpurl, $urllist) { $website = ''; $splstr = ''; $url = ''; $c = ''; $urlWebsite = ''; $websiteList = ''; $website = lCase(getWebSite($httpurl)); $splstr = aspSplit($urllist, vbCrlf()); foreach ($splstr as $key => $url) { $urlWebsite = lCase(getWebSite($url)); if ($urlWebsite != '' && $website != $urlWebsite && inStr(vbCrlf() . $websiteList . vbCrlf(), vbCrlf() . $urlWebsite . vbCrlf()) == false) { $websiteList = $websiteList . $urlWebsite . vbCrlf(); } } $handleDifferenceWebSiteList = $websiteList; return @$handleDifferenceWebSiteList; }
/** * 입력 변수 체크 - 회원 * @class admin.member * @param $data: 자료 */ function checkFieldMember(&$data) { global $mini; if (!is_array($data)) { __error("입력된 데이터가 없습니다"); } // DB 컬럼 로드 iss($col); $col = getColumns($mini['name']['member']); foreach ($data as $key => $val) { switch ($key) { // 숫자 체크 case 'site': case 'level': case 'confirm_jumin': case 'permit_mail': case 'confirm_mail': case 'permit_cp': case 'confirm_cp': case 'age': case 'icon': case 'icon_name': case 'photo': case 'point': case 'point_sum': case 'money': case 'lock_login': case 'admit': check($val, "type:num, name:{$key}, is_not:1"); break; // 삭제 설정 // 삭제 설정 case 'date': case 'no': unset($data[$key]); break; // 그룹연결 // 그룹연결 case 'site_link': if (is_array($val)) { $data[$key] = "[" . implode("][", $val) . "]"; } break; // 비밀번호 // 비밀번호 case 'pass_encode': case 'pass': if (isset($data['pass_encode']) && $data['pass_encode']) { switch ($mini['site']['secure_pass']) { case 'md5': case 'sha1': case 'mixed': check($data['pass_encode'], "type:id, name:암호화된 비밀번호, min:16, max:40"); break; case 'mysql': $data['pass_encode'] = mysql_escape_string($data['pass_encode']); $tmp = array(); $tmp = sql("SELECT password('{$data['pass_encode']}') as pass"); $data['pass'] = $tmp['pass']; break; case 'mysql_old': $data['pass_encode'] = mysql_escape_string($data['pass_encode']); $tmp = array(); $tmp = sql("SELECT old_password('{$data['pass_encode']}') as pass"); $data['pass'] = $tmp['pass']; break; } $data['pass'] = $data['pass_encode']; unset($data['pass_encode']); } else { unset($data[$key]); } break; // 홈페이지 // 홈페이지 case 'homepage': check($data[$key], "type:homepage, name:홈페이지, is_not:1"); break; // 주민등록번호 // 주민등록번호 case 'jumin': check($val, "type:jumin, name:주민등록번호, is_not:1"); break; // 사업자번호 // 사업자번호 case 'co_num': check($val, "type:co_num, name:사업자등록번호, is_not:1"); // 메일 // 메일 case 'mail': check($val, "type:mail, name:메일, is_not:1"); // 가입제한 메일 체크 if (!empty($mini['site']['filter_mail'])) { if (inStr(a(explode('@', $val), '1'), $mini['site']['filter_mail'])) { __error("가입이 제한된 메일 도메인 입니다. 다른 도메인을 사용한 메일로 가입해주세요"); } } break; // 휴대전화 // 휴대전화 case 'cp': check($val, "type:cp, name:휴대전화, is_not:1"); break; // 메신져 // 메신져 case 'chat': if (!empty($val)) { $data[$key] = "[" . implode("][", array_unique(getStr($val))) . "]"; } break; // 추가필드 // 추가필드 case 'field': if (is_array($val)) { str($data[$key], 'encode'); $data[$key] = serialize($data[$key]); } else { __error('추가필드 형식이 올바르지 않습니다'); } break; // 내용 필터 // 내용 필터 case 'sign': case 'ment': if (!empty($val)) { filter($data[$key], 'encode'); } break; // str형식 // str형식 case 'open': $data[$key] = "[" . implode("][", $val) . "]"; break; // 기본(단일필드) // 기본(단일필드) default: // tmp 값 제외 if (preg_match("/^tmp_/i", $key)) { unset($data[$key]); } // 존재하지 않는 필드일 때 빼기 if (!inStr($key, $col)) { unset($data[$key]); } // 배열 값 제외 if (is_array($val)) { __error("[{$key}] 값은 허용되지 않습니다"); } } } }
function interpretQueryString($qs) { $uri = parse_url('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']); $path = ''; if ($uri['query'] != '') { parse_str($uri['query'], $_REQUEST_new); $_REQUEST = array_merge($_REQUEST, $_REQUEST_new); $firstPart = CutSegment('&', $uri['query']); if (!$GLOBALS['config']['service']['url_rewrite'] && !inStr($firstPart, '=')) { $path = $firstPart; } } if ($GLOBALS['config']['service']['url_rewrite']) { $path = substr($uri['path'], 1); } $call = explode(URL_CA_SEPARATOR, $path); if (!array_search($path, array('robots.txt', 'favicon.ico')) === false) { return; } foreach (explode('/', $call[0]) as $ctrPart) { if (trim($ctrPart) != '') { $controllerPart = $ctrPart; } } $_REQUEST['controller'] = getDefault($controllerPart, cfg('service/defaultcontroller')); unset($call[0]); $_REQUEST['action'] = getDefault(implode(URL_CA_SEPARATOR, $call), cfg('service/defaultaction')); }
function handleArray($content, $SplType, $SType) { $splStr = ''; $s = ''; $c = ''; $OKYes = ''; $SType = '|' . lCase($SType) . '|'; $splStr = aspSplit($content, $SplType); foreach ($splStr as $key => $s) { $OKYes = true; if (inStr($SType, '|nonull|') > 0 && $OKYes == true) { if ($s == '') { $OKYes = false; } } if (inStr($SType, '|norepeat|') > 0 && $OKYes == true) { if (inStr($SplType . $c . $SplType, $SplType . $s . $SplType) > 0) { $OKYes = false; } } if ($OKYes == true) { $c = $c . $s . $SplType; } } if ($c != '') { $c = left($c, len($c) - len($SplType)); } $handleArray = $c; return @$handleArray; }