KyMyHuCT Posted August 23, 2014 Share Posted August 23, 2014 how to spend the last posts of announcements and knowledgebase on index page,on footer 0 Quote Link to comment Share on other sites More sharing options...
Cain72 Posted August 23, 2014 Share Posted August 23, 2014 Hi KyMyHuCT, i'd look at something like a tickatape system or news tape, and just post the last two or so lines from the announcments or knowledge base list, that way it would be dynamic and you wouldnt need to update it constantly just an idea Cain 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted August 24, 2014 Share Posted August 24, 2014 if you don't have access to the {$announcements} and kb arrays in the footer, there is some code on the documentation web site that you can use to add announcements to any page... http://docs.whmcs.com/Linking_to_WHMCS#Displaying_Announcements_on_your_Site You can display the announcements on any page of your site using the code below. This will display the latest 3 announcements set to published status. <?php include("support/dbconnect.php"); include("support/includes/functions.php"); $query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3"; $result = mysql_query($query); while ($data = mysql_fetch_array($result)) { $id = $data["id"]; $date = $data["date"]; $title = $data["title"]; $announcement = $data["announcement"]; $date = fromMySQLDate($date); echo '<p><font color="#cccccc">'.$date.'</font> - <b>'.$title.'</b><br />'.$announcement.'</p>'; } ?> You should replace the word support in the first two lines where it includes files from the WHMCS folder with the path to your WHMCS directory. I suspect if you were adding this to an existing whmcs template page (.tpl), you wouldn't likely need the two include lines and wrap it in {php} tags instead... {php} $query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC LIMIT 0,3"; $result = mysql_query($query); while ($data = mysql_fetch_array($result)) { $id = $data["id"]; $date = $data["date"]; $title = $data["title"]; $announcement = $data["announcement"]; $date = fromMySQLDate($date); echo '<p><font color="#cccccc">'.$date.'</font> - <b>'.$title.'</b><br />'.$announcement.'</p>'; } {/php} that should show your latest announcements, and you should be able to modify it (by changing tblannouncements to tblknowledgebase and some of the fields) to show kb articles too. 0 Quote Link to comment Share on other sites More sharing options...
serqan Posted May 17, 2021 Share Posted May 17, 2021 Hi brian! How do we get the URL address of Announcements? I would like to add as a link. 0 Quote Link to comment Share on other sites More sharing options...
serqan Posted May 17, 2021 Share Posted May 17, 2021 I think I found the solution to the problem. thanks. <a href="announcements.php?id='.$id.'"> 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.