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.

Reply button

2 posters

Go down

Solved Reply button

Post by Wealh November 7th 2015, 3:55 am

Can I add another reply button over my quick reply box? Another, I don't want to move the one I have now. I want to add a big CLICK HERE TO REPLY at the bottom, anyone?
Wealh
Wealh
Forumember

Posts : 69
Reputation : 6
Language : English

http://boredom.iftopic.com/

Back to top Go down

Solved Re: Reply button

Post by Wealh November 8th 2015, 7:48 am

Bump
Wealh
Wealh
Forumember

Posts : 69
Reputation : 6
Language : English

http://boredom.iftopic.com/

Back to top Go down

Solved Re: Reply button

Post by Ange Tuteur November 8th 2015, 5:30 pm

Hi @Wealh,

Yes, it should be possible. Go to Modules > JavaScript codes management and create a new script with the following settings.

Placement : In all the pages
Code:
$(function() {
  var quick = document.anchors.quickreply,
      container;

  if (quick) {
    container = document.createElement('DIV');
    container.innerHTML = '<a href="/post?t=' + window.location.href.replace(/.*?\/t(\d+).*/, '$1') + '&mode=reply">CLICK HERE TO REPLY</a>';
    container.id = 'topic_reply';

    quick.parentNode.insertBefore(container, quick);
  }
});

Then, you can style the texts with this CSS :
Code:
#topic_reply {
  text-align:center;
  font-size:16px;
  font-weight:bold;
}

For other stylistic changes, you may need to select the anchor instead. Like this :
Code:
#topic_reply a
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Reply button

Post by Wealh November 9th 2015, 4:47 am

Ange Tuteur wrote:Hi @Wealh,

Yes, it should be possible. Go to Modules > JavaScript codes management and create a new script with the following settings.

Placement : In all the pages
Code:
$(function() {
  var quick = document.anchors.quickreply,
      container;

  if (quick) {
    container = document.createElement('DIV');
    container.innerHTML = '<a href="/post?t=' + window.location.href.replace(/.*?\/t(\d+).*/, '$1') + '&mode=reply">CLICK HERE TO REPLY</a>';
    container.id = 'topic_reply';

    quick.parentNode.insertBefore(container, quick);
  }
});

Then, you can style the texts with this CSS :
Code:
#topic_reply {
  text-align:center;
  font-size:16px;
  font-weight:bold;
}

For other stylistic changes, you may need to select the anchor instead. Like this :
Code:
#topic_reply a

Thanks! I have another problem: it doesn't appear for the guests. I want only guests to see it.
Wealh
Wealh
Forumember

Posts : 69
Reputation : 6
Language : English

http://boredom.iftopic.com/

Back to top Go down

Solved Re: Reply button

Post by Ange Tuteur November 9th 2015, 10:58 am

Oh, we'll need to replace
Code:
document.anchors.quickreply
since it doesn't show for guests. Do you have a link to the page that I can look at ?
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Reply button

Post by Wealh November 9th 2015, 6:42 pm

Ange Tuteur wrote:Oh, we'll need to replace
Code:
document.anchors.quickreply
since it doesn't show for guests. Do you have a link to the page that I can look at ?

What page?
Wealh
Wealh
Forumember

Posts : 69
Reputation : 6
Language : English

http://boredom.iftopic.com/

Back to top Go down

Solved Re: Reply button

Post by Ange Tuteur November 9th 2015, 7:02 pm

A link to a topic on your forum. I don't know the forum version I'm working with, so I'm not sure what I'll need to modify in the code now.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Reply button

Post by Wealh November 9th 2015, 8:31 pm

Ange Tuteur wrote:A link to a topic on your forum. I don't know the forum version I'm working with, so I'm not sure what I'll need to modify in the code now.

http://boredom.iftopic.com/t3-suicide-mouse
Wealh
Wealh
Forumember

Posts : 69
Reputation : 6
Language : English

http://boredom.iftopic.com/

Back to top Go down

Solved Re: Reply button

Post by Ange Tuteur November 9th 2015, 8:41 pm

Try this :
Code:
$(function() {
  var quick = document.getElementById('pun-info'),
      container;
 
  if (quick && !_userdata.user_level) {
    container = document.createElement('DIV');
    container.innerHTML = '<a href="/post?t=' + window.location.href.replace(/.*?\/t(\d+).*/, '$1') + '&mode=reply">CLICK HERE TO REPLY</a>';
    container.id = 'topic_reply';
 
    quick.parentNode.insertBefore(container, quick.previousSibling);
  }
});

It should make it display for guests only.
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Solved Re: Reply button

Post by Wealh November 9th 2015, 8:44 pm

Ange Tuteur wrote:Try this :
Code:
$(function() {
  var quick = document.getElementById('pun-info'),
      container;
 
  if (quick && !_userdata.user_level) {
    container = document.createElement('DIV');
    container.innerHTML = '<a href="/post?t=' + window.location.href.replace(/.*?\/t(\d+).*/, '$1') + '&mode=reply">CLICK HERE TO REPLY</a>';
    container.id = 'topic_reply';
 
    quick.parentNode.insertBefore(container, quick.previousSibling);
  }
});

It should make it display for guests only.

Awesome, thanks!
Wealh
Wealh
Forumember

Posts : 69
Reputation : 6
Language : English

http://boredom.iftopic.com/

Back to top Go down

Solved Re: Reply button

Post by Ange Tuteur November 9th 2015, 9:04 pm

You're welcome ^^

Topic archived

If any problems feel free to open a new topic. Have a good day. Smile
Ange Tuteur
Ange Tuteur
Forumaster

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

https://fmdesign.forumotion.com

Back to top Go down

Back to top


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