ㅁㄴㄹㅇ
더시민
0
1506
0
2021.04.23 07:49
function apms_manager_widget($searchid='',$wname, $wid='', $opt='', $mopt='', $wdir='', $addon=''){
global $is_designer, $is_demo, $is_wdir;
if($wdir) {
$widget_path = $wdir.'/'.$wname;
$widget_url = str_replace(G5_PATH, G5_URL, $wdir).'/'.$wname;
$wdir = str_replace(G5_PATH, '', $wdir);
} else if($is_wdir) {
$widget_url = G5_URL.$is_wdir.'/'.$wname;
$widget_path = G5_PATH.$is_wdir.'/'.$wname;
$wdir = $is_wdir;
} else {
if($addon) { // 애드온
$widget_url = G5_SKIN_URL.'/addon/'.$wname;
$widget_path = G5_SKIN_PATH.'/addon/'.$wname;
} else {
$widget_url = THEMA_URL.'/widget/'.$wname;
$widget_path = THEMA_PATH.'/widget/'.$wname;
}
}
if(!is_file($widget_path.'/widget.php')) return;
$wid = apms_escape_string($wid);
if($wid) {
$wset = apms_widget_config($wid, $opt, $mopt, $addon);
$setup_href = '';
if($is_demo || $is_wdir || $is_designer) {
$setup_href = G5_BBS_URL.'/widget.setup.php?wid='.urlencode($wid).'&wname='.urlencode($wname).'&thema='.urlencode(THEMA);
if($addon) $setup_href .= '&add='.$addon;
if($opt) $setup_href .= '&opt='.urlencode($opt);
if($mopt) $setup_href .= '&mopt='.urlencode($mopt);
if($wdir) $setup_href .= '&wdir='.urlencode($wdir);
if($is_demo) $setup_href .= '&wdemo=1';
}
} else if($opt) {
$wset = apms_query($opt);
if(G5_IS_MOBILE && $wset && $mopt) {
$wset = array_merge($wset, apms_query($mopt));
}
// 추가쿼리구문 작동안됨
unset($wset['where']);
unset($wset['orderby']);
}
// 초기값
$wset['new'] = (isset($wset['new']) && $wset['new']) ? $wset['new'] : 'red';
$wset['cache'] = (isset($wset['cache']) && $wset['cache'] > 0) ? $wset['cache'] : 0;
//검색아이디(가게업체)
$wset['mb_list'] = ($searchid) ? $searchid : $wset['mb_list'];
ob_start();
@include ($widget_path.'/widget.php');
$widget = ob_get_contents();
ob_end_clean();
return $widget;
}
function attend_manager($bo_table,$mb_id){//보드값/글쓴아이디/숫자 입력하면 목록
global $g5;
$search_table = $g5['write_prefix'].$bo_table;
//as_type 메인글필드를 출근으로 활용
$sql = "select * from {$search_table}
where mb_id = '{$mb_id}' and wr_is_comment = '0' and as_type = '1' ";
$res =sql_query($sql);
for($i=0;$row = sql_fetch_array($res);$i++){
$manager[$i] = $row['wr_1'];
}
return $manager;
}
//****
//멀티용 함수 추가
// 검색 구문을 얻는다.
function get_sql_dimensearch($search_ca_name, $search_field, $search_text, $search_operator='and')
{
global $g5;
$str = "";
if ($search_ca_name)
$str = " ca_name like '{$search_ca_name}%' ";
$search_text = strip_tags(($search_text));
$search_text = trim(stripslashes($search_text));
if (!$search_text && $search_text !== '0') {
if ($search_ca_name) {
return $str;
} else {
return '0';
}
}
if ($str)
$str .= " and ";
// 쿼리의 속도를 높이기 위하여 ( ) 는 최소화 한다.
$op1 = "";
// 검색어를 구분자로 나눈다. 여기서는 공백
$s = array();
$s = explode(" ", $search_text);
// 검색필드를 구분자로 나눈다. 여기서는 +
$tmp = array();
$tmp = explode(",", trim($search_field));
$field = explode("||", $tmp[0]);
$not_comment = "";
if (!empty($tmp[1]))
$not_comment = $tmp[1];
$str .= "(";
for ($i=0; $i