Jump to content

Announcement in html file


HostinPK

Recommended Posts

there are at least three ways I can think of...

 

1. writing a Data Feed to query the database and then output the announcements in your preferred format...

 

http://docs.whmcs.com/Data_Feeds

 

2. there is some code on the WHMCS documentation site that could be used as a starting point - though dbconnect.php has been deprecated, so you may need to make some tweaks at the start of the code.

 

http://docs.whmcs.com/Linking_to_WHMCS#Displaying_Announcements_on_your_Site

http://docs.whmcs.com/Version_6.0_Release_Notes#Removal_of_Dbconnect.php

 

3. perhaps by using the announcementsrss.php file and using external software to output this in the format you want on your site.

Link to comment
Share on other sites

The code provided no longer works. The have removed the dbconnects.php And changed the trigger. The following works for me.

 

        <?php
include("WHMCSDirectory/init.php");
include("WHMCSDirectory/includes/functions.php");
$query = "SELECT * FROM tblannouncements WHERE published='1' ORDER BY date DESC LIMIT 0,1"; 
$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><br />'.$announcement.'';
}
?>

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