
02-07-2008, 19:45:09
|
| |
Arkadaşın dediğim gibi str replace i önermiş
smarty hiç kullanmadım.içine fonksiyon alıyordur inşallah PHP- Kodu: <div style='border:1px solid #c0c0c0;width:375px;height:175px;'>
<table width="100%" height="169" border="0" cellpadding="5" cellspacing="0">
<tr>
<td width="180" height="30" bgcolor="#ACABB0"><strong><font color="#FFFFFF">:: Haberler</font></strong></td>
</tr>
<tr>
<td height="140" align="left" valign="top" bgcolor="#EEEEEE">
{php}
function osmanaga($newphrase) {
$newphrase = str_replace("Ü","Ü",$newphrase);
$newphrase = str_replace("Åz","Ş",$newphrase);
$newphrase = str_replace("Äz","Ğ",$newphrase);
$newphrase = str_replace("Ç","Ç",$newphrase);
$newphrase = str_replace("İ","İ",$newphrase);
$newphrase = str_replace("Ö","Ö",$newphrase);
$newphrase = str_replace("ü","ü",$newphrase);
$newphrase = str_replace("ÅŸ","ş",$newphrase);
$newphrase = str_replace("ç","ç",$newphrase);
$newphrase = str_replace("ı","ı",$newphrase);
$newphrase = str_replace("ö","ö",$newphrase);
$newphrase = str_replace("ÄŸ","ğ",$newphrase);
return $newphrase;
}
$icerik = file_get_contents("http://blog.ni.net.tr/feed/atom/");
$icerik = str_replace(array("\n","\r"), "", $icerik);
preg_match_all('#<title type="html"><(.*?)></title>#si',$icerik,$bulsana,PREG_SET_ORDER);
preg_match_all('#<link rel="alternate" type="text/html" href="(.*?)" />#si',$icerik,$hooyt,PREG_SET_ORDER);
$sayabi=count($bulsana);
for($fatal=0;$fatal<=$sayabi;$fatal++)
{
$baslik=$bulsana[$fatal][1];
$baslik=str_replace("![CDATA[","",$baslik);
$baslik=str_replace("]]","",$baslik);
$baslik = osmanaga($baslik);
echo "<img src=\"images/announcement.gif\" width=\"17\" height=\"17\" class=\"image\" /> <a href=\"".$hooyt[$fatal+1][1]."\">$baslik</a>"; echo"<br>";
}
{/php}
</td>
</tr>
</table>
|