This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Is this possible to setup?
#11

That's okay. I have it working now. This is the way that I would do it. Note that this will only work for v2.1, which you said you were using.

Step 1

In your page, your integration code probably looks something like this:

PHP Code:
<?php
$cmtx_page_id
= "1";
$cmtx_reference = "Page One";
$cmtx_path = "comments/";
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . "includes/commentics.php"; //no need to edit this line
?>

Add the following line to it:

PHP Code:
<?php 
define
('DISPLAY', 'comments');

So you should now have:

PHP Code:
<?php
define
('DISPLAY', 'comments');
$cmtx_page_id = "1";
$cmtx_reference = "Page One";
$cmtx_path = "comments/";
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . "includes/commentics.php"; //no need to edit this line
?>

Step 2

Now, in your other page where you only want the form, use the same integration code but change that particular line to 'form' so you should now have this:

PHP Code:
<?php
define
('DISPLAY', 'form');
$cmtx_page_id = "1";
$cmtx_reference = "Page One";
$cmtx_path = "comments/";
define('IN_COMMENTICS', 'true'); //no need to edit this line
require $cmtx_path . "includes/commentics.php"; //no need to edit this line
?>

Step 3

Now, open up /comments/includes/commentics.php and replace this section of code:

PHP Code:
<?php 
if ($cmtx_settings->sort_order_parts == "1,2") {
require_once
$cmtx_path . "includes/template/comments.php"; //display comments
echo "<div class='cmtx_height_for_divider'></div>"; //display divider
require_once $cmtx_path . "includes/template/form.php"; //display form
} else {
require_once
$cmtx_path . "includes/template/form.php"; //display form
echo "<div class='cmtx_height_for_divider'></div>"; //display divider
require_once $cmtx_path . "includes/template/comments.php"; //display comments
}

With this:

PHP Code:
<?php 
if (DISPLAY == "comments") {
require_once
$cmtx_path . "includes/template/comments.php"; //display comments
} else {
require_once
$cmtx_path . "includes/template/form.php"; //display form
}

Step 4

Now, open up /comments/includes/app/processor.php and do a search for this line:

PHP Code:
<?php 
$_SESSION
['cmtx_captcha'] = ""; //reset session

You should find two occurrences. Below each occurrence, add this:

Code:
?>
<script type="text/javascript">
// <![CDATA[
setTimeout("window.location.href = 'http://www.dan-tech-computing.com/testimonials.php'", 5000);
// ]]>
</script>
<?php

Have you completed the interview?
Reply
#12

I was wrong about the version. I thought I was using 2.1 its actually v1.8 but I'm just going to upgrade it to v 2.1

Thanks so much.
Reply
#13

I am curious tho, if I do decide to upgrade to 2.1 will that destroy any of the code modifications you might of helped me with in the past?
Reply
#14

Unfortunately, in general, any code modifications would be destroyed. So you would need to re-apply those code modifications again.

For v1.8, the solution is actually quite similar.

Add this at the top of your integration code for the comments page:

PHP Code:
<?php 
define
('DISPLAY', 'comments');

And add this at the top of your integration code for the form page:

PHP Code:
<?php 
define
('DISPLAY', 'form');

In /comments/includes/commentics.php, replace this:

PHP Code:
<?php 
if ($settings->sort_order_parts == "1,2") {
require_once
$path_to_comments_folder . "includes/template/comments.php"; //display comments
echo "<div class='height_for_divider'></div>"; //display divider
require_once $path_to_comments_folder . "includes/template/form.php"; //display form
} else {
require_once
$path_to_comments_folder . "includes/template/form.php"; //display form
echo "<div class='height_for_divider'></div>"; //display divider
require_once $path_to_comments_folder . "includes/template/comments.php"; //display comments
}

With this:

PHP Code:
<?php 
if (DISPLAY == "comments") {
require_once
$path_to_comments_folder . "includes/template/comments.php"; //display comments
} else {
require_once
$path_to_comments_folder . "includes/template/form.php"; //display form
}

And step 4 is the same.

Have you completed the interview?
Reply
#15

That worked great!!!!

One more question. How can you add anchors into the mix. It seems like when it redirects to the comments page it redirects down the page a little. How can I have it stay at the top of the page when it redirects? Same thing happens when you enter in a comment.

(04-Oct-2012, 09:46 PM)Steven Wrote:  Unfortunately, in general, any code modifications would be destroyed. So you would need to re-apply those code modifications again.

For v1.8, the solution is actually quite similar.

Add this at the top of your integration code for the comments page:

PHP Code:
<?php 
define
('DISPLAY', 'comments');

And add this at the top of your integration code for the form page:

PHP Code:
<?php 
define
('DISPLAY', 'form');

In /comments/includes/commentics.php, replace this:

PHP Code:
<?php 
if ($settings->sort_order_parts == "1,2") {
require_once
$path_to_comments_folder . "includes/template/comments.php"; //display comments
echo "<div class='height_for_divider'></div>"; //display divider
require_once $path_to_comments_folder . "includes/template/form.php"; //display form
} else {
require_once
$path_to_comments_folder . "includes/template/form.php"; //display form
echo "<div class='height_for_divider'></div>"; //display divider
require_once $path_to_comments_folder . "includes/template/comments.php"; //display comments
}

With this:

PHP Code:
<?php 
if (DISPLAY == "comments") {
require_once
$path_to_comments_folder . "includes/template/comments.php"; //display comments
} else {
require_once
$path_to_comments_folder . "includes/template/form.php"; //display form
}

And step 4 is the same.
Reply
#16

With regard to the comments page, the redirect to it doesn't use an anchor, so it should redirect to the top of the page. When I submitted a test comment on your site earlier today, it redirected to the top of the page. If you did want to use an anchor, you would change it to this:

setTimeout("window.location.href = 'http://www.dan-tech-computing.com/testimonials.php#cmtx_comments'", 5000);

With regard to the form page, to remove the anchor, open /comments/includes/language/english/form.php and change this:

PHP Code:
<?php 
define
('CMTX_ANCHOR_FORM', '#cmtx_form');

To this:

PHP Code:
<?php 
define
('CMTX_ANCHOR_FORM', '');

Have you completed the interview?
Reply
#17

Your right when it redirects it does go to the top of the page. It's after you submit the comment and before the redirect that it moves down the page some instead of remaining at the top of the page.

(05-Oct-2012, 09:01 PM)Steven Wrote:  With regard to the comments page, the redirect to it doesn't use an anchor, so it should redirect to the top of the page. When I submitted a test comment on your site earlier today, it redirected to the top of the page. If you did want to use an anchor, you would change it to this:

setTimeout("window.location.href = 'http://www.dan-tech-computing.com/testimonials.php#cmtx_comments'", 5000);

With regard to the form page, to remove the anchor, open /comments/includes/language/english/form.php and change this:

PHP Code:
<?php 
define
('CMTX_ANCHOR_FORM', '#cmtx_form');

To this:

PHP Code:
<?php 
define
('CMTX_ANCHOR_FORM', '');
Reply
#18

Also just one minor thing. Is there any way to put a space after the time and the am or pm so it looks like 3:00 PM?
Reply
#19

Go to Layout -> Comments -> General and for the 'Time Format' and 'Date/Time' settings change g:ia to g:i A

Have you completed the interview?
Reply
#20
Question 

Any idea on what's causing the page to shift down when previewing a comment or just after you click the add comment button?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)