腦友記廣場 -> 新手上路 -> 中環博客 登錄 -> 註冊 -> 回復主題 -> 發表主題

yuenlong 2006-08-22 00:46
成日睇 a m 7 3 0 ,有陣時取不到中環博客都想睇下佢寫乜。

http://centralblogger.blogspot.com

我見都唔多難,但係用簡單的一招都顯示不到內容,唔知係 encode 錯定係邊度出問題哩

請指教一下,謝謝

http://www.......ctblog.php



<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>中環博客</title>
</head>
<body>
中環博客 Central Blogger<hr>
<?
$requesturl = "http://centralblogger.blogspot.com";
if ($fp = fopen("$requesturl","r")){
  while(!feof($fp))
  {
    $line = $line.fgets($fp,256);
  }
  fclose($fp);
}
eregi("$(.*)$",$line,$matches);

$line=$matches[1];
$allowed_tags = "<b>,<p>,<br>";
$line = strip_tags($line, $allowed_tags);
$line="<br>".$line."<hr><br>";
echo($line);
?>
powered by ManInNet - Central Blogger 1.0
</body></html>



人手響 IE 轉番去 Big-5 decode ,就顯示到 header, footer ,內容都係唔出來

QUOTE:
中環博客 Central Blogger
--------------------------------------------------------------------------------


--------------------------------------------------------------------------------

powered by ManInNet - Central Blogger 1.0

maninnet 2006-08-23 20:52
eregi("$(.*)$",$line,$matches);

關鍵之處就係呢度:
eregi("<body>(.*)</body>",$line,$matches);

$ 是表示最後一個字元. 最後一個字元同最後一個字元之間, 一定沒內容. 所以用 <body> 同 </body>

yuenlong 2006-08-23 23:44
哎吔,一路自己都錯用了 $ 哩

我用以下哩句,較果好一點,亦同時完成制作了,謝謝
eregi("<!-- Begin #main - Contains main-column blog content -->(.*)<!-- End #main -->",$line,$matches);


QUOTE:

<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>中環博客 Central Blogger </title>
</head>
<body>
中環博客 Central Blogger <hr>
<?
$requesturl = "http://centralblogger.blogspot.com";
if ($fp = fopen("$requesturl","r")){
  while(!feof($fp))
  {
    $line = $line.fgets($fp,256);
  }
  fclose($fp);
}
eregi("<!-- Begin #main - Contains main-column blog content -->(.*)<!-- End #main -->",$line,$matches);

$line=$matches[1];
$allowed_tags = "<b>,<p>,<br>,<h3>,<hr>";
$line=eregi_replace("<!-- End .post -->","<hr>",$line);
$line = strip_tags($line, $allowed_tags);
$line="<br>".$line."<br>";
echo($line);
?>
powered by ManInNet - Central Blogger 1.0
</body></html>

liondog 2007-04-18 14:14
非常多謝, 我好鍾意睇LEE 個BLOG, 我試到個BODY 亂碼, 唔係知係咪我部機SETTING 問題?

可唔可以 整埋CK BLOG?
http://manincentral.blogspot.com/

我用上面個SOURCE CODE 但轉O左條 LINK唔WORK......


查看完整版本: [-- 中環博客 --] [-- top --]


Powered by PHPWind v4.0.1 Code © 2003-05 PHPWind
Gzip enabled

You can contact us