the last message in the "News" widget shown
4 posters
Page 1 of 1
the last message in the "News" widget shown
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
Last edited by poesia-verses on May 13th 2023, 9:01 am; edited 1 time in total
Re: the last message in the "News" widget shown
you can use the forum rss feed available
first create a new widget and put in all the generated code
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>
poesia-verses likes this post
Re: the last message in the "News" widget shown
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
and more: the first message of the topic is displayed, but the last one is needed
Re: the last message in the "News" widget shown
I'm sorry that the feed data only shows the first message
you change this js code to limit the 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();
})
});
poesia-verses likes this post
Re: the last message in the "News" widget shown
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
Re: the last message in the "News" widget shown
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
Re: the last message in the "News" widget shown
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.
I'm asking as i see you marked it as solved but you then asked a new question.
Re: the last message in the "News" widget shown
Problem solved & topic archived.
|
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum