Quote button for Guest
3 posters
Page 1 of 1
Quote button for Guest
Hi All
Is anyway we enable quote button for Guest to quote ?
Thanks
Is anyway we enable quote button for Guest to quote ?
Thanks
Last edited by TamDonCo on January 11th 2019, 6:54 pm; edited 1 time in total
Re: Quote button for Guest
If guests are allowed to post on your forum, they should be able to see all the buttons in the topic. Could you post a link to a topic that guests can reply to.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Quote button for Guest
I did a test on my forum and the quote button doesn't appear even if guest posting is allowed. I can make a javascript code to add that functionality if you post your forum link and a link to a topic that guests can see here.
Guest- Guest
Re: Quote button for Guest
SLGray wrote:If guests are allowed to post on your forum, they should be able to see all the buttons in the topic. Could you post a link to a topic that guests can reply to.
Quote button like this
http://www.nhomcho.com/t10597-ngo-biet-khi-yeu-la-au-kho
Re: Quote button for Guest
Guests are only allowed to post, but they do not have full access as members do.
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Quote button for Guest
Actually the links for quoting are active, but there are no buttons for them.
Guest- Guest
Re: Quote button for Guest
Are you saying there is no image for the button?
Lost Founder's Password |Forum's Utilities |Report a Forum |General Rules |FAQ |Tricks & Tips
You need one post to send a PM.
You need one post to send a PM.
When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
Re: Quote button for Guest
When you click on the quote button on this forum for example, it redirects you to https://help.forumotion.com/post?p=POSTID&mode=quote, where POSTID is the id of the post you are quoting. If a guest can post, they can manually type that page in the bar and quote a post that way, despite the fact that no button appears on the topic page. I am working on a code that adds that button there.
Guest- Guest
Re: Quote button for Guest
Add this code with placement on topics:
- Code:
document.addEventListener("DOMContentLoaded", function(){
if(_userdata.user_id===-1){
var css=".button_guest_quote{float:right;background:#00689A;color:white !important;padding:5px;font-size:15px;}";
var style=document.createElement("style");
style.innerHTML=css;
document.querySelector("head").appendChild(style);
var posts=document.querySelectorAll(".post"), insafter=document.querySelectorAll("h2.topic-title"), len=posts.length, id, button;
if(len!==0){
for(var i=0;i<len;i++){
id=parseInt(posts[i].getAttribute("id").match(/\d+/)[0]);
if(id!==0){
button=document.createElement("a");
button.classList.add("button_guest_quote");
button.innerHTML="Quote";
button.setAttribute("href", "/post?p="+id+"&mode=quote");
insafter[i].parentNode.insertBefore(button, insafter[i].nextSibling);
}
}
}
}
})
Guest- Guest
Re: Quote button for Guest
Thank You very much
It works but 1 syntax error
_userdata.user_id===-1
remove extra "="
It works but 1 syntax error
_userdata.user_id===-1
remove extra "="
Re: Quote button for Guest
Actually that code is correct both with 2 "=" and with 3 "=". With 2 "=" it compares the value of _userdata.user_id with -1(-1 meaning that the user is a guest). WIth 3 "=" it compares both the values and the types. In this case, there's no difference between them, but I usually use === because its generally safer than ==. For example, "2"==2 is true, but "2"===2 is false, because "2" is a string and 2 is an integer.
Nonetheless, glad the code works.
Nonetheless, glad the code works.
Guest- Guest
Re: Quote button for Guest
Menim wrote:Actually that code is correct both with 2 "=" and with 3 "=". With 2 "=" it compares the value of _userdata.user_id with -1(-1 meaning that the user is a guest). WIth 3 "=" it compares both the values and the types. In this case, there's no difference between them, but I usually use === because its generally safer than ==. For example, "2"==2 is true, but "2"===2 is false, because "2" is a string and 2 is an integer.
Nonetheless, glad the code works.
Thank You very much
Re: Quote button for Guest
Problem solved & topic archived.
|
Similar topics
» Adding a reply button next to the quote button to automatically tag users?
» Change Quote Button, Edit Button and more into the text
» Quote button not working...
» Quote Snapback Button
» No Multi-quote button
» Change Quote Button, Edit Button and more into the text
» Quote button not working...
» Quote Snapback Button
» No Multi-quote button
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum