Jump to content

Create Content Pages Using Your Announcements


ryans

Recommended Posts

I looked around at some content management systems for whmcs and they are nice but I don't quite feel like shelling out $30-50 so I decided to write my own.

 

You can use your Announcement section to make pages for your whmcs. Here is how to do it.

 

Create an announcement page and don't publish it. Once it's save mouse over and get the ID #. Remember the number.

 

Then read this page and grab the code to create your php page. Lets say you want to create a page called business.php. Grab the code from that site and paste it into your text editor and name it business.php. Upload that file to your whmcs directory.

 

Now create the template page. business.tpl

 

Paste this code in there and just change ID=5 to whatever the ID is of your announcement page

 

 


<div class="internalpadding announcements">
<div class="styled_title">
	<h2>Business Solutions</h2>
</div>
<br><br>
{php}
$query = "SELECT * FROM `tblannouncements` WHERE `id` = 5";
$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>'.$announcement.'</p>';
}
{/php}
<br><br>
</div>

 

Upload the tpl file to your templates/theme folder. You can look at the other tpl files to get the page to look correctly.

 

the go to http://yoursite/whmcs/business.php and it should show up.

 

I even use this on my homepage.

Edited by Infopro
Modifed Title
Link to comment
Share on other sites

I updated the script. Use this code and now you can pull up your articles with just like this:

http://yoursite.com/whmcs/page.php?id=5 or 1 or 2, whatever your article ID is.

 

{php}

    $query = "SELECT * FROM `tblannouncements` WHERE `id` = {$_GET['id']} ";

    $result = mysql_query($query);

    while ($data = mysql_fetch_array($result)) {

        $id = $_GET['id'];

        $date = $data["date"];

        $title = $data["title"];

        $announcement = $data["announcement"];

        $date = fromMySQLDate($date);

        echo '<p>'.$announcement.'</p>';

      }

      {/php}

Link to comment
Share on other sites

  • 8 months 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