-
Notifications
You must be signed in to change notification settings - Fork 11
/
attachment.php
99 lines (79 loc) · 2.58 KB
/
attachment.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
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
<?php
/**
* The template for displaying a single post.
*
*
* @package WordPress
* @subpackage FAU
* @since FAU 1.0
*/
get_header();
while ( have_posts() ) : the_post(); ?>
<div id="content">
<div class="content-container">
<div class="content-row">
<main>
<h1 id="maintop" class="screen-reader-text"><?php the_title(); ?></h1>
<?php
echo wp_get_attachment_image( $post->ID, 'full' );
the_content();
$imgdata = fau_get_image_attributs($post->ID);
$meta = get_post_meta( $post->ID );
if ( is_user_logged_in() ) {
echo '<p class="attention">'.__('Die folgenden Informationen werden nur für angemeldete Benutzer des CMS angezeigt:','fau').'</p>';
echo "<h2>Attribute</h2>";
echo fau_array2table($imgdata);
if (isset($meta) && isset($meta['_wp_attachment_metadata']) && is_array($meta['_wp_attachment_metadata'])) {
$data = unserialize($meta['_wp_attachment_metadata'][0]);
if (isset($data['image_meta'])) {
echo "<h2>Metadaten</h2>";
echo fau_array2table($data['image_meta']);
}
echo "<h2>Verfügbare Auflösungen</h2>\n";
echo fau_array2table($data['sizes']);
}
echo '<p class="hinweis">'.__('Die folgenden Informationen werden öffentlich angezeigt:','fau').'</p>';
}
?>
<h2>Daten zum Bild</h2>
<table>
<tr>
<th>Titel</th>
<td><?php echo $imgdata['title']; ?></td>
</tr>
<?php if(!empty($imgdata['excerpt'])) { ?>
<tr>
<th>Beschriftung</th>
<td><?php echo $imgdata['excerpt']; ?></td>
</tr>
<?php } ?>
<?php if(!empty($imgdata['description'])) { ?>
<tr>
<th>Beschreibung</th>
<td><?php echo $imgdata['description']; ?></td>
</tr>
<?php } ?>
<?php if(!empty($imgdata['copyright'])) { ?>
<tr>
<th>Information zu Urheberrecht / Lizenz</th>
<td><?php echo $imgdata['copyright']; ?></td>
</tr>
<?php }
$downloadurl = "";
$parsed = parse_url( wp_get_attachment_url( $post->ID ) );
$downloadurl = dirname( $parsed [ 'path' ] ) . '/' . rawurlencode( basename( $parsed[ 'path' ] ) );
if (!fau_empty($downloadurl)) { ?>
<tr>
<th><?php _e('Download','fau');?></th>
<td><a href="<?php echo $downloadurl; ?>"><?php echo $imgdata['title']; ?></a></td>
</tr>
<?php
}
?>
</table>
</main>
</div>
</div>
</div>
<?php endwhile; ?>
<?php get_footer();