diff options
author | tuscanhobbit <tuscanhobbit@users.noreply.github.com> | 2014-09-22 22:44:10 +0200 |
---|---|---|
committer | tuscanhobbit <tuscanhobbit@users.noreply.github.com> | 2014-09-22 22:44:10 +0200 |
commit | 6a9e8fcd20c0101d448061fdbf51034ab456d2c3 (patch) | |
tree | 08e4a6d051636b90a98a6889a0b677a7d7049982 /include/menu.php | |
parent | ed7f3001c1c1deec5076ae12114e5c42865b6251 (diff) | |
parent | 2070dbfdeace4a902208e9dfb50d950647142e99 (diff) | |
download | volse-hubzilla-6a9e8fcd20c0101d448061fdbf51034ab456d2c3.tar.gz volse-hubzilla-6a9e8fcd20c0101d448061fdbf51034ab456d2c3.tar.bz2 volse-hubzilla-6a9e8fcd20c0101d448061fdbf51034ab456d2c3.zip |
Merge from upstream
Diffstat (limited to 'include/menu.php')
-rw-r--r-- | include/menu.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/menu.php b/include/menu.php index 4b0a11f10..8997d2e39 100644 --- a/include/menu.php +++ b/include/menu.php @@ -124,7 +124,17 @@ function menu_list($channel_id, $name = '', $flags = 0) { return $r; } +function menu_list_count($channel_id, $name = '', $flags = 0) { + $sel_options = ''; + $sel_options .= (($name) ? " and menu_name = '" . protect_sprintf(dbesc($name)) . "' " : ''); + $sel_options .= (($flags) ? " and menu_flags = " . intval($flags) . " " : ''); + + $r = q("select count(*) as total from menu where menu_channel_id = %d $sel_options", + intval($channel_id) + ); + return $r[0]['total']; +} function menu_edit($arr) { |