DigitalEnigma Posted August 29, 2007 Share Posted August 29, 2007 Hi, I have see the PHP code to display the announcements on our site home page but would like to know if there is a way to achieve the same on the main client area page? 0 Quote Link to comment Share on other sites More sharing options...
philip Posted September 23, 2007 Share Posted September 23, 2007 I try to achieve the same but unsuccessful. Does anybody have a solution? 0 Quote Link to comment Share on other sites More sharing options...
othellotech Posted September 23, 2007 Share Posted September 23, 2007 Hi, I have see the PHP code to display the announcements on our site home page but would like to know if there is a way to achieve the same on the main client area page? Just put the php in the template !?! 0 Quote Link to comment Share on other sites More sharing options...
philip Posted September 24, 2007 Share Posted September 24, 2007 I tried this php below: {php}include('http://mydomain.com/whmcs/news.php');{/php} (I also tried using path...but the page choked and stop.) It seems if I remove both include() in news.php then the page would go albeit the news.php would not producing anything if I do that. To sums up, I can't use include('configuration.php') & include('include/functions.php') in the news.php 0 Quote Link to comment Share on other sites More sharing options...
philip Posted September 29, 2007 Share Posted September 29, 2007 Can anyone tell me how to show latest announcement in clientarea homepage? 0 Quote Link to comment Share on other sites More sharing options...
Retired Forum Member WHMCS Joe Posted September 29, 2007 Retired Forum Member Share Posted September 29, 2007 Try this {php} // Get Articles with highest count $i=0; $client_query = "SELECT * FROM tblknowledgebase ORDER BY views DESC LIMIT 5"; $result = mysql_query($client_query); while($row = mysql_fetch_array($result)) { $kbmostviews_array[$i]['id'] = $row['id']; $kbmostviews_array[$i]['category'] = $row['category']; $kbmostviews_array[$i]['title'] = $row['title']; $kbmostviews_array[$i]['article'] = strip_tags($row['article']); $kbmostviews_array[$i]['views'] = $row['views']; $i++; } //Pass the values to smarty $this->assign('kbmostviews',$kbmostviews_array); {/php} <table width="90%" align="center" cellpadding=0 cellspacing=0> <tr> <td width="50%" valign=top> {$LANG.knowledgebasepopular} {$LANG.knowledgebasearticles}</p> <table width="100%"> {foreach key=num item=kbarticle from=$kbmostviews} <tr> <td> {$kbarticle.title} {$kbarticle.article|truncate:100:"..."} <font style="color:#A8A8A8;font-size:10px;">{$LANG.knowledgebaseviews}: {$kbarticle.views}</FONT> </td> </tr> {/foreach} </table></td> </tr> </table> Edit homepage.tpl 0 Quote Link to comment Share on other sites More sharing options...
philip Posted September 29, 2007 Share Posted September 29, 2007 Although your code is for KB article, I get the idea. Thanks Joe. 0 Quote Link to comment Share on other sites More sharing options...
Retired Forum Member WHMCS Joe Posted September 29, 2007 Retired Forum Member Share Posted September 29, 2007 Oops Please view this article >http://support.whmcs.com/knowledgebase.php?action=displayarticle&catid=7&id=18 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted October 3, 2007 Share Posted October 3, 2007 I just added that and changed out the support/ to my https secure/members and still I have nothing showing up even though there is one listed in the announcement area. Any suggestions? 0 Quote Link to comment Share on other sites More sharing options...
jerett Posted October 3, 2007 Share Posted October 3, 2007 Here is the code if you want to include Announcements on a Template page: {php} $query = "SELECT * FROM tblannouncements WHERE published='on' ORDER BY date DESC"; $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(" <font color=#cccccc>$date</font> - [b]$title[/b] $announcement</p>");} {/php} 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.