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

Put the form before the comments ?
#1
Wink 

First I would like to thank you because this script is really awesome !

Then I have a question: I would like to add the comment form before the comments on the pages. I searched in the Admin panel and didn't find that option Huh, maybe I didn't see it Blush

Thanks Wink
Reply
#2

Yeah I'm afraid there isn't an admin setting for that.

I haven't tried it yet but it's probably possible by moving a bit of the code about.

I'm moving this thread to the 'Code [Help]' area and I'll post back after I have looked into it.

Have you completed the interview?
Reply
#3

Hi, it's quite a simple change.

Find this in comments/includes/commentics.php:
PHP Code:
<?php 
/********************************************** DISPLAY DATA (2/2) ************************************************/
require $path_to_comments_folder . "includes/template/comments.php"; //display comments

require $path_to_comments_folder . "includes/template/divider.txt"; //display divider

if (is_form_enabled(true)) { //if form is enabled
require $path_to_comments_folder . "includes/template/form.php"; //display form
}
/******************************************************************************************************************/

Replace with:
PHP Code:
<?php 
/********************************************** DISPLAY DATA (2/2) ************************************************/
if (is_form_enabled(true)) { //if form is enabled
require $path_to_comments_folder . "includes/template/form.php"; //display form
}

require
$path_to_comments_folder . "includes/template/divider.txt"; //display divider

require $path_to_comments_folder . "includes/template/comments.php"; //display comments
/******************************************************************************************************************/

Then change the text in the admin panel in Layout -> Top and Layout -> Divider.

Have you completed the interview?
Reply
#4

I could make it toggle-able in the admin panel if you want.

I'm giving you three guesses...
Reply
#5

Yeah I agree this would make a good setting for the admin panel.

I'll add it for the next version after v1.1.

Have you completed the interview?
Reply
#6

This was very quick thank you for that ! Big Grin
Reply
#7


I'm giving you three guesses...
Reply
#8

This is sure great stuff for PHP wizards, but for uneducated PHP ignorants like me? ... I have no idea on where to place this code into the commentics.php ... ! Huh

But. I still would like to have the "add a comment" form appearing before the comments, too.

It appears to me that Steven and Static are quite savvy with the script! Would be a good idea if you Pros could be hired for some customization work and/or consultancy. (just an idea)

Thanks a lot

Reply
#9

Hi,

This is the section in commentics.php (v1.5) which displays the main parts:
PHP Code:
<?php 
require $path_to_comments_folder . "includes/template/comments.php"; //display comments
if ($settings->enabled_social) {
require
$path_to_comments_folder . "includes/template/divider1.txt"; //display divider
require $path_to_comments_folder . "includes/template/social.php"; //display social
}
require
$path_to_comments_folder . "includes/template/divider2.txt"; //display divider
if (cmtx_is_form_enabled(true)) { //if form is enabled
require $path_to_comments_folder . "includes/template/form.php"; //display form
}

If you want to display the form first then it would be:
PHP Code:
<?php 
if (cmtx_is_form_enabled(true)) { //if form is enabled
require $path_to_comments_folder . "includes/template/form.php"; //display form
}
if (
$settings->enabled_social) {
require
$path_to_comments_folder . "includes/template/divider1.txt"; //display divider
require $path_to_comments_folder . "includes/template/social.php"; //display social
}
require
$path_to_comments_folder . "includes/template/divider2.txt"; //display divider
require $path_to_comments_folder . "includes/template/comments.php"; //display comments

Then change the text in the admin panel in Layout -> Top and Layout -> Divider.

I plan to re-add the setting to position everything. There were bugs so that's why it was temporarily removed.

Have you completed the interview?
Reply
#10

That was easy. Even I understood Cool
Thanks, Steven

Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by Tim
06-Jan-2021, 08:56 PM
Last Post by Tim
18-Oct-2019, 11:45 AM
Last Post by Gevill
23-Jul-2019, 01:17 AM
Last Post by Steven
16-Feb-2018, 09:15 AM
Last Post by Wendon
20-Nov-2017, 03:36 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)