486663 Joomla share on Facebook preview thumbnail and text fix

IN PROGRESS
Bids
1
Avg Bid (USD)
$85
Project Budget (USD)
N/A

Project Description:
We have Joomla 1.5.11 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;
}
}

Skills required:
Anything Goes, Facebook Marketing, Joomla, Social Networking, Wordpress
About the employer:
Verified
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.


$ 85
in 1 days