本文整理汇总了PHP中inStr函数的典型用法代码示例。如果您正苦于以下问题:PHP inStr函数的具体用法?PHP inStr怎么用?PHP inStr使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了inStr函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFormFieldList
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;
}
示例2: loadWebConfig
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'] . '';
//模板路径
}
}
}
示例3: OperationSystem
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;
}
示例4: parsePost
/** 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') {
//.........这里部分代码省略.........
示例5: getLink
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;
}
}
}
示例6: getStrIntContentNumb
function getStrIntContentNumb($content, $findStr)
{
$splStr = '';
if (inStr($content, $findStr) > 0) {
$splStr = aspSplit($content, $findStr);
$getStrIntContentNumb = uBound($splStr);
} else {
$getStrIntContentNumb = 0;
}
return @$getStrIntContentNumb;
}
示例7: moduleFindContent
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;
}
示例8: sendMemo
/** 쪽지 쓰기
* @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;
}
}
示例9: checkHtmlFormatting
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;
}
示例10: getPostSql
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
//.........这里部分代码省略.........
示例11: handleReadCssContent
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;
}
示例12: saveSiteMap
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) {
//.........这里部分代码省略.........
示例13: setLogin
/**
* 로그인
* @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']}회 이상 실패하여 아이디가 잠겼습니다. 관리자에게 문의하세요");
}
//.........这里部分代码省略.........
示例14: spl_autoload_register
<?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;
}
示例15: setSearch
//.........这里部分代码省略.........
// :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;
}
}