Index: /extensions/Media_Icon/admin/admin_advanced.php
===================================================================
--- /extensions/Media_Icon/admin/admin_advanced.php	(revision 19646)
+++ /extensions/Media_Icon/admin/admin_advanced.php	(revision 19647)
@@ -58,5 +58,5 @@
 	)
 );
-$template->assign('media_icon_admin_path', PHPWG_ROOT_PATH);
+$template->assign('media_icon_admin_path', PHPWG_ROOT_PATH.MEDIA_ICON_PATH);
 
 //Add our template to the global template
Index: /extensions/Media_Icon/admin/admin_advanced.tpl
===================================================================
--- /extensions/Media_Icon/admin/admin_advanced.tpl	(revision 19646)
+++ /extensions/Media_Icon/admin/admin_advanced.tpl	(revision 19647)
@@ -75,8 +75,8 @@
 		<legend>{'Result'|@translate}</legend>
 			<span style="float: left;">
-				<a href="#" style="position: absolute; clip: rect(0px, 323px, 200px, 0px);"><span class="media_icon media_icon_pdf_{$media_icon_style}"></span><img class="thumbnail" alt="landscape" src="{$media_icon_admin_path}plugins/media_icon/admin/img/landscape.png" width="323" height="200" /></a>
+				<a href="#" style="position: absolute; clip: rect(0px, 323px, 200px, 0px);"><span class="media_icon media_icon_pdf_{$media_icon_style}"></span><img class="thumbnail" alt="landscape" src="{$media_icon_admin_path}admin/img/landscape.png" width="323" height="200" /></a>
 			</span>
 			<span style="float: left; margin-left: 333px;">
-				<a href="#" style="position: absolute; clip: rect(0px, 150px, 200px, 0px);"><span class="media_icon media_icon_youtube_{$media_icon_style}"></span><img class="thumbnail" alt="portrait" src="{$media_icon_admin_path}plugins/media_icon/admin/img/portrait.png" width="150" height="200" /></a>
+				<a href="#" style="position: absolute; clip: rect(0px, 150px, 200px, 0px);"><span class="media_icon media_icon_youtube_{$media_icon_style}"></span><img class="thumbnail" alt="portrait" src="{$media_icon_admin_path}admin/img/portrait.png" width="150" height="200" /></a>
 			</span>
 			<span class="media_icon_clear"></span>
