27.Temmuz.2023, 11:37
#1 Durumu
Çevrimdışı
Youtube'den Çektiğimiz Konuları Arama Sonuçlarında Gösterme Makalelerinizde video kullanıyorsanız yada web siteniz bir video paylaşım sitesi ise, aşağıda verilmiş olan metaları kullanabilirsiniz.Bunun sayesinde web sitenize ait arama sonuçlarında eklemiş olduğunuz videolar da görünecektir.
engine/modules/show.full.php dosyasını açınız.
Bul;
PHP- Kodu:
$tpl -> compile ( 'content' );
Üstüne Ekle;
PHP- Kodu:
// OpenGraph XField Hack if ( ! isset( $xfieldsdata ) ) $xfieldsdata = xfieldsdataload( $row['xfields'] ); $social_tags['image'] = $xfieldsdata['cover']; $social_tags['type'] = 'video.other'; $social_tags['video'] = str_replace( array("watch?", "="), array("", "/"), $xfieldsdata['trailer'] ); $social_tags['video:height'] = "340"; $social_tags['video:width'] = "640"; $social_tags['video:type'] = "application/x-shockwave-flash"; $description = preg_replace( "#<!--TBegin(.+?)<!--TEnd-->#is", "", $row['short_story'] ); $description = preg_replace( "#<!--MBegin(.+?)<!--MEnd-->#is", "", $description ); $description = preg_replace( "'\[attachment=(.*?)\]'si", "", $description ); $description = preg_replace ( "#\[hide(.*?)\](.+?)\[/hide\]#is", "", $description ); $description = str_replace( "</p><p>", " ", $description ); $description = str_replace( """, "'", $description ); $description = strip_tags( $description, "<br>" ); $description = trim(str_replace( "<br>", " ", str_replace( "<br />", " ", str_replace( "\n", " ", str_replace( "\r", "", $description ) ) ) )); $description = dle_substr( $description, 0, 198, $config['charset'] ); if( ($temp_dmax = dle_strrpos( $description, ' ', $config['charset'] )) ) $description = dle_substr( $description, 0, $temp_dmax, $config['charset'] ); $social_tags['description'] = $description . ".."; // OpenGraph XField Hack
Burada
trailer ilave alanına eklenmiş olan youtube video linki.
Embed linkine dönüştürülüyor. Ayrıca manuel olarak
width ve
height bilgilerini giriyoruz. Ayrıca
description alanı için
short_story 'yi kullanıldığını belirteyim.
Image bilgisi ise
cover adlı ilave alandan çekilmektedir.