Index: extensions/greydragon/admin/admin.inc.php
===================================================================
--- extensions/greydragon/admin/admin.inc.php	(revision 30754)
+++ extensions/greydragon/admin/admin.inc.php	(revision 30783)
@@ -38,25 +38,5 @@
   conf_update_param('greydragon', pwg_db_real_escape_string($conf['greydragon']));
 
-  if ($themeCore->getOption('p_lowertext') == "on"):
-    $css  = "/* Theme dynamic settings. Do not modify */\n"
-          . "html, body, input, select, textarea, file { text-transform: lowercase; }\n\n";
-  else:
-    $css = "";
-  endif;
-  $temp = $themeCore->getOption('p_customcss');
-  if ($temp):
-    $css .= "/* Custom CSS. Do not modify */\n" . $temp;
-  endif;
-
-  $fileName = $themeroot . 'css/custom.css';
-  if ($css):
-    $handle = fopen($fileName, "w");
-    if ($handle):
-      fwrite($handle, $css);
-      fclose($handle);
-    endif;
-  else:
-    @unlink($fileName);
-  endif;
+  $themeCore->prepareCustomCSS();
 
   pwg_set_session_var( 'purge_template', 1 );
Index: extensions/greydragon/changelog.txt
===================================================================
--- extensions/greydragon/changelog.txt	(revision 30754)
+++ extensions/greydragon/changelog.txt	(revision 30783)
@@ -18,4 +18,11 @@
 
 === Changelog ===
+version 1.1.19
++ custom.css location moved to local/greydragon/ to comply with PWG guidelines. File should be automatically created when theme is updated.
+  Please make sure that migration is successful as it may require adjustment of "local" Folder permissions in some cases
+- Fix issue when Static menu would cause misalignment of the content in 3rd party plugins
+- Adjust min height of the content with Static menu to better fit the screen
+- Fixed issue when using SEO friendly URLs would cause logo not being visible in sub pages
+
 version 1.0.18
 - Added check for custom.css being present on new installations to prevent SMARTY error
Index: extensions/greydragon/css/styles.css
===================================================================
--- extensions/greydragon/css/styles.css	(revision 30754)
+++ extensions/greydragon/css/styles.css	(revision 30783)
@@ -116,4 +116,9 @@
 /* Static */
 #menubar.static { background: none !important; bottom: auto; }
+body.static-menu .contentWithMenu, body.static-menu #the_page .contentWithMenu { margin-left: 200px; amargin-left: 0; }
+body.static-menu .contentWithMenu .titrePage { margin-left: -194px; }
+body.static-menu #mbCategories { margin-bottom: 1em; }
+
+/*
 body.static-menu .contentWithMenu ul.thumbnails,
 body.static-menu .contentWithMenu ul.thumbnailCategories,
@@ -122,6 +127,8 @@
 body.static-menu .contentWithMenu form.filter,
 body.static-menu .contentWithMenu .category_search_results { padding-left: 200px; margin-left: 0; }
+
 body.static-menu .contentWithMenu .titrePage { padding-left: 6px; }
 body.static-menu .contentWithMenu .calendarCalBar { margin-left: 210px; }
+*/
 
 /* Static header bottom */
@@ -306,5 +313,4 @@
 
 .content .additional_info { margin-top: 0.4em; margin-bottom: 0.4em; padding: .5em 1em; }
-body.static-menu .contentWithMenu .additional_info { margin-left: 204px; }
 #theImage .imageComment { margin: 1em 1em 0.4em 1em; padding: .5em 1em; }
 
Index: extensions/greydragon/include/greydragon.class.php
===================================================================
--- extensions/greydragon/include/greydragon.class.php	(revision 30754)
+++ extensions/greydragon/include/greydragon.class.php	(revision 30783)
@@ -3,5 +3,5 @@
 if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
 
-define('GDTHEME_VERSION', '1.0.18');
+define('GDTHEME_VERSION', '1.1.19');
 
 define("QUOTES_NONE",   FALSE);
@@ -17,4 +17,6 @@
   private $themeConfig;
   private $themeConfigMin;
+  private $dir;
+  private $cssfile;
 
   public static function Instance($ver = '') {
@@ -26,4 +28,6 @@
 
   private function __construct($ver = ''){
+    $this->dir  = PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'greydragon/';
+
     self::loadConfig($ver);
   }
@@ -288,11 +292,17 @@
   public function getHeader() {
     $content = "";
+    $root_base = get_root_url();
+    if ($root_base):
+    else:
+      $root_base = '/';
+    endif;
+
     if ($this->hasOption('p_logo_path')):
-      $content .= '<a title="Home" id="g-logo" href="' . PHPWG_ROOT_PATH . '"><img alt="Home" src="' . PHPWG_ROOT_PATH . $this->getOption('p_logo_path') . '"></a>';
+      $content .= '<a title="Home" id="g-logo" href="' . $root_base . '"><img alt="Home" src="' . $root_base . $this->getOption('p_logo_path') . '"></a>';
     endif;
     if ($this->hasOption('p_header')):
-      $content .= '<a title="Home" id="g-header-text" href="' . PHPWG_ROOT_PATH . '">' . $this->getOption('p_header') . '</a>';
+      $content .= '<a title="Home" id="g-header-text" href="' . $root_base . '">' . $this->getOption('p_header') . '</a>';
     elseif ($this->hasOption('page_banner', TRUE)):
-      $content .= '<a title="Home" id="g-header-text" href="' . PHPWG_ROOT_PATH . '">' . $this->getOption('page_banner', TRUE) . '</a>';
+      $content .= '<a title="Home" id="g-header-text" href="' . $root_base . '">' . $this->getOption('page_banner', TRUE) . '</a>';
     endif;                                                                                                              
 
@@ -300,4 +310,45 @@
   }
 
+  public function prepareCustomCSS() {
+
+    $this->cssfile = dirname(dirname(dirname(dirname(__FILE__)))) . '/' . PWG_LOCAL_DIR . 'greydragon/custom.css';
+
+    if ($this->getOption('p_lowertext') == "on"):
+      $css  = "/* Theme dynamic settings. Do not modify */\n"
+            . "html, body, input, select, textarea, file { text-transform: lowercase; }\n\n";
+    else:
+      $css = "";
+    endif;
+    $temp = $this->getOption('p_customcss');
+    if ($temp):
+      $css .= "/* Custom CSS. Do not modify */\n" . $temp;
+    endif;
+
+    // create a local directory
+    if (!file_exists($this->dir)):
+      mkdir($this->dir, 0755);
+    endif;
+
+    if ($css):
+      $handle = fopen($this->cssfile, "w");
+      if ($handle):
+        fwrite($handle, $css);
+        fclose($handle);
+      endif;
+    else:
+      @unlink($this->cssfile);
+    endif;
+  }
+
+  public function deleteCustomCSS() {
+
+    // delete local folder
+    foreach (scandir($this->dir) as $file):
+      if ($file == '.' or $file == '..') continue;
+      unlink($this->dir . $file);
+    endforeach;
+    rmdir($this->dir);
+  }
+
 }
 
Index: extensions/greydragon/js/theme.menu.js
===================================================================
--- extensions/greydragon/js/theme.menu.js	(revision 30754)
+++ extensions/greydragon/js/theme.menu.js	(revision 30783)
@@ -42,5 +42,5 @@
     if (p_main_menu == 'static') { 
       var mh = jQuery('#menubar').height();
-      jQuery('.contentWithMenu').css("min-height", mh + 20);
+      jQuery('.contentWithMenu').css("min-height", mh + 30);
       jQuery('#menubar').css("display", "block"); 
       return; 
Index: extensions/greydragon/maintain.class.php
===================================================================
--- extensions/greydragon/maintain.class.php	(revision 30783)
+++ extensions/greydragon/maintain.class.php	(revision 30783)
@@ -0,0 +1,41 @@
+<?php
+defined('PHPWG_ROOT_PATH') or die('Hacking attempt!');
+
+require_once( PHPWG_THEMES_PATH . 'greydragon/include/greydragon.class.php');
+
+class greydragon_maintain extends PluginMaintain {
+
+  private $dir;
+  private $themeCore;
+
+  function __construct($plugin_id) {
+    parent::__construct($plugin_id); // always call parent constructor
+
+    $this->themeCore = greyDragonCore::Instance(GDTHEME_VERSION);
+    $this->dir = PHPWG_ROOT_PATH . PWG_LOCAL_DIR . 'greydragon/';
+  }
+
+  /**
+   * Plugin installation
+   */
+  function install($plugin_version, &$errors=array()) {
+    $this->themeCore->prepareCustomCSS();
+  }
+
+  /**
+   * Plugin (auto)update
+   */
+  function update($old_version, $new_version, &$errors=array()) {
+    $this->install($new_version, $errors);
+  }
+
+  /**
+   * Plugin uninstallation
+   */
+  function uninstall() {
+    // delete configuration
+    conf_delete_param('greydragon');
+
+    $this->themeCore->deleteCustomCSS();
+  }
+}
Index: extensions/greydragon/obsolete.list
===================================================================
--- extensions/greydragon/obsolete.list	(revision 30783)
+++ extensions/greydragon/obsolete.list	(revision 30783)
@@ -0,0 +1,1 @@
+css/custom.css
Index: extensions/greydragon/template/header.tpl
===================================================================
--- extensions/greydragon/template/header.tpl	(revision 30754)
+++ extensions/greydragon/template/header.tpl	(revision 30783)
@@ -34,4 +34,5 @@
 {if isset($U_UP)          }<link rel="up" title="{'Thumbnails'|@translate}" href="{$U_UP}" >{/if}
 {assign var=root value="themes/greydragon/css"}
+{assign var=local value="local/greydragon"}
 {assign var=colorpack value=$root|cat:"/colorpack/"|cat:$greydragon.p_colorpack|cat:"/styles.css"}
 {combine_css path="themes/greydragon/css/bootstrap.min.css" order=-100}
@@ -39,6 +40,6 @@
 {combine_css path="$colorpack" order=101}
 {if count($greydragon.p_customcss) > 0 || $greydragon.p_lowertext == "on"}
-  {if $root|cat:"/custom.css"|file_exists}
-  {combine_css path="themes/greydragon/css/custom.css" order=101}
+  {if $local|cat:"/custom.css"|file_exists}
+  {combine_css path="local/greydragon/custom.css" order=101}
   {/if}
 {/if}
Index: extensions/greydragon/themeconf.inc.php
===================================================================
--- extensions/greydragon/themeconf.inc.php	(revision 30754)
+++ extensions/greydragon/themeconf.inc.php	(revision 30783)
@@ -2,5 +2,5 @@
 /*
 Theme Name: GreyDragon
-Version: 1.0.18
+Version: 1.1.19
 Description: GreyDragon Theme
 Theme URI: http://piwigo.org/ext/extension_view.php?eid=775
