Jump to content

announcements in footer


KyMyHuCT

Recommended Posts

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 6 years later...

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