Jump to content

Knowledgebase Search and Popular Articles


RevenueHosting

Recommended Posts

Is there no answers for this? I do not really need the top knowledgebase articles, just a form to be able to search them from the main homepage.tpl.

 

Anyone? Everyone?

 

This one is easiest:

<!-- KB search -->
<br />
<h2>{$LANG.knowledgebasesearch} {$LANG.knowledgebasetitle}</h2>
<form method="post" action="knowledgebase.php?action=search">
 <p align="center">
   <input type="text" name="search" size="40" /> <input type="submit" value="{$LANG.knowledgebasesearch}" />
 </p>
</form>
<!-- /KB search -->

Just paste that at the bottom of homepage.tpl.

 

Merry Christmas,

Rick & Uberhost

Edited by uberhost
Typo
Link to comment
Share on other sites

This code block is for the top 5 KB articles. I've tested this and have it running on our homepage.tpl which anyone here is welcome to take a look at by going to http://www.uberhost.com and then to the Support link.

 

<!-- KB most popular -->
<br />
<h2>Our 5 {$LANG.knowledgebasepopular} {$LANG.knowledgebasetitle} {$LANG.knowledgebasearticles}</h2>
{php}
$topnum = 0;
$query = "SELECT * FROM tblknowledgebase ORDER BY views DESC LIMIT 0,5"; 
$result = mysql_query($query);
while ($data = mysql_fetch_array($result)) {
$topnum++;
$id = $data["id"];
$title = $data["title"];
$article = $data["article"];
$views = $data["views"];
$useful = $data["useful"];
$votes = $data["votes"];
$private = $data["private"];
$parentid = $data["parentid"];
$language = $data["language"];
 echo("<p><strong>".$topnum.". $title</strong><br>$article</p>");
}
{/php}
<!-- /KB most popular -->

 

Merry Christmas,

Rick & Uberhost

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated