1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00
This commit is contained in:
Daniel Neto 2023-05-15 14:47:07 -03:00
parent 7f31a842c8
commit b79bb1980a
3 changed files with 8 additions and 4 deletions

View file

@ -79,6 +79,9 @@ class Menu extends ObjectYPT {
static function getAllActive($type=false) {
global $global;
if(empty($global)){
$global = [];
}
$sql = "SELECT * FROM ".static::getTableName()." WHERE status = 'active' ";
if(!empty($type)){
$sql .= " AND type = $type ";

View file

@ -18,6 +18,9 @@ class MenuItem extends ObjectYPT {
static function getAllFromMenu($menu_id, $activeOnly = false, $sort = true) {
global $global;
if(empty($global)){
$global = [];
}
$menu_id = intval($menu_id);
if (empty($menu_id)) {
return false;
@ -54,9 +57,7 @@ class MenuItem extends ObjectYPT {
}
$rows[] = $row;
}
} else {
die($sql . '\nError : (' . $global['mysqli']->errno . ') ' . $global['mysqli']->error);
}
}
return $rows;
}