×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Reply button

Reply button 15 years 2 months ago #6593

  • Rakel
  • Rakel's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
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 :)

Reply button 15 years 2 months ago #6594

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Здрасти,
You can use the backend to disable nested comments and allow only the moderators to use the reply button.

Reply button 15 years 2 months ago #6595

  • Rakel
  • Rakel's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
Здравей ;),
I know about this, but I want allow reply for all users, but limited to 1 nested reply. It is mainly because of position problem of comments

Reply button 15 years 2 months ago #6601

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48

I know about this, but I want allow reply for all users, but limited to 1 nested reply.

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.

It is mainly because of position problem of comments

Is that with modern template?

Reply button 15 years 2 months ago #6615

  • Rakel
  • Rakel's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 8
  • Thank you received: 0
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 :)

Reply button 15 years 2 months ago #6631

  • JonusC
  • JonusC's Avatar
  • Offline
  • Platinum Boarder
  • Platinum Boarder
  • Posts: 785
  • Thank you received: 48
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.

Also another problem - the entire {editbuttons} block will be hidden, so administrator cannot see the 'Delete' in the footer either :( EDIT: Updated to only hide 'Reply' and 'Quote', moderators should still see the 'Delete' button :cheer:

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>
...it should be on Line # 306 (but it's OK if it isn't)

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 :P

Enjoy!
  • Page:
  • 1
Time to create page: 0.173 seconds