$af) { if($af['Lang'] == 3) { $lang3 = true; break; } } if($act) { include('page/default/default_'.$act.'.php'); } else { /************ Sorting **************/ if($submit=='yes') { foreach($sortid as $id => $sort_id) { $db->query("UPDATE {$tbName} SET {$dbPrefix}_sort_id='$sort_id' WHERE {$dbPrefix}_id='$id'"); } foreach($newshome as $id => $news_home) { $db->query("UPDATE {$tbName} SET {$dbPrefix}_home='$news_home' WHERE {$dbPrefix}_id='$id'"); } header("LOCATION: m-{$index}"); exit; } /************ Sorting **************/ /************ Delete Record **************/ if($delete) { // $sql = " SELECT * FROM {$tbName} WHERE {$dbPrefix}_id = '{$delete}' "; if ( $clsMySQL->execQuery($sql) ) { $rsDelMst = $clsMySQL->result; while( $aryDel = $clsMySQL->fetchAry($rsDelMst) ) { // foreach ($aryFld as $key => $af) { // // print_r($af); if ( isset($debug) && $debug == 1 ) { fShowMsg($af['type']); } switch($af['type']) { // case 'file': case 'image': if ( isset($debug) && $debug == 1 ) { fShowMsg($af['Name']); } if ( isset($debug) && $debug == 1 ) { fShowMsg($af['resize']); } if ( isset($aryDel[$af['Name']]) && $aryDel[$af['Name']] != '' ) { // $aryLoc = explode('|' , $aryDel[$af['Name']]); if ( sizeof($aryLoc) == 1 ) { $delLoc = $aryLoc[0]; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = '../'.$aryLoc[0]; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } if ( isset($af['resize']) && $af['resize'] != '' ) { $aryDelResize = explode( ';' , $af['resize'] ); foreach( $aryDelResize as $strR ) { $aryR = explode(',' , $strR); if ( $aryR[1] != '' ) { $delLoc = img_path($aryLoc[0],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = img_path('../'.$aryLoc[0],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } } } } } else { $delLoc = $aryLoc[10]; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = '../'.$aryLoc[1]; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } if ( isset($af['resize']) && $af['resize'] != '' ) { $aryDelResize = explode( ';' , $af['resize'] ); foreach( $aryDelResize as $strR ) { $aryR = explode(',' , $strR); if ( $aryR[1] != '' ) { $delLoc = img_path($aryLoc[1],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = img_path('../'.$aryLoc[1],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } } } } } } break; // case 'multiupload': if ( isset($debug) && $debug == 1 ) { fShowMsg($af['Name']); } if ( isset($debug) && $debug == 1 ) { fShowMsg($af['ref_type']); } if ( isset($debug) && $debug == 1 ) { fShowMsg($af['resize']); } if ( $af['ref_type'] != '' ) { $sql = " SELECT * FROM attachment WHERE a_ref_id = '{$delete}' AND a_ref_type = '{$af['ref_type']}' "; if ( isset($debug) && $debug == 1 ) { fShowSQL($sql); } if ( $clsMySQL->execQuery($sql) ) { while( $aryA = $clsMySQL->fetchArray() ) { // if ( isset($debug) && $debug == 1 ) { fShowMsg($aryA['a_path']); } $delLoc = $aryA['a_path']; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = '../'.$aryA['a_path']; if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } if ( isset($af['resize']) && $af['resize'] != '' ) { $aryDelResize = explode( ';' , $af['resize'] ); foreach( $aryDelResize as $strR ) { $aryR = explode(',' , $strR); if ( $aryR[1] != '' ) { $delLoc = img_path($aryA['a_path'],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } $delLoc = img_path('../'.$aryA['a_path'],$aryR[0]); if ( file_exists($delLoc) ) { // if ( isset($debug) && $debug == 1 ) { fShowCD("unlink({$delLoc})"); } unlink($delLoc); } } } } } } $sql = " DELETE FROM attachment WHERE a_ref_id = '{$delete}' AND a_ref_type = '{$af['ref_type']}' "; if ( isset($debug) && $debug == 1 ) { fShowSQL($sql); } $clsMySQL->execSQL($sql); } break; // } } } } // $db->query("DELETE FROM {$tbName} WHERE {$dbPrefix}_id='$delete'"); $db->query("DELETE FROM tags WHERE tags_id='$delete'"); $db->query("DELETE FROM tags_tc WHERE tags_id='$delete'"); $db->query("DELETE FROM meta WHERE meta_ref_id='$delete' AND meta_ref_type='news'"); echo 'ok'; exit; } /*************** Keyword *****************/ if($keyword) { foreach($aryFld as $af) { if($af['keyword']) { if( $af['Lang'] == 1 && $clsConfig->langMulti) { foreach ( $clsConfig->lang as $key => $lang ) { $filname = $af['Name'].($key>0 ? '_'.$lang : ''); $where .= ($where ? ' OR ' : '').$filname." LIKE '%$keyword%'"; } } else { $where .= ($where ? ' OR ' : '').$af['Name']." LIKE '%$keyword%'"; } } } if ( $where != "" ) { $where = " ( $where ) "; } } if($cid) { $where .= ($where ? ' AND ' : '')."{$dbPrefix}_cate='$cid'"; } /*************** lang = 3 *****************/ if ( ( !isset($noLang) || $noLang != 1 ) && $lang3 ) { $where .= ($where ? ' AND ' : '')."{$dbPrefix}_lang='en'"; } /*************** Keyword *****************/ if(!empty($listWhere)) { $where .= ($where ? ' AND ' : '').$listWhere; } $page = $page ? $page : 1; $start = ($page-1) * $ipp; if ($cid) { $smu .= ($smu ? '&' : '?').'cid='.$cid; } if ($keyword) { $smu .= ($smu ? '&' : '?').'keyword='.$keyword; } if($selfMultiUrl) { $smu = ''; foreach($selfMultiUrl as $s) { if(isset($GLOBALS[$s])) { $smu .= ($smu ? '&' : '?').$s.'='.$GLOBALS[$s]; } } } $smu .= ($smu ? '' : '?'); $multipage = multipage($db->countTotal($tbName,$where,$listJoinTable),$ipp,$page,'m-'.$index.$smu,array('< Prev','Next >')); if($haveCate) { $CATE = array(); /*************** lang = 3 *****************/ if($lang3) { $getCateNameSql = ", (SELECT cate_name FROM {$tbName}_cate WHERE cate_id={$dbPrefix}_cate AND cate_lang='en') as cateName"; $db->query("SELECT * FROM {$tbName}_cate WHERE cate_lang='en'"); } else { /*************** lang = 1 *****************/ $getCateNameSql = ", (SELECT cate_name FROM {$tbName}_cate WHERE cate_id={$dbPrefix}_cate) as cateName"; $db->query("SELECT * FROM {$tbName}_cate"); } /*************** ******** *****************/ while($c = $db->fetchArray()) { $c['name'] = $c['cate_name']; $CATE[] = $c; } $cateOption = ''; foreach(_findChildren($CATE, 0) as $c) { getCateOption($c,0); } // ********************** Get Cate *********************** // } $sql = "SELECT t.* $getCateNameSql $getMoreField FROM $tbName t $listJoinTable ".($where ? 'WHERE '.$where : '')." ORDER BY $orderBy LIMIT $start, $ipp"; $db->query($sql); if($_GET['debug']==true) { $db->showErr = true; echo $sql; } $list = array(); $listHeader = ''; while($data = $db->fetchArray()) { if($showListByBox) { if(file_exists('../'.img_path($data['aPath'],'thumb'))) { $fPath = img_path($data[aPath],'thumb'); } else { $fPath = $a[a_path]; } $list[] = '
'.$data[$dbPrefix.'_title'].'
'; } else { if(!$listHeader) { $getTr = true; } else { $getTr = false; } $thislist = ''; if(is_array($showFieldInList) && count($showFieldInList)>0) { foreach($showFieldInList as $sf) { $data['cacheShowField'][$sf[1]] = ''.$data[$sf[1]].''; if($getTr) { $data['listHeader'][$sf[1]] = ''.$sf[0].''; } } } foreach($aryFld as $af) { if($af['showInList']) { $data['cacheShowField'][$af['Name']] = ''.($af['option'] ? showOption($af['option'],$data[$af['Name']]) : $data[$af['Name']]).''; if($getTr) { $data['listHeader'][$af['Name']] = ''.$af['lbl'].''; } } } if(is_array($showFieldOrder) && count($showFieldOrder)>0) { foreach($showFieldOrder as $sf) { $thislist .= $data['cacheShowField'][$sf]; if($getTr) { $listHeader .= $data['listHeader'][$sf]; } } } else { foreach($data['cacheShowField'] as $key => $sf) { $thislist .= $sf; if($getTr) { $listHeader .= $data['listHeader'][$key]; } } } /* // show in home radio buttons $thislist .= '
'.(($data[news_home]=='1') ? 'Sort ID: '.$data[news_hm_sort_id] : '' ).'
'; */ if($allowSorting) { $thislist .= ''; if($getTr) { $listHeader2 .= 'Sort ID'; } } if($showView) { $thislist .= ''; } $thislist .= $noEdit ? '' : ''; $thislist .= $noDel ? '' : ''; $thislist .= ''; $list[] = $thislist; } } ?>
Add
No '.($keyword ? 'Match ' : '').'Record was found.')?>
Show in Home?'; echo $listHeader2; if($showView) { echo ''; } echo $noEdit ? '' : ''; echo $noDel ? '' : ''; } else { echo ''; } ?> 0 ? echoLoop($list) : '
ViewEditDelete'.$cmsName.' List
No '.($keyword ? 'Match ' : '').'Record was found.')?>