I have set a link to the post buttons that will copy the link of the post. I did this with the following codes:
Code: Select all
<li><a href="https://mywebsitess112.com/forum/<!-- IF postrow.S_FIRST_ROW -->viewtopic.php?t={TOPIC_ID}<!-- ELSE -->viewtopic.php?p={postrow.POST_ID}#p{postrow.POST_ID}<!-- ENDIF -->" class="kobyalandiyigenim" onclick="copyURI(event)"><i class="fa fa-link fa-fw" aria-hidden="true"></i><!-- IF postrow.S_FIRST_ROW -->Copy topic link<!-- ELSE -->Copy post link<!-- ENDIF --></a></li>
Code: Select all
<script>
function copyURI(evt) {
evt.preventDefault();
navigator.clipboard.writeText(evt.target.getAttribute('href')).then(() => {
/* clipboard successfully set */
}, () => {
/* clipboard write failed */
});
}
</script>
Kind regards.