Jump to content

WHMCS announcement code doesn't work :(


sequencehost

Recommended Posts

Hello,

 

I've been trying to make use of WHMCS's announcements code (displays announcements of non WHMCS PHP pages) but it doesn't work for me:

 

<?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>';
}
?>

 

I've changed support to the name of my WHMCS directory to no avail.

 

Is this code no longer valid?

 

Thanks.

Link to comment
Share on other sites

Though I'm not yet on the latest version, on previous versions that code works if you use full paths.

Yours:

include("support/dbconnect.php");

Working version (change both paths):

include("/home/user/www/support/dbconnect.php");

 

Thanks for your reply Bear. I also tried this yesterday but no luck unfortunately.

 

I can confirm that I'm using the latest version.

Link to comment
Share on other sites

Ah, I won't be able to test on the latest until I figure out how to continue using the heavily integrated Kayako login share. Odds are with the move to the newer version of Kayako (which I won't be using) that won't be possible and I'll need to use the built in desk. No time this week. ;)

Link to comment
Share on other sites

Ah, I won't be able to test on the latest until I figure out how to continue using the heavily integrated Kayako login share. Odds are with the move to the newer version of Kayako (which I won't be using) that won't be possible and I'll need to use the built in desk. No time this week. ;)

 

No worries Bear. Hopefully Matt will post a revised version of this code.

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