source: extensions/Facebook_Integration/main.inc.php @ 12160

Last change on this file since 12160 was 8103, checked in by Gotcha, 14 years ago

Add get_absolute_root_url() fonction.
Thanks to P@t !

File size: 904 bytes
Line 
1<?php
2/*
3Plugin Name: Facebook Integration
4Version: 1.1
5Description: Allows to improve the recognition of your gallery in Facebook when in this Community site you add a link towards your gallery (or your images).
6Plugin URI: http://fr.piwigo.org/ext/extension_links.php?eid=469
7Author: Gotcha
8Author URI: http://www.julien-moreau.fr
9*/
10
11
12add_event_handler('loc_begin_picture', 'add_fb' );
13
14function add_fb()
15{
16  global $template, $page;
17  $template->set_prefilter('header', 'addfbtpl');
18
19 }
20
21function addfbtpl($content, &$smarty)
22{
23
24   $search = '/<\/head>/';
25 
26  $replacement = '<meta property="og:title" content="{$GALLERY_TITLE} - {$ALT_IMG}">
27<meta property="og:description" content="{$COMMENT_IMG}">
28<meta property="og:image" content="'.get_absolute_root_url().'{$current.THUMB_SRC}">
29</head>
30';
31 
32  return preg_replace($search, $replacement, $content);
33 
34}
35
36?>
Note: See TracBrowser for help on using the repository browser.