سلام دوستان من میخوام مثل این سایت سرور مجازی ویندوز - تک کلود در یه صفحه php به rss whmcs متصل کنم میشه کدی را معرفی کنید حالت list بزاره مرسی
نمایش نسخه قابل چاپ
سلام دوستان من میخوام مثل این سایت سرور مجازی ویندوز - تک کلود در یه صفحه php به rss whmcs متصل کنم میشه کدی را معرفی کنید حالت list بزاره مرسی
کسی نیست ؟
aalooooo
8-|
به الو الو نیاز نیست . باید کمی صبر میکردید !
کد PHP:
<?php
$x=1; // requested edit
// truncate the text to only 65 chars, add ... to the end
function truncate($text) {
$text = substr($text,0,60);
$text = substr($text,0,strrpos($text,' '));
$text = $text."...";
return $text;
}
// format the date to mm/dd/yyyy
function formatdate($date) {
$year = substr ($date, 0, 4);
$month = substr ($date, 5, 2);
$day = substr ($date, 8, 2);
return $month.'/'.$day.'/'.$year;
}
// limit the number of announcements to return
$limit = 2;
require '/home/user/public_html/whmcs/configuration.php';
$link = mysql_connect($db_host,$db_username,$db_password);
mysql_select_db($db_name);
$result = mysql_query("SELECT * FROM tblannouncements WHERE published='on' ORDER BY id DESC LIMIT ".$limit);
while($data = mysql_fetch_array ($result))
{
$id = $data['id'];
$date = $data['date'];
$announcement = truncate($data['announcement']);
$date = formatdate($date);
echo'<p><span>'.$date.'</span> - '.$announcement.' <a href="/whmcs/announcements.php?id='.$id.'"><img src="/images/more.gif" alt="more info" /></a></p>';
echo'<hr />';
$x=false;
}
if(!$x) echo '<p>News & announcements: <a href="/whmcs/announcements.php">view more</a></p>';
if($x) echo '<p>There are no new announcements.</p>';
?>