yamanoiさんのようにfacebookにホームページを貼り付けたいのですが、
なかなか上手くいきません。 ご指導お願い致します。
facebookの画面にconcrete5で作成したページを張り付ける方法
2012年2月9日 at 3:06
yamanoiです。
facebookアプリを作成して、その画面にconcrete5で作成したページのMain部分だけを張り付けてみました。
方法は、concrete5のページを読み込んでから必要な部分を取り出してhtmlを組み立てます。
facebookの中には、iframeで表示されます。
このとき、リンクをクリックしたときにiframeの中に表示されないようにtarget="_balank"を挿入しています。
なお、facebookアプリの作り方はネットでお調べください。
下のプログラムにはPHP Simple HTML DOM Parserが必要です。
http://simplehtmldom.sourceforge.net/
<?php
$url='http://www.yamanoi.org/concrete5/';
include_once('simple_html_dom.php');
$html = file_get_html($url);
foreach($html->find('a') as $a) {
$a->setAttribute('target','_blank');
}
$head = $html->find('head',0);
$body = $html->find('div[id=body]',0);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja">
<head>
<base href="<?php echo $url?>" />
<?php echo $head->innertext?>
</head>
<body style="height:auto">
<?php echo $body->innertext?>
</body>
</html>
タグ:
facebookの件
2012年2月27日 at 22:09
Your post has been saved and will be published after approval by the forum moderator.
みゅみゅ
Re: facebookの画面にconcrete5で作成したページを張り付ける方法
http://www.facebook.com/YamanoiLabo?sk=app_341976002501599
何が便利かって?
元のページを編集すれば、Facebookのページも自動で変わるということ
一度作れば、変更が簡単なこと
concrete5を編集するのは敷居が低い事