Index: tensions/Random_Header/testmain.inc.php
===================================================================
--- /extensions/Random_Header/testmain.inc.php	(revision 5486)
+++ 	(revision )
@@ -1,107 +1,0 @@
-<?php
-/*
-Plugin Name: Random Header
-Version: 2.0.d
-Description: Random Header allow you to show in the header a random picture from the choosen categorie, as a normal image, or as a background
-Plugin URI: http://phpwebgallery.net/ext/extension_view.php?eid=188
-Author: repie38
-Author URI: http://www.pierre-b.com
-*/
-
-if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
-DEFINE('RH_VERSION','v2.0.d');
-define('RH_PATH' , PHPWG_PLUGINS_PATH . basename(dirname(__FILE__)) . '/');
-
-function get_file_contents($url, $totalTries = 5)
-	 {
-		$Tries = 0;
-		do
-		 {
-				if ($Tries > 0) sleep(1); # Wait for a sec before retrieving again
-				$contents = @file_get_contents($url);
-				$Tries++;
-		 } while ($Tries <= $totalTries && $contents === FALSE);
-		 if ($contents == "") $contents = FALSE;
-		 return $contents;
-	 }
-
-class RandomHeader
-{
-    var $rh_config;
-	
-	function load_config()
-    {
-        $x = get_file_contents( dirname(__FILE__).'/data.dat' );
-		
-        if ($x!==false)
-        	$this->rh_config = unserialize($x);
-
-        	foreach (str_replace(" ", "_", get_pwg_themes()) as $pwg_template) {
-			  if (empty($this->rh_config[$pwg_template]['selected_cat']))  {
-
-				$this->rh_config[$pwg_template]['selected_cat'] = '0';
-            	$this->rh_config[$pwg_template]['active_on_picture']='off';
-				$this->rh_config[$pwg_template]['head_css']='';
-				$this->rh_config[$pwg_template]['img_css']='';
-				$this->rh_config[$pwg_template]['mode_background']='off';
-				$this->rh_config[$pwg_template]['concat_before'] ='off' ;
-				$this->rh_config[$pwg_template]['concat_after'] ='off' ;
-
-            	$this->save_config();
-        	}
-		}
-
-    }
-    function save_config()
-    {
-        $file = fopen( dirname(__FILE__).'/data.dat', 'w' );
-        fwrite($file, serialize($this->rh_config) );
-        fclose( $file );
-    }
-    function plugin_admin_menu($menu)
-    {
-        array_push($menu,
-            array(
-                'NAME' => 'Random Header',
-                'URL' => get_admin_plugin_menu_link(dirname(__FILE__).'/admin/rh_admin.php')
-            ));
-        return $menu;
-    }
-
-	function randombanner(){
-		global $page;
-		global $template;
-		global $conf;
-		global $user;
-		$usertheme=str_replace(" ", "_", $user['template'].'/'.$user['theme'] );
-		if ( !defined('IN_ADMIN') && isset($page['body_id']) && ($page['body_id']!='thePicturePage' || $this->rh_config[$usertheme]['active_on_picture']=='on') ) {
-
-			$result = pwg_query('SELECT '.IMAGES_TABLE.'.path  FROM '.IMAGES_TABLE.' , '.IMAGE_CATEGORY_TABLE.' WHERE '.IMAGES_TABLE.'.`id` = '.IMAGE_CATEGORY_TABLE.'.`image_id` AND '.IMAGE_CATEGORY_TABLE.'.category_id = ' . $this->rh_config[$usertheme]['selected_cat'] . ' ORDER BY RAND() LIMIT 0,1');
-			if (mysql_num_rows($result) > 0) {
-				$toto = mysql_fetch_row($result);
-
-				if ($this->rh_config[$usertheme]['mode_background']=='on') {
-					$template->append('head_elements','<style>#theHeader{background: url('.$toto[0].') no-repeat;'. $this->rh_config[$usertheme]['head_css'] .'}</style>');
-				}
-				else {
-					if ($this->rh_config[$usertheme]['img_css']!='' || $this->rh_config[$usertheme]['head_css']!='')
-						$template->append('head_elements','<style>#theHeader{'. $this->rh_config[$usertheme]['head_css'] .'}#theHeader #RandomImage{'. $this->rh_config[$usertheme]['img_css'] .'}</style>');
-					$page['page_banner'] = ($this->rh_config[$usertheme]['concat_before']=='on') ? $conf['page_banner'] : '';
-					$page['page_banner'].= '<img id="RandomImage" src="'.$toto[0].'">';
-					$page['page_banner'].= ($this->rh_config[$usertheme]['concat_after']=='on') ? $conf['page_banner'] : '';
-				}
-			}
-		}
-	}
-
-
-}
-$obj = new RandomHeader();
-$obj->load_config();
-
-add_event_handler('loc_begin_page_header', array(&$obj, 'randombanner') );
-add_event_handler('get_admin_plugin_menu_links', array(&$obj, 'plugin_admin_menu') );
-set_plugin_data($plugin['id'], $obj)
-
-
-?>
