PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : قرار دادن rss در صفحه php



saeed.spore
July 11th, 2012, 19:25
سلام دوستان من میخوام مثل این سایت سرور مجازی ویندوز - تک کلود (http://takcloud.com/vps-windows.php) در یه صفحه php به rss whmcs متصل کنم میشه کدی را معرفی کنید حالت list بزاره مرسی

saeed.spore
July 11th, 2012, 20:00
کسی نیست ؟

saeed.spore
July 11th, 2012, 20:13
aalooooo

saeed.spore
July 11th, 2012, 21:02
8-|

MihanTech
July 11th, 2012, 23:16
به الو الو نیاز نیست . باید کمی صبر میکردید !


<?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 &amp; announcements: <a href="/whmcs/announcements.php">view more</a></p>';
if($x) echo '<p>There are no new announcements.</p>';
?>