Devam Ediyor

486663 Joomla share on Facebook preview thumbnail and text fix

We have Joomla [url removed, login to view] and we need a script to fix that problem:

when sharing a document on facebook the preview is set to the first image or the text it founds and that sometimes is not the same of the article.

I've found a script for wordpress but we need something similar for Joomla.

function set_default_image(){

global $post;

$image = str_img_src($post->post_content);

if($image != ""){

echo '<link rel="image_src" href="'. $image . '" />' . "\n";

}

}

add_action('wp_head', 'set_default_image');

function str_img_src($html) {

if (strpos($html, '<img') !== false) {

$imgsrc_regex = '#<\s*img [^\>]*src\s*=\s*(["\'])(.*?)\1#im';

preg_match($imgsrc_regex, $html, $matches);

unset($imgsrc_regex);

unset($html);

if (is_array($matches) && !empty($matches)) {

return $matches[2];

} else {

return false;

}

} else {

return false;

}

}

Beceriler: Her şey Kabul, Facebook Pazarlama, Joomla, Sosyal Ağ, WordPress

Daha fazlasını görün: facebook preview joomla, joomla facebook preview, joomla facebook share thumbnail fix, wordpress preview, problem of facebook, img wordpress, html 5 img, facebook for wordpress, facebook preview script, thumbnail, share facebook, sharing script wordpress, script facebook post, joomla link article, similar joomla wordpress, facebook post script, joomla found, facebook share html, facebook image text, share facebook image, wordpress global post, facebook share thumbnail, share joomla facebook, share image facebook, facebook similar script

İşveren Hakkında:
( 37 değerlendirme ) Latina, Italy

Proje NO: #2232573

Seçilen:

urcoder

please see pm

1 gün içinde 85$ USD
(67 Değerlendirme)
5.7