Skip to:
Content
Pages
Categories
Search
Top
Bottom

Nested replies not working


  • didona
    Participant

    @didona

    Hi,
    I’m sorry if this was answered and/or resolved, but all I’m finding are topics 2 years old, not solved.

    My forum has “Enable threaded nested replies 2 levels deep” checked.

    It IS working, but when a user click on a “REPLY” button on the comment he wants to reply to, it takes him to the bottom of the page where the form is.

    I want that the form appears right beneath the comment I’m replying to.

    Thank you in advance,
    Tamara

Viewing 2 replies - 1 through 2 (of 2 total)

  • Robin W
    Moderator

    @robin-w

    ok, so

    1. Save the attached code to your pc, as a new file called reply.js
    2. Create a directory on your theme called ‘js’, and copy the renamed file reply.js to it, so that you end up with wp-content/themes/%my-theme%/js/reply.js

    where %my-theme% is the name of your theme

    Let me know if this works

    addReply = {
    	moveForm : function(replyId, parentId, respondId, postId) {
    		var t = this, div, reply = t.I(replyId), respond = t.I(respondId), cancel = t.I('bbp-cancel-reply-to-link'), parent = t.I('bbp_reply_to'), post = t.I('bbp_topic_id');
    
    		if ( ! reply || ! respond || ! cancel || ! parent )
    			return;
    
    		t.respondId = respondId;
    		postId = postId || false;
    
    		if ( ! t.I('bbp-temp-form-div') ) {
    			div = document.createElement('div');
    			div.id = 'bbp-temp-form-div';
    			div.style.display = 'none';
    			respond.parentNode.insertBefore(div, respond);
    		}
    
    		reply.parentNode.insertBefore(respond, reply);
    		if ( post && postId )
    			post.value = postId;
    		parent.value = parentId;
    		cancel.style.display = '';
    
    		cancel.onclick = function() {
    			var t = addReply, temp = t.I('bbp-temp-form-div'), respond = t.I(t.respondId);
    
    			if ( ! temp || ! respond )
    				return;
    
    			t.I('bbp_reply_to').value = '0';
    			temp.parentNode.insertBefore(respond, temp);
    			temp.parentNode.removeChild(temp);
    			this.style.display = 'none';
    			this.onclick = null;
    			return false;
    		}
    				
    		try { t.I('bbp_reply_content').focus(); }
    		catch(e) {
    			
    
    			
    			
    		}
    		
    		
    
    		return false;
    	},
    
    	I : function(e) {
    		tinymce.execCommand('mceFocus',false,'bbp_reply_content');
    	}
    	
    	
    	
    }

    didona
    Participant

    @didona

    Hi,
    thank you very much for your trouble, but unfortunately, it is not working.
    If I find a solution I will leave a comment here.

    Thank you,
    Tamara

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Skip to toolbar