ryans Posted October 1, 2015 Share Posted October 1, 2015 This script will let you make your own pages out of your announcements. Here is how to do it. create articles.php and put in this code. Upload it to your root whmcs directory <?php define("CLIENTAREA", true); //define("FORCESSL", true); // Uncomment to force the page to use https:// require("init.php"); $ca = new WHMCS_ClientArea(); $ca->setPageTitle("Articles"); $ca->addToBreadCrumb('index.php', $whmcs->get_lang('globalsystemname')); $ca->addToBreadCrumb('mypage.php', 'Article'); $ca->initPage(); //$ca->requireLogin(); // Uncomment this line to require a login to access this page # To assign variables to the template system use the following syntax. # These can then be referenced using {$variablename} in the template. $ca->assign('variablename', $value); # Check login status if ($ca->isLoggedIn()) { # User is logged in - put any code you like here # Here's an example to get the currently logged in clients first name $result = mysql_query("SELECT firstname FROM tblclients WHERE id=" . $ca->getUserID()); $data = mysql_fetch_array($result); $clientname = $data[0]; $ca->assign('clientname', $clientname); } else { # User is not logged in } $id = intval($_GET['id']); $query = "SELECT * FROM `tblannouncements` WHERE `id` = {$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); } $ca->assign('announcement', $announcement); # Define the template filename to be used without the .tpl extension $ca->setTemplate('article'); $ca->output(); Then create an articles.tpl file and upload that to your theme directory. It's very short code. {$announcement} <br><br><center>Article Mods by <a href=http://norcalhelpdesk.com target=new>NCHD</a></center> Access your articles by going to your site.com/articles.php?id=1 or whatever your id # is for your article. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.