1 (edited by 2008-08-18 19:32:09)

Topic: [HACK] Position comments & comment form

Name: Position comments & comment form
Author: eyece
CuteNews Compatibility: 1.3.6 - * (no incompatibility reported yet)
Description: i have seen a few people asking how to change the order that the comments & comment form are added to the page, so heres a mod that allows you to pick where to include them in the full story template using {comments}, {comments-form} and {comments-pagination}
Instructions:

inc/shows.inc.php
find:

echo $output;
                                        $showed_comments++;

replace:

$comments_output .= $output;
                                        $showed_comments++;


find:

    if        (!$no_prev or !$no_next){
            echo $prev_next_msg;
    }

replace:

    if        (!$no_prev or !$no_next){
            $comments_pagi_output = $prev_next_msg;
    }


find:

echo"<form  $CN_remember_form  method=\"post\" name=\"comment\" id=\"comment\" action=\"\">".$template_form."<div><input type=\"hidden\" name=\"subaction\" value=\"addcomment\" /><input type=\"hidden\" name=\"ucat\" value=\"$ucat\" /><input type=\"hidden\" name=\"show\" value=\"$show\" />$user_post_query</div></form>
                    \n $CN_remember_include";

replace:

$comments_form_output = "<form  $CN_remember_form  method=\"post\" name=\"comment\" id=\"comment\" action=\"\">".$template_form."<div><input type=\"hidden\" name=\"subaction\" value=\"addcomment\" /><input type=\"hidden\" name=\"ucat\" value=\"$ucat\" /><input type=\"hidden\" name=\"show\" value=\"$show\" />$user_post_query</div></form>
                    \n $CN_remember_include";
if(!$allow_full_story){echo $comments_output.$comments_pagi_output.$comments_form_output;}


find:

$output = replace_news("show", $output);

                        echo $output;

replace:

                        $output = replace_news("show", $output);
                        $output = str_replace("{comments}", $comments_output, $output);
                        $output = str_replace("{comments-form}", $comments_form_output, $output);
                        $output = str_replace("{comments-pagination}", $comments_pagi_output, $output);
                        echo $output;


next move the entire "Show Full Story" section of shows.inc.php down to below the "Show Comments" section

then your done http://cutephp.com/forum/style_emoticons/default/smile.gif now you can position the comments, comment form & pagination to anywhere in your full-story template in any order
if anyone has any addons, requests, problems, just ask

note: if the full story is not showen with the comments, the comments will go back to default order/position, so "Show Full Story When Showing Comments" in system config should be set to yes