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 forum of the forums
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, 3:13 pm

    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, 4:42 pm; 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, 3:21 pm

    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, 3:28 pm

    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, 3:30 pm

    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, 4:31 pm

    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, 4:44 pm

    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, 4:47 pm

    You're welcome ^^

    Topic archived

    Have a nice day. Smile

      Current date/time is September 22nd 2024, 7:41 pm