ต้องสร้าง og:image ครับ เฟสบุคมันจะดึงตรงนี้ ลองดูMod ตัวนี้ เห็นว่าใช้ได้ตั้งแต่ 1.0RC1
http://custom.simplemachines.org/mods/index.php?mod=4117 หรือลองเอาโค้ดนี้ไปลอง manual ดูครับ
/Themes/your_theme/index.template.phpSearch:
// Output any remaining HTML headers. (from mods, maybe?)
Replace with:
// OG image
if (isset($context['og_image']))
echo '<meta property="og:image" content="' . $context['og_image'] . '" />';
else
echo '
<meta property="og:image" content="url of your default forum image for topics with no image at all" />';
// Output any remaining HTML headers. (from mods, maybe?)
/Sources/Display.phpSearch:
// Get all the important topic info.
$request = $smcFunc['db_query']('', '
SELECT
t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.id_poll,
Replace with:
// Get all the important topic info.
$request = $smcFunc['db_query']('', '
SELECT
t.num_replies, t.num_views, t.locked, ms.subject, t.is_sticky, t.id_poll, ms.body,
Search:
// Add up unapproved replies to get real number of replies...
Replace with:
// OG image
$aux = preg_match_all('/\[img.*\](.+)\[/img\]/i', $topicinfo['body'], $aux2);
if (!empty($aux2[1][0]) && !isset($context['og_image']))
$context['og_image'] = $aux2[1][0];
// Add up unapproved replies to get real number of replies...
And this should make your forum set the image for Facebook and any other page that uses OpenGraph.
https://www.simplemachines.org...unity/index.php?topic=547326.0 ข่อยซอยดั้ยซั้มนี่เด้อ (ผมช่วยได้เท่านี้)