user_id) { $hentai_toggle = max(0, min(2, $_COOKIE['mangadex_h_toggle'] ?? 0)); if($type == "follows"){ return "
  • " . display_fa_icon("rss", "RSS", "fa-2x", "fas") . '
  • '; } else if($type == "group_mini"){ return "" . display_fa_icon('rss-square', 'RSS', 'fa-lg') . ""; } else{ return ""; } } else return ""; } function display_short_title($array, $white = '', $truncate = '') { if (!$array['volume'] && $array['chapter'] == '' && in_array($array['title'], ['Oneshot', ''])) $title = "Oneshot"; elseif (!$array['volume'] && $array['chapter'] == '') $title = $array['title']; else $title = ($array['volume'] ? "Vol. {$array['volume']} " : '') . ($array['chapter'] != '' ? "Chapter {$array['chapter']}" : ''); return "$title"; } function display_reading_history($user) { $return = ''; if ($user->user_id) { $chapter_history = $user->get_reading_history(); if ($chapter_history) { $return .= ""; } else $return = "

    Go and read a chapter!

    "; } else $return = display_alert('info m-2', 'Notice', "Please " . display_fa_icon('sign-in-alt') . " log in to view your reading history."); return $return; } function display_latest_posts($array) { global $parser; $return = ""; return $return; } function display_latest_comments($array, $type = '') { global $parser; $return = ""; return $return; } function display_latest_updates($array, $mode) { if ($array) { if (!$mode) { $return = "
    "; foreach ($array as $manga) { $has_end_tag = ($manga['manga_last_volume'] === null || ($manga['manga_last_volume'] == $manga['volume'])) && $manga['manga_last_chapter'] && $manga['manga_last_chapter'] == $manga['chapter']; $return .= "
    " . display_fa_icon('book', '', 'mr-1') . "
    " . display_manga_link_v2($manga) . "
    " . display_fa_icon('file', '', 'col-auto mr-1', 'far') . display_short_title($manga, '', 'truncate') . ($has_end_tag ? "
    END
    " : '') . ($manga["available"] == 0 ? display_fa_icon('file-excel', 'Unavailable', 'mx-1', 'fas') : '') . "
    " . display_lang_flag_v3($manga) . "
    " . "
    " . display_fa_icon('users') . ' ' . display_group_link_v2($manga) . "
    " . display_fa_icon('clock', '', '', 'far') . ' ' . get_time_ago($manga['upload_timestamp']) . "
    "; } $return .= "
    "; } else { $i = 0; $last_manga_id_array = []; foreach ($array as $chapter) { if (!in_array($chapter['manga_id'], $last_manga_id_array)) { $manga_array[$i] = [ 'manga_id' => $chapter['manga_id'], 'manga_name' => $chapter['manga_name'], 'manga_hentai' => $chapter['manga_hentai'], ]; $last_manga_id_array[] = $chapter['manga_id']; $i++; } $chapter_array[$chapter['manga_id']][$chapter['chapter_id']] = [ 'chapter_id' => $chapter['chapter_id'], 'lang_name' => $chapter['lang_name'], 'lang_flag' => $chapter['lang_flag'], 'level_colour' => $chapter['level_colour'], 'username' => $chapter['username'], 'group_name' => $chapter['group_name'], 'group_id' => $chapter['group_id'], 'group_name_2' => $chapter['group_name_2'], 'group_id_2' => $chapter['group_id_2'], 'group_name_3' => $chapter['group_name_3'], 'group_id_3' => $chapter['group_id_3'], 'upload_timestamp' => $chapter['upload_timestamp'], 'volume' => $chapter['volume'], 'chapter' => $chapter['chapter'], 'title' => $chapter['title'], 'manga_last_volume' => $chapter['manga_last_volume'], 'manga_last_chapter' => $chapter['manga_last_chapter'], 'available' => $chapter['available'], ]; } $return = "
    "; for ($j = 0; $j < min(20, count($manga_array)); $j++) { $manga_id = $manga_array[$j]['manga_id']; $manga = $chapter_array[$manga_id]; //$bookmark = ($user->user_id && in_array($manga_id, $followed_manga_array)) ? display_fa_icon("bookmark", "Following", "text-success") : ""; $rowspan = (count($manga) >= 4 ? 5 : count($manga) + 1); $return .= ""; $i = 1; foreach ($manga as $chapter_id => $chapter) { if ($i < 5) { $i++; //$key = ($user->user_id) ? array_search($chapter_id, $read_chapter_array["chapter_id"]) : ""; //$read = ($user->user_id && in_array($chapter_id, $read_chapter_array["chapter_id"])) ? display_fa_icon("eye", "fas", "Read " . get_time_ago($read_chapter_array["timestamp"][$key]), "fa-fw") : ""; $has_end_tag = ($chapter['manga_last_volume'] === null || ($chapter['manga_last_volume'] == $chapter['volume'])) && $chapter['manga_last_chapter'] && $chapter['manga_last_chapter'] == $chapter['chapter']; $return .= ""; } } } $return .= "
    " . display_fa_icon('globe', 'Language') . " " . display_fa_icon('users', 'Group') . " " . display_fa_icon('clock', 'Uploaded', '', 'far') . "
    " . display_fa_icon('book', 'Title') . ' ' . display_manga_link_v2($manga_array[$j]) . "
    " . display_fa_icon('file', '', '', 'far') . " " . display_short_title($chapter) . "" . ($has_end_tag ? ' END' : '') . ($chapter["available"] == 0 ? display_fa_icon('file-excel', 'Unavailable', 'mx-1', 'fas') : '') ." " . display_lang_flag_v3($chapter) . " " . display_group_link_v2($chapter) . "
    "; } } else $return = display_alert('info m-2', 'Notice', "No updates!"); return $return; } function display_top_list($array, $type = '', $count = 10) { $return = ""; return $return; } function display_group_banner($group, $style) { if ($group->group_banner) return "Group banner"; else return "Default Group image"; } function display_carousel_js($id, $autoplay = 'true') { return " $('#{$id}_owl_carousel').owlCarousel({ loop: true, margin: 10, dots: false, lazyLoad: true, autoplay: $autoplay, autoplayHoverPause: true, responsive:{ 0: { items:2 }, 500: { items:3 }, 768: { items:4 }, 992: { items:5 }, 1440: { items:8 } } }); $('#{$id}_owl_stop').click(function() { $('#{$id}_owl_carousel').trigger('stop.owl.autoplay'); $('#{$id}_owl_play').show(); $('#{$id}_owl_stop').hide(); }); $('#{$id}_owl_play').click(function() { $('#{$id}_owl_carousel').trigger('play.owl.autoplay'); $('#{$id}_owl_stop').show(); $('#{$id}_owl_play').hide(); }); $('#{$id}_owl_next').click(function() { $('#{$id}_owl_carousel').trigger('next.owl.carousel'); }); $('#{$id}_owl_prev').click(function() { $('#{$id}_owl_carousel').trigger('prev.owl.carousel'); }); "; } function display_carousel(array $array, $name, $id) { $return = "

    $name

    "; return $return; } function display_chapter_title($chapter, $icon = 0, $truncate=true) { if (is_array($chapter)) $chapter = (object) $chapter; if (!$chapter->volume && $chapter->chapter == '' && in_array($chapter->title, ['Oneshot', ''])) $return = " Oneshot"; elseif ($chapter->title == '') $return = " " . ($chapter->volume ? "Vol. $chapter->volume " : '') . ($chapter->chapter != '' ? "Ch. $chapter->chapter" : '') . ""; else $return = " " . ($chapter->volume ? "Vol. $chapter->volume " : '') . ($chapter->chapter != '' ? "Ch. $chapter->chapter " : '') . " " . (!$chapter->volume && $chapter->chapter == '' ? '' : '- ') . "$chapter->title"; if ($icon) return display_fa_icon('file', '', '', 'far') . $return; else return $return; } function display_post_link($post) { return "$post->thread_name"; } function display_languages_select($selected_lang_id_array = []) { global $languages; $return = ''; foreach ($languages as $lang_id => $language) { $selected = in_array($lang_id, $selected_lang_id_array) ? 'selected' : ''; $return .= ""; } return $return; } function display_count_comments($count, $type = '', $id = 0, $name = '') { if ($count) { if ($type) return "" . display_fa_icon('comments', '', '', 'far') . " " . number_format($count) . ""; else return "" . number_format($count) . ""; } } function display_edit_manga_ext_link($type, $link_id) { $return = "
    "; return $return; } function display_manga_ext_links($links_array) { $links_array = (array)$links_array; if ($links_array) { $links_order = [ 'Official' => ['raw', 'engtl'], 'Retail' => ['amz', 'bw', 'cdj', 'ebj'], 'Information' => ['mu', 'nu', 'ap', 'al', 'kt', 'mal', 'dj'] ]; $return = ''; foreach ($links_order as $category => $types) { $tmp = []; foreach ($types as $_l) { if (!isset($links_array[$_l])) continue; $tmp[$_l] = $links_array[$_l]; } $cat_array = $tmp; if ($cat_array) { $return .= "
    $category:
    "; } } return $return; } } function display_js_posting() { return " $('.bbcode').click(function(){ var textarea = $(this).parent().parent().next().next().children().children(); var code = $(this).attr('title'); var start = textarea.prop('selectionStart'); var end = textarea.prop('selectionEnd'); var v = textarea.val(); var textBefore = v.substring(0, start); var textAfter = v.substring(end, v.length); if (start === end) { textarea.val(textBefore + '[' + code + '][/' + code + ']' + textAfter); } else { var textSelected = v.substring(start, end); textarea.val(textBefore + '[' + code + ']' + textSelected + '[/' + code + ']' + textAfter); } }); $('.emoji').click(function(){ var textarea = $(this).parent().parent().next().children().children(); var cursorPos = textarea.prop('selectionStart'); var v = textarea.val(); var textBefore = v.substring(0, cursorPos); var textAfter = v.substring(cursorPos, v.length); textarea.val(textBefore + $(this).val() + textAfter); }); "; } function display_edit_manga_relation_entry($array = ['relation_id' => '', 'related_manga_id' => '', 'manga_name' => '']) { global $relation_types; $return = "
    "; return $return; } function display_manga_relations($manga_relations) { global $hentai_toggle, $relation_types; if ($manga_relations) { $return = "
    Related:
    "; return $return; } } function display_bbcode_textarea($post_text = "") { $return = "
    "; foreach (BBCODE as $glyph => $text) { $return .= ""; } $return .= "
    "; return $return; } function display_forum($forum, $user) { if (validate_level($user, $forum->view_level)) { $return = "
    forum_name) . ".svg' width='70px' >
    $forum->forum_name

    $forum->forum_description

    " . number_format($forum->total_threads) . " threads

    " . number_format($forum->total_posts) . " posts

    " . ($forum->last_post_timestamp ? "

    " . get_time_ago($forum->last_post_timestamp) . " by " . display_user_link($forum->last_post_user_id, $forum->username, $forum->level_colour, $forum->show_premium_badge, $forum->show_md_at_home_badge) . "

    in $forum->thread_name

    " : "") . "
    "; if ($forum->subforum_ids) { $subforum_ids = explode(',', $forum->subforum_ids); $subforum_names = explode(',', $forum->subforum_names); $return .= "
    Subforums: "; foreach(array_combine($subforum_ids, $subforum_names) as $key => $value) { $return .= "$value, "; } $return = rtrim($return, ', '); $return .= "
    "; } return $return; } } function display_edit_post_v2($post, $user) { if (validate_level($user, 'pr') || $post->user_id == $user->user_id) { return " " . display_avatar($post->avatar, $post->user_id) . "
    " . display_bbcode_textarea($post->text) . "
    "; } } function display_post_v2($post, $html, $user, $page = '') { $isModerated = isset($post->moderated) && $post->moderated; if ($isModerated && !$user->display_moderated) { return display_post_moderated($post, $user); } $posterIsStaff = isset($post->level_id) ? validate_level($post, 'pr') : false; $userIsStaff = validate_level($user, 'pr'); $userIsPoster = $post->user_id === $user->user_id; $editorIsPoster = $post->user_id === $post->edit_user_id; $userNote = array_key_exists($post->user_id, $user->notes) ? $user->notes[$post->user_id]['note'] : ''; $EDIT_GRACE_MINUTES = 5; $displayEditMessage = $post->edit_timestamp && (!$editorIsPoster || ($post->edit_timestamp > $post->timestamp + $EDIT_GRACE_MINUTES*60)); if (strpos($html,'@') !== false) { // We have a potential mention. parse the mentions out and see if any of those are for our $user $html = preg_replace(';(@);', '$1', $html); } $return = "
    " . display_user_link_v2($post, $userNote) . "
    " . ($posterIsStaff ? "{$post->level_name}" : '') . "
    " . display_avatar($post->avatar, $post->user_id) . " " . "
    " . display_fa_icon('user') . ' ' . display_user_link_v2($post, $userNote) . "
    " . (($page === 'message' && $post->user_id === $user->user_id && $post->seen) ? display_fa_icon('check') : '') . display_fa_icon('clock', '', '', 'far') . " " . ($page != 'message' ? "
    " : get_time_ago($post->timestamp)) . "". ($isModerated ? "" . display_fa_icon('comment-slash') . "" : '') . "
    " . nl2br(make_links_clickable($html)) . "
    " . ($displayEditMessage ? "
    Last edited " . get_time_ago($post->edit_timestamp) . " by " . display_user_link($post->edit_user_id, $post->editor_username, $post->editor_level_colour) . ".
    " : ""); if ($user->user_id && validate_level($user, 'member') && $page != 'message') { //not in PMs $return .= "
    "; // quoting isn't implemented yet //$return .= ""; if ($userIsPoster || $userIsStaff) { $return .= ""; } if (!$userIsPoster) { $return .= ""; } if ($userIsStaff) { $return .= ""; } $return .= "
    "; } $return .= ""; $return .= ""; return $return; } function display_post_blocked($post, $user) { $return = " This post is hidden because you blocked " . display_fa_icon('user') . " " . display_user_link_v2($post) . "." . "" . display_fa_icon('clock', '', '', 'far') . " " . "" . get_time_ago($post->timestamp) . ""; $return .= "
    "; $return .= ""; $return .= ""; return $return; } function display_post_moderated($post, $user) { $return = " " . display_fa_icon('clock', '', '', 'far') . " " . "" . get_time_ago($post->timestamp) . ""; if (validate_level($user, 'mod')) { $return .= ""; } $return .= "" . display_fa_icon('comment-slash') . " This post by " . display_user_link_v2($post) . " has been marked as moderated."; $return .= "
    "; return $return; } function display_manga_rating_button($user_id, $user_rating, $manga_id, $style = 0) { $return = "
    "; return $return; } function display_pagination_v2($paging, $type, $page, $string = "") { if ($paging['last_page'] == 1) $return = ""; elseif ($paging['current_page'] <= $paging['last_page']) { $return = "

    Showing " . number_format($paging['offset'] + 1) . " to " . number_format(min($paging['num_rows'], $paging['limit'] * $paging['current_page'])) . " of " . number_format($paging['num_rows']) . " $type

    "; } else $return = display_alert("warning", "Warning", "No results found."); return $return; } function display_pagination_forum($paging, $page, $id) { if ($paging['last_page'] == 1) $return = ''; elseif ($paging['current_page'] <= $paging['last_page']) { $return = " "; } else $return = ''; return $return; } function display_manga_link($manga_id, $manga_name, $manga_hentai, $trim = 1, $class = '') { if ($trim) return "" . mb_strimwidth($manga_name, 0, 40, "...") . "" . display_labels($manga_hentai); else return "$manga_name" . display_labels($manga_hentai); } function display_manga_link_v2($manga, $white = '', $hide_labels=false, $truncate=true) { if (is_array($manga)) $manga = (object) $manga; return "$manga->manga_name" . ( $hide_labels ? '' : display_labels($manga->manga_hentai)); } function display_group_link_v2($group) { if (is_array($group)) { $group['group_id_2'] = $group['group_id_2'] ?? 0; $group['group_id_3'] = $group['group_id_3'] ?? 0; $group = (object) $group; } $return = "$group->group_name"; if (isset($group->group_id_2) && $group->group_id_2 > 0) $return .= " | $group->group_name_2"; if (isset($group->group_id_3) && $group->group_id_3 > 0) $return .= " | $group->group_name_3"; return $return; } function display_user_link_v2($user, $note = '') { if (is_array($user)) $user = (object) $user; $levelClassname = str_replace(' ', '', ltrim(strtolower(preg_replace('/[A-Z]([A-Z](?![a-z]))*/', '_$0', $user->level_name ?? 'guest')), '_')); $string = "$user->username"; if ($user->show_premium_badge ?? false) $string .= " " . display_fa_icon('gem', 'Supporter', '', 'far') . ""; if ($user->show_md_at_home_badge ?? false) $string .= " " . display_fa_icon('network-wired', 'MD@H Host', '', 'fas' . ($user->show_md_at_home_badge == 2 ? ' text-warning' : '')) . ""; if ($user->is_thread_starter ?? false) $string .= " OP"; if ($note) $string .= " " . htmlspecialchars($note, ENT_QUOTES) . ""; return $string; } function display_user_link($user_id, $username, $level_colour, $show_badge = 0, $show_mah_badge = 0) { $string = $show_badge ? " " . display_fa_icon('gem', 'Supporter', '', 'far') . "" : ''; $string2 = $show_mah_badge ? " " . display_fa_icon('network-wired', 'MD@H Host', '', 'fas' . ($show_mah_badge == 2 ? ' text-warning' : '')) . "" : ''; return "$username" . $string . $string2; } function display_avatar($ext, $id, $limit = 1) { if ($ext) return "Avatar"; else { //$avatar = rand(0, 4); return "Avatar"; } } function display_list_banner($user, $style) { if ($user->list_banner) return "Banner"; else return "Banner"; } function jquery_get($name, $id, $button_glyph, $button_text, $button_text_alt, $success_msg, $after) { return " $('#{$name}_button').click(function(event) { var button = $(this) var buttonHtml = button.html() var successMsg = \"" . display_alert("success", "Success", $success_msg) . "\"; button.html(\"" . display_fa_icon('spinner', '', 'fa-pulse') . " $button_text_alt...\").attr('disabled', true); $.ajax({ url: '/ajax/actions.ajax.php?function=$name" . ($id ? "&id=$id" : "") . "', type: 'GET', cache: false, headers: {'cache-control': 'no-cache'}, contentType: false, processData: false, async: true, success: function (data) { if (!data) { $('#message_container').html(successMsg).show().delay(" . FADE_DURATION . ").fadeOut(); $after } else { $('#message_container').html(data).show().delay(" . FADE_DURATION . ").fadeOut(); } button.html(buttonHtml).attr('disabled', false); }, }); event.preventDefault(); }); "; } function jquery_post($name, $id, $button_glyph, $button_text, $button_text_alt, $success_msg, $after) { return " $('#{$name}_form').submit(function(event) { Array.prototype.slice.call(this.querySelectorAll('input[type=file]')) .filter(function(n) { return n && !n.files.length }) .forEach(function(n) { n.parentNode.removeChild(n) }); var button = $('#{$name}_button') var buttonHtml = button.html() var formData = new FormData(this); var success_msg = \"" . display_alert("success", "Success", $success_msg) . "\"; button.html(\"" . display_fa_icon('spinner', '', 'fa-pulse') . " $button_text_alt...\").attr('disabled', true); $.ajax({ url: '/ajax/actions.ajax.php?function=$name" . ($id ? "&id=$id" : "") . "', type: 'POST', data: formData, cache: false, headers: {'cache-control': 'no-cache'}, contentType: false, processData: false, async: true, success: function (data) { if (!data) { $('#message_container').html(success_msg).show().delay(" . FADE_DURATION . ").fadeOut(); $after } else { $('#message_container').html(data).show().delay(" . FADE_DURATION . ").fadeOut(); } button.html(buttonHtml).attr('disabled', false); }, }); event.preventDefault(); }); "; } function js_display_file_select($button = '') { return " $('.btn-file :file').on('fileselect', function(event, numFiles, label) { var input = $(this).parents('.input-group').find(':text'); log = numFiles > 1 ? numFiles + ' files selected' : label; if(input.length) input.val(log); else if(log) alert(log); " . ($button ? "$('$button').focus();" : "") . " });"; } function display_genres_checkboxes($grouped_genres, $selected_genres = [], $excluded_genres = [], $isTertiary = true, $useIndeterminate = false, $inputName = 'manga_genres[]') { if (!is_array($selected_genres)) { $selected_genres = explode(',', $selected_genres); } if (!is_array($excluded_genres)) { $excluded_genres = explode(',', $excluded_genres); } $return = ''; foreach ($grouped_genres AS $group => $genres) { $return .= "
    $group"; foreach ($genres AS $genre) { $id = $genre['id']; $name = $genre['name']; $classes = ($isTertiary ? 'tertiary ' : '') . ($useIndeterminate ? 'indeterminate-mark ' : ''); $chipClasses = $group === "Content" ? "badge-warning" : "badge-secondary"; $state = in_array($id, $excluded_genres) ? 2 : (in_array($id, $selected_genres) ? 1 : 0); $return .= "
    "; } $return .= "
    "; } return $return; } function display_genres_dropdown($grouped_genres, $selected_genres = [], $field_name = 'manga_genres') { if (!is_array($selected_genres)) { $selected_genres = explode(',', $selected_genres); } $return = " "; return $return; } function display_genres_checkboxes_search($genres) { $return = "
    "; foreach ($genres AS $id => $name) { $return .= "
    "; } $return .= "
    "; return $return; } function display_genres($genres, $genre_array) { $text = ""; foreach ($genre_array as $genre) { $text .= "" . $genres[$genre] . " "; } return $text; } function display_grouped_genres($grouped_genres, $genre_array) { $text = ""; $genre_array_grouped = []; foreach ($genre_array as $id) { $genre_array_grouped[$grouped_genres[$id]['group']][$id] = $grouped_genres[$id]['name']; } foreach ($genre_array_grouped as $group => $genres) { $text .= "
    $group
    "; foreach ($genres as $id => $genre) { $color = $group === 'Content' ? 'badge-warning' : 'badge-secondary'; $text .= "{$genre} "; } $text .= "
    "; } return $text; } function display_sort($page, $search, $sort, $type, $glyph, $string = '') { switch ($page) { case "users": $search_username = isset($search['username']) ? "/1/{$search['username']}" : ""; switch ($type) { case "username": if ($sort == 1) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 2) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Asc") . ""; break; case "uploads": if ($sort == 3) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 4) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; case "views": if ($sort == 5) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 6) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "level": if ($sort == 7) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 8) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; default: break; } case "groups": $search_group_name = isset($search['group_name']) ? "/1/{$search['group_name']}" : ""; switch ($type) { case "group_name": if ($sort == 1) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 2) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Asc") . ""; break; case "group_likes": if ($sort == 3) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 4) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "group_views": if ($sort == 5) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 6) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "group_follows": if ($sort == 7) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 8) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "group_comments": if ($sort == 9) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 10) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "group_last_updated": if ($sort == 11) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 12) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; default: break; } case "genre": case "list": case "titles": case "follows": case "group": case "user": switch ($type) { case "manga_last_updated": if ($sort == 0) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 1) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Asc") . ""; break; case "manga_name": if ($sort == 2) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 3) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Asc") . ""; break; case "manga_comments": if ($sort == 4) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 5) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "manga_rating": if ($sort == 6) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 7) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "manga_views": if ($sort == 8) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 9) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "manga_follows": if ($sort == 10) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 11) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; default: break; } case "search": switch ($type) { case "manga_last_updated": if ($sort == 0) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 1) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Asc") . ""; break; case "manga_name": if ($sort == 2) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 3) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Asc") . ""; break; case "manga_comments": if ($sort == 4) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 5) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "manga_rating": if ($sort == 6) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 7) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "manga_views": if ($sort == 8) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 9) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; case "manga_follows": if ($sort == 10) return "" . display_fa_icon("sort-$glyph-down", "Sort Desc") . ""; elseif ($sort == 11) return "" . display_fa_icon("sort-$glyph-up", "Sort Asc") . ""; else return "" . display_fa_icon("sort", "Sort Desc") . ""; break; default: break; } default: return; break; } } function display_active($get, $page_array) { if (in_array($get, $page_array)) return "active"; } function display_alert($type, $strong, $text) { return ""; } function display_lang_flag_v3($language, $div = 0) { if (is_array($language)) $language = (object) $language; $d_start = $div ? '
    ' : ''; $d_end = $div ? '
    ' : ''; return "$d_start$d_end"; } function display_send_message($user, $uploader) { if (validate_level($user, 'member')) { if ($user->user_id != $uploader->user_id) return "" . display_fa_icon('envelope', 'Send message') . " Send message"; } else return "" . display_fa_icon('envelope', 'Send message') . " Send message"; } function display_ban_user($user, $target_user) { if (!validate_level($target_user, 'admin')) { if (validate_level($target_user, 'validating')) return ""; else return ""; } } function display_edit_manga($user, $manga) { if (validate_level($user, 'contributor') && !$user->has_active_restriction(USER_RESTRICTION_EDIT_TITLES)) return ""; } function display_lock_manga($user, $manga) { if (validate_level($user, 'gmod')) { if ($manga->manga_locked) return ""; else return ""; } } function display_regenerate_manga_thumb($user) { if (validate_level($user, 'mod')) { return ""; } } function display_delete_manga($user) { if (validate_level($user, 'admin')) return ""; } function display_edit_group($user, $group, $group_member_array) { if (validate_level($user, 'gmod') || $group->group_leader_id == $user->user_id || in_array($user->username, $group_member_array)) return ""; } function display_delete_group($user) { if (validate_level($user, 'admin')) return ""; } function display_edit_group_members($user, $group) { if (validate_level($user, 'gmod') || $group->group_leader_id == $user->user_id) return ""; } function display_accept_group_invite(){ return ""; } function display_reject_group_invite(){ return ""; } function display_delete_chapter($user, $chapter) { if (!$chapter->chapter_deleted) return ""; elseif (validate_level($user, 'gmod')) return ""; } function display_edit_thread($user) { if (validate_level($user, 'pr')) return ""; } function display_lock_thread($user, $thread) { if (validate_level($user, 'pr')) { if ($thread->thread_locked) return ""; else return ""; } } function display_sticky_thread($user, $thread) { if (validate_level($user, 'pr')) { if ($thread->thread_sticky) return ""; else return ""; } } function display_delete_threads($user) { if (validate_level($user, 'pr')) return ""; } function display_new_thread($user, $threads) { if (validate_level($user, $threads->start_thread_level)) return ""; } function display_post_reply($user, $thread) { if ((validate_level($user, 'member') && !$thread->thread_locked) || validate_level($user, 'pr')) return ""; else return ""; } function display_thread_labels($thread) { $return = ""; if ($thread->thread_sticky) $return .= display_fa_icon('thumbtack', 'Sticky', 'text-info'); if ($thread->thread_locked) $return .= display_fa_icon('lock', 'Locked', 'text-warning'); return $return; } function display_post_comment_v3($user, $obj, $type, $type_id) { if (validate_level($user, 'member')) { if (!$obj->thread_id) return "
    "; } else return "You need to log in to comment."; } function display_labels($hentai) { if ($hentai) return "H"; } function display_labels_rss($batch, $hentai, $reencode, $none) { $label = ""; if (!$batch && !$hentai && !$reencode && $none) $label .= " None"; else { if ($batch) $label .= " Batch"; if ($hentai) $label .= " Hentai"; if ($reencode) $label .= " Remake"; } return $label; } function display_fa_icon($name, $title = '', $class = '', $set = 'fas') { return ""; } function display_group_members_list($group_members_array) { $text = ""; return $text; } function display_delete_group_members_list($group_members_array) { $text = ""; foreach ($group_members_array as $user_id => $username) { $text .= display_fa_icon('user') . " $username " . display_fa_icon("trash") . ""; } return $text; } function display_user_groups_list($user_groups_array) { if ($user_groups_array) { $text = ""; } else $text = "None"; return $text; } function display_like_button($user_id, $ip, $array_of_user_id_ip) { if (($user_id && !in_array($user_id, $array_of_user_id_ip["user_id"])) || (!$user_id && !in_array($ip, $array_of_user_id_ip["ip"]))) //(user_id > 0 and user_id not in array) or (user_id = 0 and ip not in array) $text = ""; else $text = ""; return $text; } function display_block_group_button($user, $array_of_user_ids) { if (validate_level($user, 'member')) { if (in_array($user->user_id, $array_of_user_ids)) $text = ""; else $text = ""; } else $text = ""; return $text; } function display_follow_button($user, $array_of_manga_ids, $manga_id, $style = 0, $dropup = 0) { $follow_types = new Follow_Types(); if (validate_level($user, 'member')) { $return = "
    "; if (isset($array_of_manga_ids[$manga_id])) $return .= ""; else $return .= " "; $return .= "
    "; } else $return = ""; return $return; } function display_follow_group_button($user, $array_of_user_ids) { if (validate_level($user, 'member')) { if (in_array($user->user_id, $array_of_user_ids)) $text = ""; else $text = ""; } else $text = ""; return $text; } function display_upload_button($user) { if (validate_level($user, 'member')) $text = ""; else $text = ""; return $text; } function display_add_friend($user, $uploader) { $friends = $user->get_friends_user_ids(); $pending = $user->get_pending_friends_user_ids(); if (is_array($uploader)) $uploader = (object) $uploader; $return = ''; if ($user->user_id != $uploader->user_id) { if (validate_level($user, 'member')) { if (isset($pending[$uploader->user_id])) $return .= ""; elseif (!isset($friends[$uploader->user_id])) $return .= ""; elseif (!$friends[$uploader->user_id]['accepted']) $return .= ""; else $return .= ""; } else $return .= "" . display_fa_icon('user-plus') . " Add friend"; } return $return; } function display_block_user($user, $uploader) { $blocked = $user->get_blocked_user_ids(); if (is_array($uploader)) $uploader = (object) $uploader; $return = ''; // Hide the block button when the profile belongs to a staff member if ($user->user_id != $uploader->user_id && !validate_level($uploader, 'pr')) { if (validate_level($user, 'member')) { if (!isset($blocked[$uploader->user_id])) $return .= ""; else $return .= ""; } else $return .= "" . display_fa_icon('angry', '', '', 'far') . " Block user"; } return $return; } ?>