0) {
$html = $this->AdminIcons();
} else {
$html = $this->RenderDashboard();
}
echo $html;
}
private function RenderDashboard() {
global $members, $forum, $download, $news, $articles, $weblinks, $photos,
$global_comments, $global_ratings, $global_submissions, $global_infusions, $link_type, $submit_data, $comments_type, $infusions_count;
$locale = fusion_get_locale();
$aidlink = fusion_get_aidlink();
$settings = fusion_get_settings();
$html = '';
$html .= fusion_get_function('opentable', $locale['250'], '', FALSE);
$grid = ['mobile' => 12, 'tablet' => 6, 'laptop' => 3, 'desktop' => 3];
$panels = [
'registered' => ['link' => '', 'title' => $locale['251'], 'bg' => 'green', 'icon' => 'users'],
'cancelled' => ['link' => 'status=5', 'title' => $locale['263'], 'bg' => 'yellow', 'icon' => 'user-times'],
'unactivated' => ['link' => 'status=2', 'title' => $locale['252'], 'bg' => 'aqua', 'icon' => 'user-secret'],
'security_ban' => ['link' => 'status=4', 'title' => $locale['253'], 'bg' => 'red', 'icon' => 'user-slash']
];
$html .= '
';
foreach ($panels as $panel => $block) {
$block['link'] = empty($block['link']) ? $block['link'] : '&'.$block['link'];
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
'.number_format($members[$panel]).'
';
$html .= '
'.$block['title'].'
';
$html .= '
';
$html .= '
';
$content = '';
$html .= checkrights('M') ? $content : '';
$html .= '
';
$html .= '
';
}
$html .= '
';
$grid = ['mobile' => 12, 'tablet' => 6, 'laptop' => 6, 'desktop' => 4];
$html .= '';
$modules = [];
if (defined('FORUM_EXIST')) {
$modules['forum'] = [
'title' => $locale['265'],
'icon' => 'fa fa-comments',
'stats' => [
['title' => $locale['265'], 'count' => $forum['count']],
['title' => $locale['256'], 'count' => $forum['thread']],
['title' => $locale['259'], 'count' => $forum['post']],
['title' => $locale['260'], 'count' => $forum['users']]
]
];
}
if (defined('DOWNLOADS_EXIST')) {
$modules['downloads'] = [
'title' => $locale['268'],
'icon' => 'fa fa-cloud-download',
'stats' => [
['title' => $locale['268'], 'count' => $download['download']],
['title' => $locale['257'], 'count' => $download['comment']],
['title' => $locale['254'], 'count' => $download['submit']]
]
];
}
if (defined('NEWS_EXIST')) {
$modules['news'] = [
'title' => $locale['269'],
'icon' => 'fa fa-newspaper-o',
'stats' => [
['title' => $locale['269'], 'count' => $news['news']],
['title' => $locale['257'], 'count' => $news['comment']],
['title' => $locale['254'], 'count' => $news['submit']]
]
];
}
if (defined('ARTICLES_EXIST')) {
$modules['articles'] = [
'title' => $locale['270'],
'icon' => 'fa fa-book',
'stats' => [
['title' => $locale['270'], 'count' => $articles['article']],
['title' => $locale['257'], 'count' => $articles['comment']],
['title' => $locale['254'], 'count' => $articles['submit']]
]
];
}
if (defined('WEBLINKS_EXIST')) {
$modules['weblinks'] = [
'title' => $locale['271'],
'icon' => 'fa fa-link',
'stats' => [
['title' => $locale['271'], 'count' => $weblinks['weblink']],
['title' => $locale['254'], 'count' => $weblinks['submit']]
]
];
}
if (defined('GALLERY_EXIST')) {
$modules['gallery'] = [
'title' => $locale['272'],
'icon' => 'fa fa-camera-retro',
'stats' => [
['title' => $locale['261'], 'count' => $photos['photo']],
['title' => $locale['257'], 'count' => $photos['comment']],
['title' => $locale['254'], 'count' => $photos['submit']]
]
];
}
if (!empty($modules)) {
foreach ($modules as $name => $module) {
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
';
$html .= '
'.$module['title'].' '.$locale['258'].'';
if (!empty($module['stats'])) {
foreach ($module['stats'] as $stat) {
$html .= '
';
$html .= ''.$stat['title'].'
';
$html .= '
'.number_format($stat['count']).'
';
$html .= '';
}
}
$html .= '
';
$html .= '
';
$html .= '
';
}
}
$html .= '
';
$html .= '';
$html .= '
';
if ($settings['comments_enabled'] == 1) {
$html .= ''; // #comments
}
if ($settings['ratings_enabled'] == 1) {
$html .= '
';
$html .= fusion_get_function('openside', '
'.$locale['278'].''.number_format($global_ratings['rows']).'');
if (count($global_ratings['data']) > 0) {
foreach ($global_ratings['data'] as $i => $ratings_data) {
if (isset($link_type[$ratings_data['rating_type']]) && isset($comments_type[$ratings_data['rating_type']])) {
$html .= '
0 ? ' style="border-top: 1px solid #ddd;"' : '').'>';
$html .= '
'.display_avatar($ratings_data, '25px', '', FALSE, 'img-circle m-r-5').'
';
$html .= '
'.profile_link($ratings_data['user_id'], $ratings_data['user_name'], $ratings_data['user_status']).' ';
$html .= $locale['273a'].'
'.$comments_type[$ratings_data['rating_type']].' ';
$html .= timer($ratings_data['rating_datestamp']);
$html .= '
'.str_repeat('', $ratings_data['rating_vote']).'';
$html .= '
';
}
}
if (isset($global_ratings['ratings_nav'])) {
$html .= '
';
$html .= ''.$global_ratings['ratings_nav'].'';
$html .= '
';
}
} else {
$html .= '
'.$global_ratings['nodata'].'
';
}
$html .= fusion_get_function('closeside', '');
$html .= '
'; // #ratings
}
$html .= '
';
$html .= fusion_get_function('openside', '
'.$locale['279'].''.number_format($global_submissions['rows']).'');
if (count($global_submissions['data']) > 0) {
foreach ($global_submissions['data'] as $i => $submit_date) {
if (isset($submit_data[$submit_date['submit_type']])) {
$review_link = sprintf($submit_data[$submit_date['submit_type']]['admin_link'], $submit_date['submit_id']);
$html .= '
0 ? ' style="border-top: 1px solid #ddd;"' : '').'>';
$html .= '
'.display_avatar($submit_date, '25px', '', FALSE, 'img-circle m-r-5').'
';
$html .= '
'.profile_link($submit_date['user_id'], $submit_date['user_name'], $submit_date['user_status']).' ';
$html .= $locale['273b'].'
'.$submit_data[$submit_date['submit_type']]['submit_locale'].' ';
$html .= timer($submit_date['submit_datestamp']);
if (!empty($review_link)) {
$html .= '
'.$locale['286'].'';
}
$html .= '
';
}
}
if (isset($global_submissions['submissions_nav'])) {
$html .= '
';
$html .= ''.$global_submissions['submissions_nav'].'';
$html .= '
';
}
} else {
$html .= '
'.$global_submissions['nodata'].'
';
}
$html .= fusion_get_function('closeside', '');
$html .= '
'; // #submissions
$html .= '
';
$html .= '
';
$html .= '
';
$html .= fusion_get_function('openside', '
'.$locale['283'].''.number_format((int)$infusions_count).'');
$content = '';
$bg_colors = ['gray', 'red', 'yellow', 'aqua', 'blue', 'light-blue', 'green', 'navy', 'teal', 'olive', 'orange', 'fuschia', 'purple', 'maroon', ''];
if ($infusions_count > 0) {
if (!empty($global_infusions)) {
foreach ($global_infusions as $inf_id => $inf_data) {
$color = array_rand($bg_colors);
$html .= '
'.$inf_data['inf_title'].'';
}
}
$content = checkrights('I') ? '
' : '';
} else {
$html .= '
'.$locale['284'].'
';
}
$html .= fusion_get_function('closeside', $content);
$html .= '
'; // #infusins
$html .= '
';
$html .= '
'; // .row
$html .= fusion_get_function('closetable', FALSE);
return $html;
}
private function AdminIcons() {
global $admin_icons;
$locale = fusion_get_locale();
$aidlink = fusion_get_aidlink();
$admin_title = str_replace('[SITENAME]', fusion_get_settings('sitename'), $locale['200']);
$admin_title = !empty($locale['200a']) ? $locale['200a'] : $admin_title;
$html = fusion_get_function('opentable', $admin_title);
$html .= '';
if (count($admin_icons['data']) > 0) {
foreach ($admin_icons['data'] as $data) {
$html .= '
';
}
}
$html .= '
';
$html .= fusion_get_function('closetable');
return $html;
}
}
'; $comment = trimlink(strip_tags(parse_textarea($comment_data['comment_message'], FALSE, TRUE)), 130); $html .= ''.parse_textarea($comment, TRUE, FALSE).''; $html .= '