source: extensions/Facebook Integration/main.inc.php @ 7799

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

First commit for this new extension.

File size: 888 bytes
Line 
1<?php
2/*
3Plugin Name: Facebook Integration
4Version: 1.0
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="{$ROOT_WAY}{$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.