Index: tensions/Media_Icon/include/picture.inc.php
===================================================================
--- /extensions/Media_Icon/include/picture.inc.php	(revision 19646)
+++ 	(revision )
@@ -1,83 +1,0 @@
-<?php
-add_event_handler('render_element_content','media_icon_add_tag_picture',EVENT_HANDLER_PRIORITY_NEUTRAL+10,2);
-
-function media_icon_add_tag_picture($content, $element_info) {
-	global $conf;
-	
-	add_event_handler('loc_end_page_header', 'media_icon_picture_css');
-	
-	$conf_media_icon_general = unserialize($conf['media_icon_general']);
-	$media_icon_type = "";
-	
-	switch (strrchr($element_info['file'], ".")) {
-		case ".pdf":
-			if ($conf_media_icon_general['active']['pdf'] == 1)
-				$media_icon_type = "pdf";
-			break;
-		case ".docx":
-			if ($conf_media_icon_general['active']['document'] == 1)
-				$media_icon_type = "document";
-			break;
-		case ".doc":
-			if ($conf_media_icon_general['active']['document'] == 1)
-				$media_icon_type = "document";
-			break;
-		case ".odt":
-			if ($conf_media_icon_general['active']['document'] == 1)
-				$media_icon_type = "document";
-			break;
-		case ".xlsx":
-			if ($conf_media_icon_general['active']['spreadsheet'] == 1)
-				$media_icon_type = "spreadsheet";
-			break;
-		case ".xls":
-			if ($conf_media_icon_general['active']['spreadsheet'] == 1)
-				$media_icon_type = "spreadsheet";
-			break;
-		case ".ods":
-			if ($conf_media_icon_general['active']['spreadsheet'] == 1)
-				$media_icon_type = "spreadsheet";
-			break;
-		case ".pptx":
-			if ($conf_media_icon_general['active']['presentation'] == 1)
-				$media_icon_type = "presentation";
-			break;
-		case ".ppt":
-			if ($conf_media_icon_general['active']['presentation'] == 1)
-				$media_icon_type = "presentation";
-			break;
-		case ".odp":
-			if ($conf_media_icon_general['active']['presentation'] == 1)
-				$media_icon_type = "presentation";
-			break;
-	}
-	
-	if ($media_icon_type != "") {
-		preg_match('/<\s*img\s+[^>]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i',$content,$match);
-	
-		$content = str_replace($match[0],'<span class="media_icon media_icon_'.$media_icon_type.'_'.$conf_media_icon_general['style'].'"></span>'.$match[0],$content);
-	}
-	
-	return $content;
-}
-
-function media_icon_picture_css() {
-	global $template, $conf;
-	
-	$conf_media_icon_general = unserialize($conf['media_icon_general']);
-	$conf_media_icon_advanced = unserialize($conf['media_icon_advanced']);
-	
-	$template->set_filename('media_icon_template', MEDIA_ICON_PATH.'template/media_icon.tpl');
-	
-	$template->assign(
-		'media_icon_advanced',
-		array(
-			'xposition' => $conf_media_icon_advanced['xposition'],
-			'yposition' => $conf_media_icon_advanced['yposition'],
-			'opacity' => $conf_media_icon_advanced['opacity'],
-		)
-	);
-	
-	$template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('media_icon_template', true));
-}
-?>
Index: /extensions/Media_Icon/include/thumbnails.inc.php
===================================================================
--- /extensions/Media_Icon/include/thumbnails.inc.php	(revision 19646)
+++ /extensions/Media_Icon/include/thumbnails.inc.php	(revision 19647)
@@ -10,8 +10,8 @@
 	$template->set_prefilter('index_thumbnails', 'media_icon_prefilter_thumbnails');
 	
-	$template->set_filename('media_icon_template', MEDIA_ICON_PATH.'template/media_icon.tpl');
+	$template->set_filename('media_icon_template', MEDIA_ICON_ABSOLUTE_PATH.'template/media_icon.tpl');
 	
 	$template->assign('media_icon_style',$conf_media_icon_general['style']);
