به الو الو نیاز نیست . باید کمی صبر میکردید !

کد 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 ($date04); 
    
$month substr ($date52); 
    
$day substr ($date82); 
    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>'
?>