source: extensions/HDShadowbox/main.inc.php @ 6488

Last change on this file since 6488 was 6488, checked in by patdenice, 14 years ago

Update shadowbox to 3.0.3 version.

File size: 1.0 KB
Line 
1<?php
2/*
3Plugin Name: HD Shadowbox
4Version: auto
5Description: Display HD pictures in a shadowbox
6Plugin URI: http://piwigo.org/ext/extension_view.php?eid=354
7Author: RFDesigns & P@t
8*/
9
10add_event_handler('loc_begin_picture', 'shadowbox');
11
12function shadowbox()
13{
14  global $template;
15
16  $template->set_prefilter('default_content', 'shadowbox_prefilter');
17
18  $path = get_root_url().'plugins/'. basename(dirname(__FILE__)).'/shadowbox/';
19
20  $template->append('head_elements', '
21<link rel="stylesheet" type="text/css" href="'.$path.'shadowbox.css">
22<script type="text/javascript" src="'.$path.'shadowbox.js"></script>
23<script type="text/javascript">
24Shadowbox.init();
25</script>'
26  );
27}
28
29function shadowbox_prefilter($content, &$smarty)
30{
31  $search = '<a href="javascript:phpWGOpenWindow(\'{$high.U_HIGH}\',\'{$high.UUID}\',\'scrollbars=yes,toolbar=no,status=no,resizable=yes\')">';
32 
33  $replacement = '<a href="{$high.U_HIGH}" rel="shadowbox">';
34
35  return str_replace($search, $replacement, $content);
36}
37
38?>
Note: See TracBrowser for help on using the repository browser.