cyberturk Posted April 8, 2007 Share Posted April 8, 2007 Hello I need to insert announcemnents topics/subjects to my HTML homepage. If it is possible i need to add link to all of the subjects to the announcment page. How can i do it? 0 Quote Link to comment Share on other sites More sharing options...
skshost Posted April 8, 2007 Share Posted April 8, 2007 I did the same thing, just use this: http://support.whmcs.com/knowledgebase.php?action=displayarticle&catid=7&id=18 and make the needed changes. 0 Quote Link to comment Share on other sites More sharing options...
cyberturk Posted April 8, 2007 Author Share Posted April 8, 2007 i made that but i dont need the news itself only subjects with links. so i am asking for needed changes 0 Quote Link to comment Share on other sites More sharing options...
Idealws Posted April 18, 2007 Share Posted April 18, 2007 Hello cyberturk, Here is a modified version of the script which will only show the title and the date. Once clicked it will show the announcement underneath the annoucenments. <?php include("clients/configuration.php"); include("clients/includes/functions.php"); $link = mysql_connect($db_host,$db_username,$db_password); mysql_select_db($db_name); $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(" <a href=\"$_SERVER[php_SELF]?show=1&id=$id\"><font color=#cccccc>$date</font> - [b]$title[/b]</a></p>"); } // You can make the announcement show on a different page // by putting the below in a different file and changing // where is says $_SERVER[php_SELF] to the url of the // file you have made. if($show) { $id = $_GET['id']; $query = "SELECT * FROM tblannouncements WHERE id='$id' 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(" $announcement</p>"); } } ?> Hope this helps. Regards, Ray 0 Quote Link to comment Share on other sites More sharing options...
FavHost Posted August 14, 2007 Share Posted August 14, 2007 @idealws - this script doesnt seem to work properly. When I click the link, it doesnt open it, but it seems to refresh the page though. 0 Quote Link to comment Share on other sites More sharing options...
rodeoXtreme Posted September 6, 2007 Share Posted September 6, 2007 Great scripts but it seems that I can't even call the DB so I guess it does not work. The only output on our HTML homepage is $date - $title $announcement"); } ?> any suggestions would be greatly appreciated. 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.