#9073 order by language tips

This commit is contained in:
Daniel Cebrian 2023-02-15 17:51:30 +01:00
parent 8ea9a0fc7e
commit d8cfc68585
3 changed files with 5 additions and 6 deletions

View File

@ -190,6 +190,7 @@ class TipsWindow
public function getRandomTip($return=false) public function getRandomTip($return=false)
{ {
global $config;
$exclude = get_parameter('exclude', ''); $exclude = get_parameter('exclude', '');
$sql = 'SELECT id, title, text, url $sql = 'SELECT id, title, text, url
@ -203,7 +204,7 @@ class TipsWindow
} }
} }
$sql .= ' ORDER BY RAND()'; $sql .= ' ORDER BY CASE WHEN id_lang = "'.$config['language'].'" THEN id_lang END DESC, RAND()';
$tip = db_get_row_sql($sql); $tip = db_get_row_sql($sql);
@ -684,7 +685,7 @@ class TipsWindow
$res = db_process_sql_insert( $res = db_process_sql_insert(
'twelcome_tip_file', 'twelcome_tip_file',
[ [
'twelcome_tip_file' => $idTip, 'twelcome_tip_file' => $id,
'filename' => $image, 'filename' => $image,
'path' => 'images/tips/', 'path' => 'images/tips/',
] ]

View File

@ -18,9 +18,6 @@ $(document).ready(function() {
e.preventDefault(); e.preventDefault();
}); });
}); });
$(".carousel .images").ready(function() {
activeCarousel();
});
$("#checkbox_tips_startup").ready(function() { $("#checkbox_tips_startup").ready(function() {
$("#checkbox_tips_startup").on("click", function() { $("#checkbox_tips_startup").on("click", function() {
@ -263,6 +260,7 @@ function load_tips_modal(settings) {
$(".dialog_tips .ui-dialog-titlebar").addClass("tips_header"); $(".dialog_tips .ui-dialog-titlebar").addClass("tips_header");
$(".dialog_tips .ui-dialog-titlebar").removeClass("ui-helper-clearfix"); $(".dialog_tips .ui-dialog-titlebar").removeClass("ui-helper-clearfix");
render_counter(); render_counter();
activeCarousel();
}, },
error: function(data) { error: function(data) {
console.error(data); console.error(data);

View File

@ -41,7 +41,6 @@
position: relative; position: relative;
width: 100%; width: 100%;
max-width: 464px; max-width: 464px;
max-height: 290px;
text-align: center; text-align: center;
margin: 0 auto; margin: 0 auto;
padding-top: 20px; padding-top: 20px;
@ -186,6 +185,7 @@ span.disable {
.image-tip { .image-tip {
display: flex; display: flex;
align-items: center; align-items: center;
margin: 10px 0px;
} }
.image-tip img { .image-tip img {
max-width: 350px; max-width: 350px;