So one of the websites I am developing has a static header, there are a few examples of this being used such as Next; the issue comes, when you require lots of information in this header but use a responsive layout, the header is then taking up real estate for your main content (even more so in landscape mode).
So this is where hiding the less vital information such as the company logo and search could come in useful; so I developed a small hacky jquery base script to do this. It isn’t perfect and it’s my first serious javascript on this site so please be kind!
The script hides a div on scroll and displays another to allow you to have a small “show div” button available at all times. if then shows and hides when the display is resizes to a desktop resolution.
Have a go of the demo and feel free to steal the code; if you find any better ways of doing it then don’t hesitate to contact me.
It requires openlogos font too for the debian/distro logo and curl for the public ip. The initial script isn’t mine; it’s just oen I found and them modified.
So this afternoon, I decided to upload and release my latest function mailattch. This function takes php’s mail to a whole new level, allowing files to be attached!
There are currently limitations to it and it isn’t highly tested but everyone is welcome to use it and is release under GPL v3.
I have also pushed a little update to ldir. It’s nothing big, just a shameless link back to here; if you really don’t like it then you’re free to remove it from the function source or you can hide is with CSS via display: none; on the class .ldir_link.
After reading through ldir’s latest release I found a few bugs which have now been fixed in ldir 1.7.10.
I’ve also rewritten the icon file type check, so we assume some common file types are available and then add any new ones to the array on that call, so if that type is found again in that folder, the icon is already known. All in all resulting in a considerably faster speed for listing the same file types or common files.
There are more extensions supported than listed but I chose not to include them all but you can if you wish.
I will also be looking at overhauling the icons and providing them as a pack allowing you to self host which at the moment isn’t possible due to licesning issue.
Yes, I know… No updates for nearly 12 months and then two come along in the same week!
ldir version 1.7.9 is now 10% smaller than 1.7.8! As well as saving minimal disk space, it’s also had some speed increaces.
The only downside is that we had to remove error code 3 from the function in order to speed it up; there are more speed increases to be had if I could reliably detect the file type icons with a fail over if there isn’t a type without utilising cURL.
If you want to customise ldir to not do those checks and just ignore unknown file type icons then the following code alterations will make a significant speed increase.
Change: (approx line 160)
$img = "unknown.png";
$type = "Unknown File";
//Remove this check to speed things up.
if(ldir_url_exists($ldir['im'].strtolower($ext).".png",$ldir['v'])) {
$img = strtolower($ext).".png";
$type = strtoupper($ext)." File";
}