Jump to content

Announcements on a side box on website


RPS

Recommended Posts

  • 6 months later...
  • 9 years later...

Had some free time while waiting for a server to do backup to do database repairs on after data center lost power some how (PM still awaiting), so here you go:

<?php


use WHMCS\Application;
use WHMCS\Database\Capsule;

require("../init.php");

$Announcements = localAPI('GetAnnouncements', [] );

if ($Announcements['result'] === 'success')
{
    foreach($Announcements['announcements']['announcement'] as $announcement)
    {
        ?>
        <div class="announcement" id="announce-<?=$announcement['id']?>">
            <h5><?=$announcement['title']?></h5>
            <p class="announcement-body" id="announce-body-<?=$announcement['id']?>">
                <?=$announcement['announcement']?>
            </p>
            <div><small>Date Posted: <?=$announcement['date']?></small></div>
        </div>
        <?php
    }

}

tweak as needed but that should work for the most part out of box .

Link to comment
Share on other sites

  • 1 month later...

thanks

On 7/9/2021 at 2:27 PM, steven99 said:

Had some free time while waiting for a server to do backup to do database repairs on after data center lost power some how (PM still awaiting), so here you go:


<?php


use WHMCS\Application;
use WHMCS\Database\Capsule;

require("../init.php");

$Announcements = localAPI('GetAnnouncements', [] );

if ($Announcements['result'] === 'success')
{
    foreach($Announcements['announcements']['announcement'] as $announcement)
    {
        ?>
        <div class="announcement" id="announce-<?=$announcement['id']?>">
            <h5><?=$announcement['title']?></h5>
            <p class="announcement-body" id="announce-body-<?=$announcement['id']?>">
                <?=$announcement['announcement']?>
            </p>
            <div><small>Date Posted: <?=$announcement['date']?></small></div>
        </div>
        <?php
    }

}

tweak as needed but that should work for the most part out of box .

thank youuuu. it work perfect. is it possible to prepare a php code for loading knowledge base too?

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