<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>LINICKX.com</title><link>https://www.linickx.com/</link><description></description><lastBuildDate>Thu, 11 Oct 2007 08:44:00 +0100</lastBuildDate><item><title>CSS Styling Apache Directory Listings.</title><link>https://www.linickx.com/css-styling-apache-directory-listings</link><description>&lt;div style="float:right"&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="https://www.linickx.com/files/2008/05/apachedirlisting_before.png"&gt; &lt;img src="https://www.linickx.com/files/2008/05/apachedirlisting_before-150x150.png" alt="Before I change Apache" /&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;tr&gt;
&lt;td style="text-align:center"&gt;
**Before.**
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;As part of &lt;a href="https://www.linickx.com/archives/336/website-changes"&gt;my website
overhaul&lt;/a&gt;, I've
finally gotten round to styling my
&lt;a href="https://www.linickx.com/files/"&gt;/files/&lt;/a&gt; directory. I was surprised at
how easy it was actually, and the benefits far out way the time taken to
set it up, not only does this part of the site now "fit in", but I can
apply analytics tracking and adsense ;) I'm sure there probably is a
wordpress plugin that can achieve the same thing... probably better, but
I find my list of plugins ever growing and since I don't &lt;em&gt;need&lt;/em&gt; on for
this I figure if Apache can do it, let Apache do it!&lt;/p&gt;
&lt;p&gt;The work can be done in one of two ways either by pasting Apache
directives into a .htaccess file (&lt;em&gt;in the directory you want to apply
conf to&lt;/em&gt;), or in your httpd.conf you can wrap it all up in a&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;Directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;tag... something like&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;Directory "/var/www/html/files/"&amp;gt; foobar&amp;gt; &amp;lt;/Directory&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;below is an example of a .htaccess file as that will apply to most
people:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        RewriteEngine Off
        AddType text/html .shtml
        AddOutputFilter INCLUDES .shtml
        Options Indexes Includes
        IndexOptions FancyIndexing SuppressHTMLPreamble XHTML IconsAreLinks FoldersFirst SuppressDescription
        HeaderName /files/HEADER.shtml
        ReadmeName /files/README.shtml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Since my site uses wordpress with "pretty permalinks" enabled, the 1st
thing I needed to do is disable mod re-write for the directory where I
wanted listing enabled. Now if you check my
&lt;a href="https://www.linickx.com/files/"&gt;/files/&lt;/a&gt; page you'll notice that the
page title and tag line under "[LINICKX].com" change depending on what
directory you are viewing, this is done with "Server Side Includes"
(&lt;em&gt;SSI&lt;/em&gt;), so the next two options in the above config set that up.&lt;/p&gt;
&lt;p&gt;Now to take a look at the actual directory listing setup, it might be
worth you taking a look at the &lt;a href="http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html"&gt;Apache
documentation&lt;/a&gt;
for a full description, but the important ones to note are&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Options Indexes Includes
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to enable directory listing and switch on SSI, then you need&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;IndexOptions SuppressHTMLPreamble XHTML
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to disable the default headers so that we can setup our style sheet and
favour xHTML over HTML. Apache 2.2 users also have
&lt;a href="http://httpd.apache.org/docs/2.2/mod/mod_autoindex.html#indexstylesheet"&gt;IndexStyleSheet&lt;/a&gt;
available, but since I'm using CentOS4 we'll do it this way. Finally you
need the &lt;strong&gt;HeaderName&lt;/strong&gt;, &lt;strong&gt;ReadmeName&lt;/strong&gt; directives to tell Apache which
file to look for (&lt;em&gt;by default Apache looks for README.html, but that
won't support SSI&lt;/em&gt;)... note how my .shtml files are relative to my web
root, these are not absolute paths on the file system, i.e. /files
actually maps to /var/www/html/files.&lt;/p&gt;
&lt;p&gt;You're now good to go, HEADER.shtml should contain all the xHTML you
want to appear before the directory listing, and README.html is
everything after... make sure you include all the correct \&amp;lt;html&amp;gt;,
\&amp;lt;body&amp;gt; and DOCTYPE tags.&lt;/p&gt;
&lt;p&gt;Now you'll want to get working is some dynamic content, for a simple
"print current directory" you can use&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!--#echo var="REQUEST_URI"--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in your html, further documentation on getting more magic is available
&lt;a href="http://webmaster.iu.edu/tool_guide_info/ssitutorial.shtml"&gt;here&lt;/a&gt; &amp;amp;
&lt;a href="http://www.georgedillon.com/web/ssivar.shtml"&gt;here&lt;/a&gt;, I was able to
knock up a simple line of code to print the current year at the bottom
of the page....&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!--#config timefmt="%Y"--&amp;gt;
&amp;lt;small&amp;gt;Nick Bettison 2005 - &amp;lt;!--#echo var="DATE_LOCAL"--&amp;gt; &amp;amp;amp;copy; &amp;lt;/small&amp;gt;;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Cool eh! The trick to watch out for is spaces in the above code, there
should be no white space between&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;--#echo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or the trailing&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;--&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;div style="float:right"&gt;
&lt;table&gt;
&lt;tr&gt;
&lt;td&gt;
&lt;a href="https://www.linickx.com/files/2008/05/apachedirlisting_after.png"&gt;&lt;img src="https://www.linickx.com/files/2008/05/apachedirlisting_after-150x150.png" atlt="Linickx.com V2 Styled Listing!"&gt;&lt;/a&gt;
&lt;/td&gt;
&lt;tr&gt;
&lt;td style="text-align:center"&gt;
**After.**
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;

&lt;p&gt;The final thing you'll want to look at is those horible default icons!
You have a couple of options: You can either simply replace/over-write
the default ones (&lt;em&gt;on my flavour of linux they are in /var/www/icons&lt;/em&gt;),
or you can add&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;AddIcon /icons/tar.png .tar
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;to your htaccess file telling apache to look at tar.png rather than the
default tar.gif, I found some &lt;a href="https://gna.org/projects/apache-icons/"&gt;deb
archives&lt;/a&gt; which I extracted with
file-roller (&lt;em&gt;rather than trying to install anything&lt;/em&gt;) and simply
changed the ones I was going to use.... I'm very please with the final
result, I think it makes a big difference.&lt;/p&gt;
&lt;p&gt;Happy Styling One &amp;amp; All!&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nick</dc:creator><pubDate>Thu, 11 Oct 2007 08:44:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2007-10-11:css-styling-apache-directory-listings</guid><category>apache</category><category>Blog</category><category>css</category><category>how to</category><category>web design</category><category>WordPress</category></item><item><title>Nice Banner !</title><link>https://www.linickx.com/nice-banner</link><description>&lt;p&gt;I've never really been happy with the banner on my site, but to be
honest I've never settled on anything good, so I've stuck to the &lt;a href="https://www.linickx.com/blog/wp-content/themes/linickx_v2/images/background-header.png"&gt;plain
blue
thingy&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Over the last couple of day's I've come across a couple of nice ones....&lt;/p&gt;
&lt;style type='text/css'&gt;
#gallery-1 {
  margin: auto;
}
#gallery-1 .gallery-item {
  float: left;
  margin-top: 10px;
  text-align: center;
  width: 33%;
}
#gallery-1 img {
  border: 2px solid #cfcfcf;
}
#gallery-1 .gallery-caption {
  margin-left: 0;
}
/* see gallery_shortcode() in wp-includes/media.php */
&lt;/style&gt;
&lt;div id='gallery-1' class='gallery galleryid-205 gallery-columns-3 gallery-size-thumbnail'&gt;&lt;dl class='gallery-item'&gt;
&lt;dt class='gallery-icon '&gt;
  &lt;a href='https://www.linickx.com/205/nice-banner/cshields-personalheader'&gt;&lt;img src="https://www.linickx.com/files/2008/10/cshields-personalheader-150x150.jpg" class="attachment-thumbnail" alt="http://staff.osuosl.org/~cshields" aria-describedby="gallery-1-544" /&gt;&lt;/a&gt;
