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.

Disable the Quote Feature for one user.

4 posters

Go down

Solved Disable the Quote Feature for one user.

Post by runawayhorses October 8th 2012, 7:21 pm

Is it possible to disable the quote feature for one user? A javascript code I'm assuming would be the way to do it. I'm using Invision. Thanks


Last edited by runawayhorses on October 9th 2012, 1:48 pm; edited 1 time in total
avatar
runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 166
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by LGforum October 8th 2012, 9:01 pm

You could hide the quote button, by outputting CSS depending on the username:
Code:
<script>
if('{USERNAME}' === 'username of user') document.write('<style>.i_icon_quote{ display: none; }</style>');
</script>
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by runawayhorses October 8th 2012, 11:40 pm

Would a portal widget work? I don't have the forum widgets activated only the portal widgets.
avatar
runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 166
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by runawayhorses October 9th 2012, 1:26 am

Let me explain what just happened when I added that code. First to test it I set it to hide a test account username I have so I could check and see if I could view the Quote button. Well when I went to login with the test account it loaded a blank white screen and refused to load the page. I then cleared my cookies and tried again, same thing happened. I then began to panic thinking OMG what if I can't login with my usual admin account, but it loaded fine and let me in. Then to further test it I removed the code and then tried to login again with my test account, this time it loaded fine and let me in. So what we can conclude is, with the code in place whoevers name is in the script to block the Quote button is also being blocked from viewing the site. Something went terribly wrong.
avatar
runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 166
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by kirk October 9th 2012, 1:32 am

runawayhorses wrote:Let me explain what just happened when I added that code. First to test it I set it to hide a test account username I have so I could check and see if I could view the Quote button. Well when I went to login with the test account it loaded a blank white screen and refused to load the page. I then cleared my cookies and tried again, same thing happened. I then began to panic thinking OMG what if I can't login with my usual admin account, but it loaded fine and let me in. Then to further test it I removed the code and then tried to login again with my test account, this time it loaded fine and let me in. So what we can conclude is, with the code in place whoevers name is in the script to block the Quote button is also being blocked from viewing the site. Something went terribly wrong.

have you tried LG way as well?
He dont really say where to put it, but my guess it should work in the forums announment if you do not have wigets on.

Other then that i will have to test as well, but am sure both codes will work.
kirk
kirk
Forumaster

Male Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by runawayhorses October 9th 2012, 1:35 am

Maybe so Kirk but I feel uncomfortable with this. Thank you but I'm going to steer clear of using such a code, if this one works for me I'd be concerned it might not for someone else, the code seems too unstable and I don't trust it. Thanks just the same, but I will just forget this idea of hiding the quote button for a member.
avatar
runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 166
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by kirk October 9th 2012, 1:44 am

i just placed it in announcement and works fine. if that's the only thing in there you do not even see the announcement either.

But up to you Smile

try what else Rideem3 has just added to Smile
kirk
kirk
Forumaster

Male Posts : 11037
Reputation : 653
Language : English,Vulcan,Klingon, Romulan,& Gorn

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by runawayhorses October 9th 2012, 1:47 am

Which one did you try Kirk LG's code in announcement?

Edit: were you using Invision?

No reflection on your Rideem just trying to sort this out.. Smile


Last edited by runawayhorses on October 9th 2012, 1:50 am; edited 1 time in total
avatar
runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 166
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by runawayhorses October 9th 2012, 1:50 pm

Ok, thanks guys.
avatar
runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 166
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by LGforum October 9th 2012, 4:31 pm

Yeah document.write won't work in DOM Ready functions since the DOM is already loaded.
Putting this in an announcement or site description:
Code:
<script type="text/javascript">
    if('{USERNAME*}' === 'username of user') document.write('<style>.i_icon_quote{ display: none; }</style>');
    </script>
Will ensure the quote button is hidden on all pages, including PM's and any other places it may be.

If you don't understand it runawayhorses, what it does is do a check that {USERNAME*} value is the same as the username you specify. If it is, then the current user must be that user that you don't want seeing the quote button. So it writes out the CSS necessary to hide the quote button.

Just note that doing this won't stop them from quoting if they visit the URL. /post?mode=quote&p=POSTID
LGforum
LGforum
Hyperactive

Male Posts : 2265
Reputation : 264
Language : English
Location : UK

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by runawayhorses October 9th 2012, 5:43 pm

Ok thanks everyone, this can be locked now. Smile
avatar
runawayhorses
Hyperactive

Male Posts : 2537
Reputation : 166
Language : English
Location : United States

http://runawayhorses.alldiscussion.net/

Back to top Go down

Solved Re: Disable the Quote Feature for one user.

Post by SLGray October 9th 2012, 7:03 pm

Topic Solved & Locked


Disable the Quote Feature for one user. Slgray10

When your topic has been solved, ensure you mark the topic solved.
Never post your email in public.
SLGray
SLGray
Administrator
Administrator

Male Posts : 51576
Reputation : 3525
Language : English
Location : United States

https://forumsclub.com/gc/128-link-directory/

Back to top Go down

Back to top

- Similar topics

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