-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshortcodes.php
More file actions
executable file
·122 lines (101 loc) · 2.6 KB
/
Copy pathshortcodes.php
File metadata and controls
executable file
·122 lines (101 loc) · 2.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<?php global $options; ?>
<link
rel='stylesheet'
href='<?php bloginfo('template_url'); ?>/shortcodes.css'
type='text/css'
media='screen' />
<?php
// [qfgallery]
// add if for option check for qfgallery activation
?>
<link
rel='stylesheet'
href='<?php bloginfo('template_url'); ?>/jquery.fancybox/jquery.fancybox.css'
type='text/css'
media='screen' />
<script
type="text/javascript"
src="<?php bloginfo('template_url'); ?>/jquery.fancybox/jquery.easing.1.3.js">
</script>
<script
type="text/javascript"
src="<?php bloginfo('template_url'); ?>/jquery.fancybox/jquery.fancybox-1.2.1.js">
</script>
<?php
$galleryctr = 0;
function qfgallery_handler($atts, $content)
{
global $galleryctr;
extract
(
shortcode_atts
(
array
(
'title' => '',
'scale' => '',
'float' => ''
),
$atts
)
);
$newcontent =
"
<div
class='qfcontainer' " .
(
$float != "" ?
"style=
'
float: $float;
margin: 5px 15px;
margin-$float: 0px;
padding: 3px;
'"
:
""
) . "
>
";
if( $title != "" ) $newcontent .= "<h2>$title</h2>\n";
foreach( explode("\n", $content) as $line )
{
// strip the <br /> tag added by wpautop et al
$line = preg_replace("/\s*\<br.*/", "", $line);
$matches = preg_split("/\s*\|\s*/", $line);
if( sizeof($matches) <= 1 )
continue;
$newcontent .=
"
<div class='qfgallerytnail'>
<a class='qfgallery' rel='qfgallery$galleryctr' href='$matches[0]' title='$matches[1]'>
<img
src='$matches[0]' " . ($scale == 1 ? "width='128' height='128' " : "") . "
alt='$matches[1]' />
</a>
</div>
";
}
$newcontent .= "<br clear='all' /></div>\n";
$galleryctr++;
return($newcontent);
}
add_shortcode('qfgallery', 'qfgallery_handler');
?>
<script language='JavaScript'>
$(document).ready(
function()
{
$("a.qfgallery").
fancybox
({
'imageScale': true,
'zoomOpacity': true,
'overlayShow': true,
'easingIn': 'easeInElastic',
'easingOut': 'easeOutBounce',
'easingChange': 'easeInOutSine'
});
}
);
</script>