The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

the last message in the "News" widget shown

4 posters

Go down

Solved the last message in the "News" widget shown

Post by poesia-verses May 11th 2023, 6:12 pm

need a script to make the last message in the "News" widget shown, and not as it is now - the first message. The first message hangs in the left column of widgets is completely uninformative, you need to show the last message of the topic instead

bwi


Last edited by poesia-verses on May 13th 2023, 9:01 am; edited 1 time in total
poesia-verses
poesia-verses
Forumember

Male Posts : 571
Reputation : 22
Language : and small english

https://stihi-podval.forumotion.com/

Back to top Go down

Solved Re: the last message in the "News" widget shown

Post by zzlasperpen May 12th 2023, 9:26 pm

you can use the forum rss feed available

first create a new widget and put in all the generated code
Code:
<div class="rssfeed box-content"></div>
<script type="text/javascript">
$.get('/feed/?type=atom').done(function(data) {
    var a = $(data);
    var b = a.find('entry:lt(5)').length;
    for (var z = 0; z < b; z++) {
        var e = a.find('entry:eq(' + z + ') title').text();
        var f = a.find('entry:eq(' + z + ') id').text();
        var g = a.find('entry:eq(' + z + ') name').text();
        var t = a.find('entry:eq(' + z + ') updated').text();
        var textt = a.find('entry:eq(' + z + ') content').text();
        $('.rssfeed').append('<div class="last-feed"><a href="' + f + '" class="title-post">' + e + '</a><div class="text-feed" style="font-size:80% ">' + textt + '</div><div class="time-user"> ' + t + ' <a href="/profile.forum?mode=viewprofile&u=' + g + '">' + g + '</a></div></div>');
    }
})
</script>
zzlasperpen
zzlasperpen
Forumember

Male Posts : 56
Reputation : 3
Language : VietNam

https://raovat24.forumvi.com/

poesia-verses likes this post

Back to top Go down

Solved Re: the last message in the "News" widget shown

Post by poesia-verses May 13th 2023, 5:42 am

thanks! and how to make posts incomplete? so that some of the posts are displayed,. so that part of the post is displayed and not the post in full



and more: the first message of the topic is displayed, but the last one is needed
poesia-verses
poesia-verses
Forumember

Male Posts : 571
Reputation : 22
Language : and small english

https://stihi-podval.forumotion.com/

Back to top Go down

Solved Re: the last message in the "News" widget shown

Post by zzlasperpen May 13th 2023, 7:36 am

I'm sorry that the feed data only shows the first message

you change this js code to limit the message
Code:
$.get('/feed/?type=atom').done(function(data) {
    var a = $(data);
    var b = a.find('entry:lt(5)').length;
    for (var z = 0; z < b; z++) {
        var e = a.find('entry:eq(' + z + ') title').text();
        var f = a.find('entry:eq(' + z + ') id').text();
        var g = a.find('entry:eq(' + z + ') name').text();
        var t = a.find('entry:eq(' + z + ') updated').text();
        var textt = a.find('entry:eq(' + z + ') content').text();
        $('.rssfeed').append('<div class="last-feed"><a href="' + f + '" class="title-post">' + e + '</a><div class="text-feed" style="font-size:80% ">' + textt + '</div><div class="time-user"> ' + t + ' <a href="/profile.forum?mode=viewprofile&u=' + g + '">' + g + '</a></div></div>');
    }
    $('.text-feed').text(function() {
        return $(this).text().length > 175 ? $(this).text().substr(0, 175) + '...' : $(this).text();
    })
});
zzlasperpen
zzlasperpen
Forumember

Male Posts : 56
Reputation : 3
Language : VietNam

https://raovat24.forumvi.com/

poesia-verses likes this post

Back to top Go down

Solved Re: the last message in the "News" widget shown

Post by poesia-verses May 13th 2023, 9:01 am

this really solved it, i added the ending ?view=newest i gave the link below. you can have a look on my forum, THANK YOU! huge
poesia-verses
poesia-verses
Forumember

Male Posts : 571
Reputation : 22
Language : and small english

https://stihi-podval.forumotion.com/

Back to top Go down

Solved Re: the last message in the "News" widget shown

Post by poesia-verses May 13th 2023, 10:44 am

I wanted to ask: why does it not show the latest messages? the difference is visible - there is a recent topics widget, there is another one at the top
poesia-verses
poesia-verses
Forumember

Male Posts : 571
Reputation : 22
Language : and small english

https://stihi-podval.forumotion.com/

Back to top Go down

Solved Re: the last message in the "News" widget shown

Post by Ape May 13th 2023, 2:11 pm

Hi @poesia-verses is this now solved ?
I'm asking as i see you marked it as solved but you then asked a new question.


the last message in the "News" widget shown Left1212the last message in the "News" widget shown Center11the last message in the "News" widget shown Right112
the last message in the "News" widget shown Ape_b110
the last message in the "News" widget shown Ape1010
Ape
Ape
Administrator
Administrator

Male Posts : 19449
Reputation : 2011
Language : fluent in dork / mumbojumbo & English haha

http://chatworld.forumotion.co.uk/

Back to top Go down

Solved Re: the last message in the "News" widget shown

Post by poesia-verses May 13th 2023, 2:22 pm

solved
poesia-verses
poesia-verses
Forumember

Male Posts : 571
Reputation : 22
Language : and small english

https://stihi-podval.forumotion.com/

Back to top Go down

Solved Re: the last message in the "News" widget shown

Post by skouliki May 13th 2023, 4:35 pm

Problem solved & topic archived.
Please read our forum rules: ESF General Rules
skouliki
skouliki
Manager
Manager

Female Posts : 15397
Reputation : 1709
Language : English,Greek
Location : Greece

http://iconskouliki.forumgreek.com

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum