Bump button modification 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.
2 posters

    Bump button modification

    avatar
    FIB
    Forumember


    Male Posts : 491
    Reputation : 2
    Language : English
    Location : UK

    Solved Bump button modification

    Post by FIB February 24th 2015, 16:13

    I see Ange has written some code here https://help.forumotion.com/t132887-making-a-bump-button-for-just-one-part-of-the-forum-in-phpbb2?highlight=Bump for a Bump button, I wonder if it's possible to modify it so that only the topic starter can Bump their own topics.

    Code:
    $(function() {
            $('#quick_reply input.mainoption').after('<input id="bump" class="mainoption" style="margin-left:6px;" type="submit" value="Bump" name="post"></input>');
            $('#bump').click(function() {
                $('#quick_reply textarea').val('This items is Bumped as it is still available');
            });
        });

    phpbb2


    Last edited by FIB on February 25th 2015, 17:42; edited 1 time in total
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Bump button modification

    Post by Ange Tuteur February 24th 2015, 16:21

    Hi @FIB,

    Try replacing your script with this :
    Code:
    $(function() {
      if ($('.post:first .name').text() != _userdata.username) return;
      $('#quick_reply input.mainoption').after('<input id="bump" class="mainoption" style="margin-left:6px;" type="submit" value="Bump" name="post"></input>');
      $('#bump').click(function() {
        $('#quick_reply textarea').val('This items is Bumped as it is still available');
      });
    });
    avatar
    FIB
    Forumember


    Male Posts : 491
    Reputation : 2
    Language : English
    Location : UK

    Solved Re: Bump button modification

    Post by FIB February 24th 2015, 16:28

    Thank you Ange, I replaced it as you said but now the bump button has disappeared Shocked
    avatar
    FIB
    Forumember


    Male Posts : 491
    Reputation : 2
    Language : English
    Location : UK

    Solved Re: Bump button modification

    Post by FIB February 25th 2015, 16:30

    Any luck with this Ange Wink
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Bump button modification

    Post by Ange Tuteur February 25th 2015, 17:31

    Oh I forgot :first isn't the first post on phpbb2. Replace the script with this :
    Code:
    $(function() {
      if ($('.post:eq(1) .name').text() != _userdata.username) return;
      $('#quick_reply input.mainoption').after('<input id="bump" class="mainoption" style="margin-left:6px;" type="submit" value="Bump" name="post"></input>');
      $('#bump').click(function() {
        $('#quick_reply textarea').val('This items is Bumped as it is still available');
      });
    });
    avatar
    FIB
    Forumember


    Male Posts : 491
    Reputation : 2
    Language : English
    Location : UK

    Solved Re: Bump button modification

    Post by FIB February 25th 2015, 17:44

    Thank you again for all your help Bump button modification Gentleman
    Ange Tuteur
    Ange Tuteur
    Forumaster


    Male Posts : 13207
    Reputation : 3000
    Language : English & 日本語
    Location : Pennsylvania

    Solved Re: Bump button modification

    Post by Ange Tuteur February 25th 2015, 17:47

    You're welcome ^^

    Topic archived

    Have a nice day. Smile