Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

TIP:: Adding render_comments To Old Themes

Asked Modified Viewed 3,654 times
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
asked
Fusioneer

TIP:: Adding render_comments To Old Themes

render_comments was a new feature added to themes and it will need added into old themes.

Simply add this copy from Stylo Theme to your old theme.php.
It should be placed somewhere in between function render_page($license = false) {} but not in between any other theme functions...

function render_comments($c_data, $c_info){
   global $locale, $settings;

   if (!empty($c_data)){
      echo "<div class='comments floatfix'>\n";   
       echo "<div style='margin-bottom: 15px;' class='floatfix'>\n";
      $c_makepagenav = '';
    if ($c_info['c_makepagenav'] !== false) { echo $c_makepagenav = "<div class='flleft'>".$c_info['c_makepagenav']."</div>\n"; }
   if ($c_info['admin_link'] !== false) { echo "<div class='flright'>".$c_info['admin_link']."</div>\n"; }
      echo "</div>\n";
      
      echo "<div class='comment-main'>\n";
   foreach($c_data as $data) {
         $comm_count = "<a href='".FUSION_REQUEST."#c".$data['comment_id']."' id='c".$data['comment_id']."' name='c".$data['comment_id']."'>#".$data['i']."</a>";
   if ($settings['comments_avatar'] == "1") {
       echo "<div class='comment-avatar-wrap'>".$data['user_avatar']."</div>\n";
   }
        echo "<div class='comment'>\n";
      echo "<div class='flright'>".$comm_count."\n</div>\n";
      echo "<div class='user'>".$data['comment_name']."\n";
      echo "<span class='date small'>".$data['comment_datestamp']."</span>\n";
      echo "</div>\n";
      echo "<div class='comment-body'><p>".$data['comment_message']."</p></div>\n";
   if ($data['edit_dell'] !== false) { echo "<span class='comment_actions'>".$data['edit_dell']."\n</span>\n"; }
      echo "</div>\n";
   }
      echo "</div>\n";
      
      echo $c_makepagenav;
      echo "</div>\n";

   } else {
       echo "<div class='nocomments-message spacer'>".$locale['c101']."</div>\n";
   }

}


Then add the style to your old themes styles.css and adjust accordingly to suit your theme...

.nocomments-message {
    font-size: 12px;
   color: #555;
   background: #fff;
   border-top: 2px solid #ddd;
   border-bottom: 2px solid #ddd;
   padding: 15px 0 15px 50px;
}

.comment-avatar-wrap {
    float: left;
   padding: 10px 20px 10px 0;
   position: relative;
}

.comment-avatar-wrap:after {
    content: "";
   position: absolute;
   right: 0;
   top: 15px;
   width: 0;
   height: 0;
   border-right: 6px solid #121212;
   border-top: 6px solid transparent;
   border-bottom: 6px solid transparent;
   border-right-color: #dfdfdf;
}

.comment-main {
   position: relative;
}

.comment {
    overflow: hidden;
   position: relative;
   margin: 0 0 15px 0;
   padding: 10px 20px;
   border-radius: 3px;
   background: #f0f0f0;
   border: 1px solid #dfdfdd;
}

.comment .user {
    line-height: 1.3;
   overflow: hidden;
}

.comment .user .date {
    display: block;
   color: #666;
   font-size: 11px;
}


Now comments should be nice in old themes.
Edited by Jib on 10-03-2014 18:24,
0 replies

4 posts

F
Falk
F
Falk 148
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
answered
Super Admin

:G
0 replies
— 6 months later —
H
hervan
H
hervan 10
sorry my english is very bad
  • Member, joined since
  • Contributed 93 posts on the community forums.
  • Started 37 threads in the forums
answered
Member

sample image?
0 replies
C
Craig
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
answered
Fusioneer

Just comments man, you know what they look like. :D
0 replies
H
hervan
H
hervan 10
sorry my english is very bad
  • Member, joined since
  • Contributed 93 posts on the community forums.
  • Started 37 threads in the forums
answered
Member

:G
0 replies

Category Forum

Themes Support

Labels

None yet

Statistics

  • Views 0 views
  • Posts 4 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

F
F
Falk 148
Need help?, Having trouble?
• View our Documentation for Guides, Standards and Functions
• Name and Organize your Topics and Content correctly in the corresponding Forums for best support results
• Attaching Log Files and Screenshots when reporting issues will help
• Provide with an URL to live example if one exists
• Please read the How to Report an Error post
• Please read and comply with the Code of Conduct

(¯·._.·(¯°·._.·°º*[ Project Manager ]*º°·._.·°¯)·._.·¯)
  • Super Admin, joined since
  • Contributed 6,201 posts on the community forums.
  • Started 639 threads in the forums
  • Answered 12 questions
C
C
Craig 14
  • Fusioneer, joined since
  • Contributed 4,462 posts on the community forums.
  • Started 212 threads in the forums
  • Started this discussions
H
H
hervan 10
sorry my english is very bad
  • Member, joined since
  • Contributed 93 posts on the community forums.
  • Started 37 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet