aboutsummaryrefslogtreecommitdiff
path: root/views/default/tidypics/icon.php
blob: c960bc00b9a664ec63776762ea1781540d2271df (plain)
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
<?php
	/**
	 * Elgg tidypic icon
	 * Optionally you can specify a size.
	 * 
	 */

	global $CONFIG;
		
if($vars['album']){
	echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/album.gif\" border=\"0\" />";
}
else{
	
	$mime = $vars['mimetype'];
	if (isset($vars['thumbnail'])) {
		$thumbnail = $vars['thumbnail'];
	} else {
		$thumbnail = false;
	}
	
	$size = $vars['size'];
	if ($size != 'large') {
		$size = 'small';
	}

	if ($thumbnail && strpos($mime, "image/")!==false)
		echo "<img src=\"{$vars['url']}action/tidypics/icon?file_guid={$vars['file_guid']}\" border=\"0\" />";
	else 
	{
		if ($size == 'large')
			echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/general_lrg.gif\" border=\"0\" />";
		else
			echo "<img src=\"{$CONFIG->wwwroot}mod/tidypics/graphics/icons/general.gif\" border=\"0\" />";
	}
}
?>