&lt;/dt&gt;
  &lt;dd class='wp-caption-text gallery-caption' id='gallery-1-544'&gt;
  http://staff.osuosl.org/~cshields
  &lt;/dd&gt;&lt;/dl&gt;&lt;dl class='gallery-item'&gt;
&lt;dt class='gallery-icon '&gt;
  &lt;a href='https://www.linickx.com/205/nice-banner/crypt-header'&gt;&lt;img src="https://www.linickx.com/files/2008/10/crypt-header-150x150.jpg" class="attachment-thumbnail" alt="http://www.crypt.gen.nz" aria-describedby="gallery-1-545" /&gt;&lt;/a&gt;
&lt;/dt&gt;
  &lt;dd class='wp-caption-text gallery-caption' id='gallery-1-545'&gt;
  http://www.crypt.gen.nz
  &lt;/dd&gt;&lt;/dl&gt;
&lt;br style='clear: both' /&gt;
&lt;/div&gt;

&lt;p&gt;as you can see my tastes are very different; but I like both idea's very
much. I've always wanted to include &lt;a href="http://art.gnome.org/users/linickx/backgrounds/"&gt;my more successful
GnomeArts&lt;/a&gt; in my
website theme somewhere but never managed it... humm back to the drawing
board thinks I ;-)&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nick</dc:creator><pubDate>Wed, 21 Jun 2006 17:07:00 +0100</pubDate><guid isPermaLink="false">tag:www.linickx.com,2006-06-21:nice-banner</guid><category>Blog</category><category>rant</category><category>web design</category></item><item><title>h4x0r on themes.wordpress.net</title><link>https://www.linickx.com/h4x0r-on-themeswordpressnet</link><description>&lt;p&gt;Tiz cool when things get published on other sites, my &lt;a href="https://www.linickx.com/blog/index.php?wptheme=h4x0r-LINICKX"&gt;h4x0r
theme&lt;/a&gt; is
on &lt;a href="http://themes.wordpress.net"&gt;themes.wordpress.net&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.linickx.com/files/2008/10/h4x0r_onwptheme.jpg"&gt;&lt;img alt="" src="https://www.linickx.com/files/2008/10/h4x0r_onwptheme-300x185.jpg" title="h4x0r on WP Theme.net" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;cool :cool:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;shame i can't work out how to link to them properly !&lt;/em&gt;&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">nick</dc:creator><pubDate>Thu, 09 Feb 2006 12:16:00 +0000</pubDate><guid isPermaLink="false">tag:www.linickx.com,2006-02-09:h4x0r-on-themeswordpressnet</guid><category>PHP</category><category>theme</category><category>web design</category><category>WordPress</category></item></channel></rss>