diff --git a/admin/themes/default/js/history.js b/admin/themes/default/js/history.js index b5d8a5117..5b0f71204 100644 --- a/admin/themes/default/js/history.js +++ b/admin/themes/default/js/history.js @@ -109,11 +109,11 @@ function fillHistoryResult(ajaxParam) { $(".loading").removeClass("hide"); // console.log(ajaxParam.user); // console.log(raw_data); - data = raw_data.result[0]; - imageDisplay = raw_data.result[1].display_thumbnail; - console.log("RESULTS"); - maxPage = raw_data.result[2]; - + data = raw_data.result["lines"]; + imageDisplay = raw_data.result["params"].display_thumbnail; + // console.log("RESULTS"); + maxPage = raw_data.result["maxPage"]; + console.log(data); //clear lines before refill $(".tab .search-line").remove(); @@ -172,7 +172,7 @@ function lineConstructor(line, id, imageDisplay) { newLine.find(".date-day").html(line.DATE); newLine.find(".date-hour").html(line.TIME); - newLine.find(".user-name").html(line.USERNAME); + newLine.find(".user-name").html(line.USERNAME + ''); newLine.find(".user-name").attr("id", line.USERID); if (current_param.user == "-1") { @@ -184,10 +184,11 @@ function lineConstructor(line, id, imageDisplay) { }) } - newLine.find(".user-ip").html(line.IP); + newLine.find(".user-ip").html(line.IP + ''); + newLine.find(".user-ip").data("ip", line.IP); if (current_param.ip == "") { newLine.find(".user-ip").on("click", function () { - current_param.ip = $(this).html(); + current_param.ip = $(this).data("ip"); current_param.pageNumber = 0; addIpFilter($(this).html()); fillHistoryResult(current_param); @@ -207,8 +208,17 @@ function lineConstructor(line, id, imageDisplay) { switch (line.SECTION) { case "tags": - newLine.find(".type-name").html(line.TAGS[0]); - newLine.find(".type-id").html("#" + line.TAGIDS[0]); + if (line.TAGS.length > 1 && line.TAGS.length <= 2 ) { + newLine.find(".type-name").html(line.TAGS[0] +", "+ line.TAGS[1] + ", ..."); + newLine.find(".type-id").html("#" + line.TAGIDS[0] +", "+ line.TAGIDS[1] + ", ..."); + } else if (line.TAGS.length > 2) { + newLine.find(".type-name").html(line.TAGS[0] +", "+ line.TAGS[1] +", "+ line.TAGS[2] + ", ..."); + newLine.find(".type-id").html("#" + line.TAGIDS[0] +", "+ line.TAGIDS[1] +", "+ line.TAGIDS[2] + ", ..."); + } else { + newLine.find(".type-name").html(line.TAGS[0]); + newLine.find(".type-id").html("#" + line.TAGIDS[0]); + } + let detail_str = ""; line.TAGS.forEach(tag => { detail_str += tag + ", "; @@ -234,6 +244,17 @@ function lineConstructor(line, id, imageDisplay) { newLine.find(".type-name").html(str_favorites); newLine.find(".type-id").remove(); break; + case "recent_cats": + newLine.find(".type-name").html(str_recent_cats); + newLine.find(".type-id").remove(); + break; + case "recent_pics": + newLine.find(".type-name").html(str_recent_pics); + newLine.find(".type-id").remove(); + break; + case "categories": + newLine.find(".type-name").html(line.CATEGORY); + newLine.find(".type-id").remove(); default: break; diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl index 7ba339710..0acec9f88 100644 --- a/admin/themes/default/template/history.tpl +++ b/admin/themes/default/template/history.tpl @@ -36,8 +36,10 @@ const API_METHOD = "{$API_METHOD}"; const str_dwld = "{'Downloaded'|translate}"; const str_most_visited = "{'Most visited'|translate}"; const str_best_rated = "{'Best rated'|translate}"; -const str_list = "{'Random'|translate}"; -const str_favorites = "{'Favorites'|translate}"; +const str_list = "{'Random photo'|translate}"; +const str_favorites = "{'Your favorites'|translate}"; +const str_recent_cats = "{'Recent albums'|translate}"; +const str_recent_pics = "{'Recent photos'|translate}"; {/footer_script} {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} @@ -82,7 +84,7 @@ const str_favorites = "{'Favorites'|translate}";
- +
@@ -139,8 +141,8 @@ const str_favorites = "{'Favorites'|translate}";
- Zac le boss - 192.168.0.0 + Zac le boss + 192.168.0.0
@@ -428,6 +430,20 @@ jQuery(document).ready( function() { white-space: nowrap; } +.add-filter { + display: none; +} + +.user-name:hover .add-filter { + display: inline; + margin-left: 4px; +} + +.user-ip:hover .add-filter { + display: inline; + margin-left: 4px; +} + .detail-item-1, .detail-item-2, .detail-item-3 { background: #f0f0f0f0; } diff --git a/include/ws_functions/pwg.php b/include/ws_functions/pwg.php index 809d2e67c..55697879d 100644 --- a/include/ws_functions/pwg.php +++ b/include/ws_functions/pwg.php @@ -942,11 +942,10 @@ SELECT $cat_name = isset($line['category_id']) ? ( isset($name_of_category[$line['category_id']]) ? $name_of_category[$line['category_id']] - : 'deleted '.$line['category_id'] ) - : ''; + : 'deleted'.$line['category_id'] ) + : 'root'; } - /** */ - + array_push( $result, array( 'DATE' => format_date($line['date']), @@ -966,18 +965,19 @@ SELECT 'TAGIDS' => explode(",",$tag_ids), ) ); - - /** */ } -/** - * Pagination Time - */ - $max_page = ceil(count($result)/100); $result = array_reverse($result, true); $result = array_slice($result, $param['pageNumber']*100, 100); -return [$result, $param, $max_page]; + /* Tableau associatif here cf ws_images_search*/ + return array( + 'lines' => $result, + 'params' => $param, + 'maxPage' => $max_page + ); + + // [$result, $param, $max_page]; } ?> \ No newline at end of file diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php index d286f1a37..17aa7ad7d 100644 --- a/language/en_UK/admin.lang.php +++ b/language/en_UK/admin.lang.php @@ -1262,7 +1262,4 @@ $lang['Tag name'] = 'Tag name'; $lang['Visited'] = 'Visited'; $lang['Downloaded'] = 'Downloaded'; -$lang['Most visited'] = 'Most visited'; -$lang['Best rated'] = 'Best rated'; -$lang['Random'] = 'Random'; -$lang['Favorites'] = 'Favorites'; \ No newline at end of file +$lang['Personnalized filters'] = 'Personnalized filters'; \ No newline at end of file diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php index 596f26144..030ce69d3 100644 --- a/language/fr_FR/admin.lang.php +++ b/language/fr_FR/admin.lang.php @@ -1264,7 +1264,4 @@ $lang['Tag name'] = 'Nom du tag'; $lang['Visited'] = 'Visité'; $lang['Downloaded'] = 'Téléchargé'; -$lang['Most visited'] = 'Les plus visitées'; -$lang['Best rated'] = 'Les mieux notées'; -$lang['Random'] = 'Aléatoire'; -$lang['Favorites'] = 'Favoris'; \ No newline at end of file +$lang['Personnalized filters'] = 'Filtres personnalisés'; \ No newline at end of file