Comments Listing should be a custom list rather than using search
<p>For some reason when i listed the comments under posts on this site, i used the search function and then searched for the related uid, which maybe was easier at the time than adding an additional category to search.</p>
<p>When I did this it also recorded the uid in the search results which is annoying. </p>
<p>Now i need to change the list order on the comments and i cant as it will effect search so i need to redo it now anyway. So i should have just added an additional list type in the first place.</p>
<p>Current Search Code</p>
<h4>PHP</h4>
<pre><code class="php hljs">if($commentsviewenabled) {<br /> / rather than doing a search here it should be doing a comment list /<br /> $commentslist = $comments->listall(<br /> $start = 0,<br /> $max = 200,<br /> $listtype = "search",<br /> $templatefile = "relateddiscussions-full-list-item.html",<br /> $searchterm = $class->uid<br /> );<br /> //$template->set("relateddiscussions",$relateddiscussions);<br /> $pagecontent .= $commentslist;<br />}</code></pre>
<p>Added a custom list, not sure why i didnt just do this, as its quite easy. </p>
<h4>PHP</h4>
<pre><code class="php hljs">if($listtype == "comments") {<br /> $sql = "select * from $dbtablename where linkeduid = '$searchterm' order by insdate asc limit $start,$max";<br />} </code></pre>
<p>then just changed the listing type to comments rather than search</p>
<h4>PHP</h4>
<pre><code class="php hljs">if($commentsviewenabled) {<br /> $commentslist = $comments->listall(<br /> $start = 0,<br /> $max = 200,<br /> $listtype = "comments",<br /> $templatefile = "relateddiscussions-full-list-item.html",<br /> $searchterm = $class->uid<br /> );<br /> $pagecontent .= $comments_list;<br />}</code></pre>