Welcome,
Guest
|
|
TOPIC: Reply button
Reply button 15 years 2 months ago #6594
|
|
Time to create page: 0.173 seconds
Welcome,
Guest
|
|
Hello!
I have just updated to new 4.0 beta2. I use a JQdefault-emotop, css-age. And want limit replys to "1 nested", or post reply only to original comment. I think that easy way is just "hide" reply button on all "replys". Is it possible? Or may be there is other solution to this question? Please, i will be so grateful to resolve this. Thank you in advance! Greetings from Bulgaria |
|
|
Здрасти,
You can use the backend to disable nested comments and allow only the moderators to use the reply button. |
It could be done with a couple of lines of PHP, just to "hide" the reply button on certain posts. I could whip up something within the next few days for you to try out. Is that with modern template? |
|
Hi !
I suppose that with some changes in PHP this will be resolved. And I will be waiting for your decision (you know your sources better, if I make this changes - probably something other will be wrong!). Thank you so much! About modern template -> no, there is not possition problem there. But there is some small "things" in modern template, that are not "convenient". 1. When click on "Search" it sends me on "Write comment", 2. we cannot hide/show "Write comment" by click. These "things" are ok on JQdefaults-emotop - because of that, we choose it. Thank you, again! P.S. I am going to download BiggieSmall - there are 0 sec. already. I am so impatient |
|
I tried to do it in PHP, and I did do it, but you have to change several lines and functions and throw a new variable around and.... yeah it was a little complicated and messy.
So I have a solution with in-line JavaScript for you. It works 100%, but the only problem is, if somebody is clever enough, they could examine the source-code and manually type in JavaScript in address bar to reply to a comment that has the Edit buttons hidden. I will remember to put this in the next release as a backend option, to choose how "deep" (how many levels) you want to limit it to, it's just that we are very busy right now with other things. I hope you can understand, and I hope this is suitable for you until the next JoomlaComment release On to the steps! 1) Open up the file here: \components\com_comment\joscomment\templates\JQdefault-emotop\index.html 2) Search for this text in the file: <td align='left'>{editbuttons}</td> 3) Now, CUT that line, and paste in it's place, this entire code block: <td id='josc_eb{id}' align='left'>{editbuttons}</td>
<script type="text/javascript">
<!--
if (document.getElementById("post{id}").style.marginLeft == "20px") {
document.getElementById("josc_eb{id}").getElementsByTagName('a')[0].innerHTML = "";
document.getElementById("josc_eb{id}").getElementsByTagName('a')[1].innerHTML = "";
}
-->
</script> That should do the trick. Allow me to explain each line: Line 1: We added an id to the td element so we can select it in JavaScript Line 2 and 3 are just the beginning of inline JavaScript define, nothing special there Line 4: This checks the *main* post that is currently being processed by Joomla, to find what the margin is, in this case it will only continue if it's margin-left is 20px (the value a reply comment will be) Line 5: This looks inside the id, the one we added on line 1, for the FIRST <a> tag - which should always be the 'Reply' button. It changes the text to "" empty which hides the link Line 6: Same as line 5, but gets the SECOND <a> tag which should always be Quote. I hope somebody can maybe learn a little something from that if they come across this thread P.S. Please remember Rakel if your JoomlaComment template does anything "strange" in future, remember you made this modification! If anything goes wrong, please try to restore the original index.html for the template before asking for support - just to make sure it isn't our little modification here causing it. Or... well we always ask people to switch to an unmodified 'modern' template anyway to fix bugs so nevermind I guess Enjoy! |
|
|