This repository was archived by the owner on Jan 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimglinks.php
72 lines (52 loc) · 1.75 KB
/
imglinks.php
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
<?php
/**
* simple Gallery Plugin by
* Patrick Konstandin - [email protected]
* Licence: CC BY-NC-SA 3.0 DE - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
*/
$plugin = array();
$plugin['title'] = 'ImagesAndLinks';
$plugin['description'] = '<p>This Plugin generates a gallery from your Images.</p><p>Filter your Gallery by Keywords e.g. <strong>gallery</strong>. Include the Plugin via <code>[plugin=imglinks.php]key=keyword[/plugin]</code>';
$plugin['version'] = '0.1';
$plugin['author'] = 'flatCore.org';
global $fct_slug;
global $mod_slug;
$plugin_target = FC_INC_DIR . "/$fct_slug" . "$mod_slug";
if(FC_SOURCE !== 'backend') {
global $db_content;
global $languagePack;
$images = $db_content->select("fc_media", "*",[
"media_keywords" => $key,
"media_lang" => $languagePack,
"ORDER" => [
"media_priority" => "DESC"
]
]);
$cnt_images = count($images);
echo '<div class="container">';
echo '<div class="row">';
for($i=0;$i<$cnt_images;$i++) {
$filename = '';
$link = '';
$classes = '';
$filename = basename($images[$i]['media_file']);
$link = $images[$i]['media_url'];
$text = $images[$i]['media_text'];
$title = stripslashes($images[$i]['media_title']);
$classes = str_replace(',',' ',$images[$i]['media_keywords']);
$classes = str_replace('galerie',' ',$classes);
if($link == '') {
$link_start = '<a class="lightbox" href="/content/images/'.$filename.'" title="'.$title.'">';
} else {
$link_start = '<a class="" href="'.$link.'" title="'.$title.'" target="_blank">';
}
echo '<div class="col-4 mb-3">';
echo $link_start;
echo '<img src="/content/images/'.$filename.'" class="img-thumbnail img-fluid">';
echo '</a>';
echo '</div>';
}
echo '</div>';
echo '</div>';
}
?>