function Forum_Subscription_Get_User($topic = 0, $full = true, $ignore_user_id = 0) { global $db; $users = array(); if ($topic > 0) { $mdb = $db->Select('forum_subscription', "`topic`='{$topic}'"); if ($db->NumRows() > 0) { foreach ($mdb as $m_user) { $usr = SafeDb($m_user['user'], 11, int); if ($usr != $ignore_user_id) { if ($full) { $usr = GetUserInfo(SafeDb($m_user['user'], 11, int)); } $users[] = $usr; } } } } $users = array_unique($users); return $users; }
function AdminFdbAdminGenTableMenu($name) { global $action; // Добавляем в меню список таблиц и выбраннную таблицу System::admin()->BreadCrumbAdd('Список таблиц', 'exe=dbadmin&a=main'); $num_rows = 0; $tables = System::database()->GetTableInfo(); SortArray($tables, 'name'); $prefs = strpos($name, '_'); if ($prefs !== false) { $pref = substr($name, 0, $prefs); // Выводим сначала таблицы с префиксом foreach ($tables as $table) { $n = SafeDb($table['name'], 255, str); if (substr($n, 0, $prefs) == $pref) { System::admin()->BreadCrumbMenuItem($n, 'exe=dbadmin&a=structure&name=' . $n); } if ($n == $name) { $num_rows = SafeDB($table['num_rows'], 11, int); } } System::admin()->BreadCrumbMenuDelimiter(); foreach ($tables as $table) { $n = SafeDb($table['name'], 255, str); if (substr($n, 0, $prefs) != $pref) { System::admin()->BreadCrumbMenuItem($n, 'exe=dbadmin&a=structure&name=' . $n); } if ($n == $name) { $num_rows = SafeDB($table['num_rows'], 11, int); } } } else { foreach ($tables as $table) { $n = SafeDb($table['name'], 255, str); System::admin()->BreadCrumbMenuItem($n, 'exe=dbadmin&a=structure&name=' . $n); if ($n == $name) { $num_rows = SafeDB($table['num_rows'], 11, int); } } } System::admin()->BreadCrumbAdd($name, 'exe=dbadmin&a=main'); System::admin()->SideBarAddMenuItem('Структура таблицы', 'exe=dbadmin&a=structure&name=' . $name, 'structure'); System::admin()->SideBarAddMenuItem('Обзор записей (' . $num_rows . ')', 'exe=dbadmin&a=review&name=' . $name, 'review'); System::admin()->SideBarAddMenuItem('Добавить запись', 'exe=dbadmin&a=insert&name=' . $name, 'insert'); System::admin()->SideBarAddMenuItem('Редактировать структуру', 'exe=dbadmin&a=edittable&name=' . $name, 'edittable'); System::admin()->SideBarAddMenuItem('Очистить таблицу', 'exe=dbadmin&a=truncatetable&name=' . $name, 'truncatetable'); System::admin()->SideBarAddMenuItem('Удалить таблицу', 'exe=dbadmin&a=droptable&name=' . $name, 'droptable'); System::admin()->SideBarAddMenuBlock('Таблица "' . $_GET['name'] . '"', $action); }
<th>' . System::admin()->Link('Таблица', ADMIN_FILE . '?exe=dbadmin&sort=name' . ($sort == 'name' && !$sort_dec ? '&dec=1' : ''), 'Сортировать') . '</th> <th>' . System::admin()->Link('Записей', ADMIN_FILE . '?exe=dbadmin&sort=num_rows' . ($sort == 'num_rows' && !$sort_dec ? '&dec=1' : ''), 'Сортировать') . '</th> <th>' . System::admin()->Link('Размер', ADMIN_FILE . '?exe=dbadmin&sort=size' . ($sort == 'size' && !$sort_dec ? '&dec=1' : ''), 'Сортировать') . '</th> <th>Тип</th> <th>Действия</th> </tr>'; $totalsize = 0; $totalrows = 0; $light = array(); $i = 0; foreach ($tables as $r) { $i++; $name = SafeDb($r['name'], 255, str); $a = ''; if ($sort == 'name') { $F = SafeDb($r['name'], 1, str); if (!isset($light[$F])) { $light[$F] = $F; $a = '<span style="float:right; font-size:18px; margin-right:10px;"><b>' . strtoupper($F) . '</b></span>'; } } $func = SpeedButton('PHP код для создания', ADMIN_FILE . '?exe=dbadmin&a=viewtablecode&name=' . $name, 'images/admin/php.png'); $func .= SpeedButton('Переименовать', ADMIN_FILE . '?exe=dbadmin&a=renametable&name=' . $name, 'images/admin/rename.png'); if ($last_backup_name != '') { $func .= System::admin()->SpeedConfirm('Восстановить из последней резервной копии', ADMIN_FILE . '?exe=dbadmin&a=backup_restore&name=' . $last_backup_name . '&table=' . $name, 'images/admin/restore.png', 'Все текущие данные будут затёрты. Восстановить таблицу из последней резервной копии БД?'); } $func .= System::admin()->SpeedConfirm('Удалить', ADMIN_FILE . '?exe=dbadmin&a=droptable&name=' . $name . '&ok=0', 'images/admin/delete.png', 'Удалить таблицу?'); $text .= '<tr>' . '<td style="text-align:left; padding-left:10px;">' . $i . $a . '</td>' . '<td align="left" style="text-align:left; padding-left:10px;"><b>' . System::admin()->Link($name, ADMIN_FILE . '?exe=dbadmin&a=structure&name=' . $name) . '</b></td>' . '<td>' . $r['num_rows'] . '</td>' . '<td>' . FormatFileSize($r['size']) . '</td>' . '<td>' . (isset($r['type']) ? $r['type'] : 'По умолчанию') . '</td>' . '<td class="cfgtd">' . $func . '</td>' . '</tr>'; $totalsize += $r['size']; $totalrows += $r['num_rows']; System::admin()->BreadCrumbMenuItem($name, 'exe=dbadmin&a=structure&name=' . $name);