-	
+
 	$template->assign('media_icon_active',	$conf_media_icon_general['active']);
 	$template->assign(
@@ -31,5 +31,5 @@
 function media_icon_prefilter_thumbnails($content, &$smarty) {
 	global $template;
-
+	
 	$search = 'class="thumbnail"';
 	
Index: /extensions/Media_Icon/main.inc.php
===================================================================
--- /extensions/Media_Icon/main.inc.php	(revision 19646)
+++ /extensions/Media_Icon/main.inc.php	(revision 19647)
@@ -14,5 +14,5 @@
 define('MEDIA_ICON_PATH' , PHPWG_PLUGINS_PATH.MEDIA_ICON_DIR.'/');
 define('MEDIA_ICON_ABSOLUTE_PATH' , dirname(__FILE__).'/');
-define('MEDIA_ICON_ADMIN',   get_root_url() . 'admin.php?page=plugin-Media_Icon');
+define('MEDIA_ICON_ADMIN',   get_root_url() . 'admin.php?page=plugin-'.MEDIA_ICON_DIR);
 
 /* +-----------------------------------------------------------------------+
@@ -38,5 +38,4 @@
 	
 include_once(MEDIA_ICON_PATH.'include/thumbnails.inc.php');
-include_once(MEDIA_ICON_PATH.'include/picture.inc.php');
 
 /* +-----------------------------------------------------------------------+
Index: /extensions/Media_Icon/maintain.inc.php
===================================================================
--- /extensions/Media_Icon/maintain.inc.php	(revision 19646)
+++ /extensions/Media_Icon/maintain.inc.php	(revision 19647)
@@ -3,6 +3,6 @@
 
 function plugin_install() {
-	include(dirname(__FILE__).'/install/functions.inc.php');
-	include(dirname(__FILE__).'/install/config_default.inc.php');
+	include_once(dirname(__FILE__).'/install/functions.inc.php');
+	include_once(dirname(__FILE__).'/install/config_default.inc.php');
 
 	media_icon_install_general($config_default_general);
@@ -11,5 +11,5 @@
 
 function plugin_activate() {
-	include(dirname(__FILE__).'/install/functions.inc.php');
+	include_once(dirname(__FILE__).'/install/functions.inc.php');
 	
 	media_icon_update_db();
@@ -17,4 +17,6 @@
 
 function plugin_uninstall() {
+	include_once(dirname(__FILE__).'/install/functions.inc.php');
+
 	media_icon_delete_conf("media_icon_general");
 	media_icon_delete_conf("media_icon_advanced");
Index: /extensions/Media_Icon/template/media_icon.css
===================================================================
--- /extensions/Media_Icon/template/media_icon.css	(revision 19646)
+++ /extensions/Media_Icon/template/media_icon.css	(revision 19647)
@@ -1,5 +1,5 @@
 .media_icon  {
-	width: 60px;
-	height: 60px;
+	width: 50px !important;
+	height: 50px !important;
 	z-index:99;
 	position: absolute;
Index: /extensions/Media_Icon/template/media_icon.tpl
===================================================================
--- /extensions/Media_Icon/template/media_icon.tpl	(revision 19646)
+++ /extensions/Media_Icon/template/media_icon.tpl	(revision 19647)
@@ -1,2 +1,3 @@
+{combine_script id="jquery" load="header"}
 {html_head}
 {literal}
@@ -10,5 +11,9 @@
 		{$media_icon_advanced.yposition};
 {literal}
-}
+	}
+	.thumbnails .wrap2 A {
+		position: relative;
+	
+	}
 </style>
 <script type="text/javascript">
Index: tensions/Media_Icon/thumbnails.php
===================================================================
--- /extensions/Media_Icon/thumbnails.php	(revision 19646)
+++ 	(revision )
@@ -1,41 +1,0 @@
-<?php
-add_event_handler('loc_end_index_thumbnails', 'media_icon_thumbnails');
-
-function media_icon_thumbnails($tpl_thumbnails_var) {
-	global $template, $conf;
-
-	$conf_media_icon_general = unserialize($conf['media_icon_general']);
-	$conf_media_icon_advanced = unserialize($conf['media_icon_advanced']);
-	
-	$template->set_prefilter('index_thumbnails', 'media_icon_prefilter_thumbnails');
-	
-	$template->set_filename('media_icon_template', dirname(__FILE__).'/template/media_icon.tpl');
-	
-	$template->assign('media_icon_style',$conf_media_icon_general['style']);
-	
-	$template->assign('media_icon_active',	$conf_media_icon_general['active']);
-	$template->assign(
-		'media_icon_advanced',
-		array(
-			'xposition' => $conf_media_icon_advanced['xposition'],
-			'yposition' => $conf_media_icon_advanced['yposition'],
-			'opacity' => $conf_media_icon_advanced['opacity'],
-		)
-	);
-	
-	$template->concat('PLUGIN_INDEX_CONTENT_END', $template->parse('media_icon_template', true));
-	
-	return $tpl_thumbnails_var;
-}
-
-function media_icon_prefilter_thumbnails($content, &$smarty) {
-	global $template;
-
-	$search = 'class="thumbnail"';
-	
-	$replacement = 'class="thumbnail" media_icon="{$thumbnail.file}"';
-	$content= str_replace($search, $replacement, $content);
-
-	return $content;
-}
-?>
