Sophia Posted October 30, 2009 Share Posted October 30, 2009 Hi everybody I have a silly problem: There is an announcements block on the index.php. I looked at the code, it says {if $announcements} <h2>{$LANG.latestannouncements}</h2> <p>{$announcements.0.date} - <a href="{if $seofriendlyurls}announcements/{$announcements.0.id}/{$announcements.0.urlfriendlytitle}.html{else}announcements.php?id={$announcements.0.id}{/if}">{$announcements.0.title}</a><br />{$announcements.0.text|strip_tags|truncate:100:"..."}</p> {/if} I want to show the announcements in another page within the WHMCS system. I created the welcome.php and welcome.tpl, all went well and the html content I put in the tpl file shows up, no problem. However, the announcements do NOT show up. I deleted the {if $announcements} and {/if} just to see what happens then, and it does say "Latest announcements", but the actual announcement does not show up except the dash. On the index.php it does. Any ideas what I did wrong? Oh I'm using Whmcs v4.1.1 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted October 31, 2009 WHMCS Support Manager Share Posted October 31, 2009 http://wiki.whmcs.com/Linking_to_WHMCS#Showing_Announcements_on_your_Site 0 Quote Link to comment Share on other sites More sharing options...
Sophia Posted October 31, 2009 Author Share Posted October 31, 2009 Thanks so much I was under the impression because this page is WITHIN the system, I could use the same code... However, I am still getting no announcements? I used the code as is, because whmcs is in the folder "support". 0 Quote Link to comment Share on other sites More sharing options...
WHMCS Support Manager WHMCS John Posted November 1, 2009 WHMCS Support Manager Share Posted November 1, 2009 Yes you will need to adjust the paths according to your setup. 0 Quote Link to comment Share on other sites More sharing options...
Sophia Posted November 1, 2009 Author Share Posted November 1, 2009 Thanks again for the reply My whmcs system is situated in the folder "support" right under public_html/, so I figured I did not need to change anything. I did add a slash before the /support/etc just to make sure the path is right. I get no error messages, announcements just don't show up whereas they do show up on the portal page. Very very strange indeed... I'm sure I am doing something wrong But what? I tried this code: <?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>"); } ?> then I also changed it to <?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>"); } ?> Oh, and I did not use any custom table prefixes or anything, installation was out of the box. 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.