The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Bump button modification

View previous topic View next topic Go down

Solved Bump button modification

Post by FIB on February 24th 2015, 3:13 pm

I see Ange has written some code here http://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

FIB
Forumember

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

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Bump button modification

Post by Ange Tuteur on 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');
  });
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Bump button modification

Post by FIB on February 24th 2015, 3:28 pm

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

FIB
Forumember

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

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Bump button modification

Post by FIB on February 25th 2015, 3:30 pm

Any luck with this Ange Wink

FIB
Forumember

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

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Bump button modification

Post by Ange Tuteur on 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');
  });
});

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

Solved Re: Bump button modification

Post by FIB on February 25th 2015, 4:44 pm

Thank you again for all your help

FIB
Forumember

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

http://ourbulgariaforum.freeforums.eu/

Back to top Go down

Solved Re: Bump button modification

Post by Ange Tuteur on February 25th 2015, 4:47 pm

You're welcome ^^

Topic archived

Have a nice day. Smile

Ange Tuteur
Forumaster

Male Posts : 13021
Reputation : 2681
Language : EN10, FR5
Location : Pennsylvania

http://fmdesign.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


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