function render_nodes($nodes, $i, $currentnode) { global $user, $base_path; foreach ($nodes as $node) { $margin = $i * 20; $query = db_query("SELECT name FROM users WHERE uid = " . $node->uid); $created_by = $query->fetchCol(); $language = $node->language; if (!empty($node->field_alias[$language][0]['value'])) { $node->title = $node->field_alias[$language][0]['value']; } if (strlen(strip_tags($node->title)) >= 50) { $title = strip_tags(substr($node->title, 0, 50)) . '...'; } else { $title = strip_tags(substr($node->title, 0, 50)); } ?> <?php if ($node->nid == $currentnode->nid) { ?> <strong><i><?php } ?> <li> <?php if (isset($title) && $title != '') { echo "<span><a href='" . $base_path . "helptopics/" . $node->nid . "'>" . $title . "</a></span>"; } ?> <?php if ($node->nid == $currentnode->nid) { ?> </strong></i><?php } ?> <?php if (!empty($node->child_data)) { ?> <ul><?php $i++; render_nodes($node->child_data, $i, $currentnode); $i--; ?> </ul><?php } ?> </li><?php } }
function render_nodes($nodes, $i) { global $user; foreach ($nodes as $node) { $margin = $i * 20; $query = db_query("SELECT name FROM users WHERE uid = " . $node->uid); $created_by = $query->fetchCol(); $language = $node->language; ?> <div class="clear"></div> <div style="padding-left:<?php echo $margin; ?> px; border-bottom:#CCCCCC solid 1px; padding-bottom:10px; padding-top:10px; display:block;" class="rply-hover"> <p style="width:<?php echo 415 - $margin; ?> px;"><strong><i><?php if (isset($node->title) && $node->title != '') { echo $node->title; } ?> </i></strong></p> <p><strong><?php echo date('F d, Y', $node->created) . ' at' . date(' g:ia', $node->created); ?> </strong></p> <p><strong>Posted by: <?php echo $created_by[0]; ?> </strong></p> <p><?php if (isset($node->field_comment_body[$language][0]['value'])) { echo $node->field_comment_body[$language][0]['value']; } ?> </p> <?php if (!empty($node->field_comment_attchement[$language])) { $attchement = file_create_url($node->field_comment_attchement[$language][0]['uri']); ?> <p><a href="<?php echo $attchement; ?> "><?php echo $node->field_comment_attchement[$language][0]['filename']; ?> </a></p><?php } ?> <?php if ($user->uid >= 1) { ?> <span class="rply-btn"><a href="javascript:void(0);" onclick="reply(<?php echo $node->nid; ?> );" class="red-btn">Post Comment</a></span> <?php } ?> <div class="clear"></div> <div class="rply-form" id="reply-<?php echo $node->nid; ?> " style="display:none; border:0px;"></div> </div> <?php if (!empty($node->child_data)) { $i++; render_nodes($node->child_data, $i); $i--; } } }
function render_nodes($nodes, $i, $currentnode) { global $user, $base_path; foreach ($nodes as $node) { $margin = $i * 20; $query = db_query("SELECT name FROM users WHERE uid = " . $node->uid); $created_by = $query->fetchCol(); $language = $node->language; if (!empty($node->field_alias[$language][0]['value'])) { $node->title = $node->field_alias[$language][0]['value']; } if (strlen(strip_tags($node->title)) >= 50) { $title = strip_tags(substr($node->title, 0, 50)) . '...'; } else { $title = strip_tags(substr($node->title, 0, 50)); } ?> <div class="clear"></div> <div style="padding-left:<?php echo $margin; ?> px; display:block;" class=""> <?php if ($node->nid == $currentnode->nid) { ?> <strong><i><?php } ?> <li> <p style="width:<?php echo 415 - $margin; ?> px;"><?php if (isset($title) && $title != '') { echo "<a href='" . $base_path . "helptopics/" . $node->nid . "'>" . $title . "</a>"; } ?> </p> </li> <?php if ($node->nid == $currentnode->nid) { ?> </strong></i><?php } ?> <div class="clear"></div> <div class="rply-form" id="reply-<?php echo $node->nid; ?> " style="display:none; border:0px;"></div> </div> <?php if (!empty($node->child_data)) { ?> <ul><?php $i++; render_nodes($node->child_data, $i, $currentnode); $i--; ?> </ul><?php } } }