diff options
author | M.Gergo | 2020-10-28 11:35:04 +0100 |
---|---|---|
committer | M.Gergo | 2020-10-28 11:35:04 +0100 |
commit | c279e479aa9c943fd0fc2b396638a5208c78cfb9 (patch) | |
tree | 934606a81b5facced41a555ccfd606f2ab56c195 /mayor-orig/mayor-portal/www/include | |
parent | a5ac3d0ab4015ed2683706cd0677ce6ce159f0ed (diff) | |
download | mayor-c279e479aa9c943fd0fc2b396638a5208c78cfb9.tar.gz mayor-c279e479aa9c943fd0fc2b396638a5208c78cfb9.zip |
Rev: 4695rev4695
Diffstat (limited to 'mayor-orig/mayor-portal/www/include')
-rw-r--r-- | mayor-orig/mayor-portal/www/include/modules/portal/hirek/egyhir.php | 9 | ||||
-rw-r--r-- | mayor-orig/mayor-portal/www/include/modules/portal/share/hirek.php | 2 |
2 files changed, 9 insertions, 2 deletions
diff --git a/mayor-orig/mayor-portal/www/include/modules/portal/hirek/egyhir.php b/mayor-orig/mayor-portal/www/include/modules/portal/hirek/egyhir.php index c93a81bd..1c5c8bc9 100644 --- a/mayor-orig/mayor-portal/www/include/modules/portal/hirek/egyhir.php +++ b/mayor-orig/mayor-portal/www/include/modules/portal/hirek/egyhir.php @@ -13,7 +13,7 @@ $flag = intval($DATA['flag']); $class = intval($DATA['class']); $lang = (in_array($DATA['lang'],$LANGUAGES)) ? $DATA['lang'] : _DEFAULT_LANG; - if ($DATA['cid']>0) $cid = $DATA['cid']; + if ($DATA['cid']>0) $cid = $DATA['cid']; // -- TODO!!!! $csoport = $DATA['csoport']; if ($hirId!='' && __HIREKADMIN == false ) { $q = "SELECT owner FROM hirek WHERE owner='%s'"; @@ -41,6 +41,13 @@ } } else $q = ''; if ($q!='') $r = db_query($q,array('modul'=>'portal','result'=>'insert','values'=>$v)); + if (is_array($DATA['kategoriaId'])) { + for ($i=0; $i<count($DATA['kategoriaId']); $i++) { + $q = "INSERT IGNORE INTO `hirKategoria` (hirId,kategoriaId) VALUES (%u,%u)"; + $v = array($hirId,$DATA['kategoriaId'][$i]); + db_query($q,array('modul'=>'portal','result'=>'insert','values'=>$v)); + } + } return $r; } diff --git a/mayor-orig/mayor-portal/www/include/modules/portal/share/hirek.php b/mayor-orig/mayor-portal/www/include/modules/portal/share/hirek.php index d7db431e..0de316b6 100644 --- a/mayor-orig/mayor-portal/www/include/modules/portal/share/hirek.php +++ b/mayor-orig/mayor-portal/www/include/modules/portal/share/hirek.php @@ -42,7 +42,7 @@ } else $WHERE = ''; if ($SET['all']===true) $WHERE = ''; - $q = "SELECT * FROM hirek $WHERE ORDER BY kdt DESC,vdt DESC".$L; + $q = "SELECT hirek.*, hirek.id AS hirId, GROUP_CONCAT(kategoriaId) AS hirkategoriak FROM hirek LEFT JOIN hirKategoria ON (hirek.id=hirId) $WHERE GROUP BY hirek.id ORDER BY kdt DESC,vdt DESC".$L; $HIREK['szovegek'] = db_query($q, array('modul'=>'portal','result'=>'indexed')); return $HIREK; } |