the last message in the "News" widget shown Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

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.
4 posters

    the last message in the "News" widget shown

    poesia-verses
    poesia-verses
    Forumember


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

    Solved the last message in the "News" widget shown

    Post by poesia-verses Thu 11 May - 18:12

    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 Sat 13 May - 9:01; edited 1 time in total
    zzlasperpen
    zzlasperpen
    Forumember


    Male Posts : 56
    Reputation : 3
    Language : VietNam

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

    Post by zzlasperpen Fri 12 May - 21:26

    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>

    poesia-verses likes this post

    poesia-verses
    poesia-verses
    Forumember


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

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

    Post by poesia-verses Sat 13 May - 5:42

    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
    zzlasperpen
    zzlasperpen
    Forumember


    Male Posts : 56
    Reputation : 3
    Language : VietNam

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

    Post by zzlasperpen Sat 13 May - 7:36

    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();
        })
    });

    poesia-verses likes this post

    poesia-verses
    poesia-verses
    Forumember


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

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

    Post by poesia-verses Sat 13 May - 9:01

    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 : 565
    Reputation : 22
    Language : and small english

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

    Post by poesia-verses Sat 13 May - 10:44

    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
    Ape
    Ape
    Administrator
    Administrator


    Male Posts : 19328
    Reputation : 2005
    Language : fluent in dork / mumbojumbo & English haha

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

    Post by Ape Sat 13 May - 14:11

    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
    poesia-verses
    poesia-verses
    Forumember


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

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

    Post by poesia-verses Sat 13 May - 14:22

    solved
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15322
    Reputation : 1705
    Language : English,Greek
    Location : Greece

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

    Post by skouliki Sat 13 May - 16:35

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