Friday, November 2, 2012

A new? sticky CSS footer....


Just trying to re-invent the wheel here...something I wrote this morning.
So far I have tested it in IE 9 (Win 7), Chrome, Chromium (Linux Mint), Midori (Mint), Opera (Mint and Win 7), Firefox 11 & 18(Mint and Win 7). I even tested it with IE 7(Win) and Safari 5.1(OSX).


----html-----                                                                                                                                 
                                                                                                                  
<div class="wrapper">
    <div class="header">Menu...or something </div>
        <div class="main_content"> Other stuff</div>
/div>

<div class="footer">Lorem Ipsum </div>     

The CSS is just as simple:

----css----                                
              
    html, body {
    height: 100%;
    margin:0;
    padding:0;
    }

.wrapper{
    min-height:100%;
    background-color:#00CC33;
    }

.header{
    background-color:#0099FF;
    }


.footer {
    background-color:#999999;
    height:50px;
    position:relative;
    margin-top:-50px;
    }



The background colors are there just for reference reasons.
I tried alot of the other solutions out there and it seems that all of the prominent ones were written in 2003, and they suck. This is the simplest, most elegant solution that I have seen....That is until we try it with a page that has more vertical content that needs to be scrolled. This screws everything up....So my solution was to give the wrapper a value of  "margin-bottom:50px;"  The problem then is the browser will ignore the "min-height:100%;"  and it sets the Wrapper  height to whatever arbitrary value it desires. 
How to overcome that behavior?
 

Setting up a new Drupal 7 installation....

These are a couple problems that I ran into today while setting up my latest Drupal installation....I normally run a turnkey setup from my webhost but I decided to go ahead and use an old lap top as a server in my office just for dev purposes.

Here are the hurdles that I ran into and what I did, really this is gleaned from reading other people's blogs, posts, etc....but there are a couple bits that some leave out that might be useful to someone. Or at least useful to me when I do this again in a year and forget some bit along the way.


1. MYSQL login
         Reset Password
                 Server rejected send messages (Ubuntu requires all admin cmds to be sent as SUDO)


2. Settings.php file permissions
         CHMOD didn't work as 775, the owner of the file needs to be the web server itself which in my case (lamp stack, Ubuntu 12.04) is www-data. 775 with CHOWN as www-data works.





--------------------------------------------------------------------------------------------------------------


Drupal 7 - Post Installation:


Setting relative file paths for uploads found in "Home » Administration » Configuration » Media" for the Private directory results in Drupal attempting to create a directory if one does not exist. This would be fine, but the directory does exist. I have the private directory outside the directory structure that Drupal is installed in. Ok great you say, that is of course how you are supposed to do it for security reasons...However when I put the double dot operator to move up the directory structure as follows:

 It fails to create the private location further up the directory structure....so when I go and manually create the directory in linux and CHOWN it over to "www-data" (the webserver's username according to the server.) And set it to CHMOD 775 it still fails to work. The relative file path settings seem to fail. Anyone with any insight into this?






Tuesday, August 7, 2012

Something new-ish.

Is there not a solution that already exists that allows me to recursively search my directories on my server and then use that directory structure as album links for a gallery view? After having searched the directories it should then treat each of those directories as an album and contain the various tools that you expect when viewing photos (resize, crop, rotate, etc). This also needs to auto-resize photos for the thumbnail view, and be web two point oh-ish...something along the lines of jquery lightbox. Exif data might be nice, but is certainly not a deal breaker. It should probably cache that crawl of the directory and maybe through a cron job it can recrawl every so often. I would also like authorized users to be able to upload as well. But uploading the files through the gallery should NOT be required a lá Gallery3. (Rather annoying as I have a structure and lots of files already uploaded on my server.) And I would like to be able to just dump new folders on the server after a day of shooting and have to do nothing but run a cron job and then hand out the URL for interested parties to look at. Tall order?
Maybe...but that is what I do...