Last change
on this file since 10366 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 | /* |
---|
3 | Plugin Name: Facebook Integration |
---|
4 | Version: 1.1 |
---|
5 | Description: 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). |
---|
6 | Plugin URI: http://fr.piwigo.org/ext/extension_links.php?eid=469 |
---|
7 | Author: Gotcha |
---|
8 | Author URI: http://www.julien-moreau.fr |
---|
9 | */ |
---|
10 | |
---|
11 | |
---|
12 | add_event_handler('loc_begin_picture', 'add_fb' ); |
---|
13 | |
---|
14 | function add_fb() |
---|
15 | { |
---|
16 | global $template, $page; |
---|
17 | $template->set_prefilter('header', 'addfbtpl'); |
---|
18 | |
---|
19 | } |
---|
20 | |
---|
21 | function 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.