{else}<h2 class="single-title"> </h2>
File header.html
Lines 25 through 31:
Quick Code
<?php require (TEMPLATEPATH . "/styles/style_main.css.html"); ?>
<?php require (TEMPLATEPATH . "/styles/style_header.css.html"); ?>
<?php require (TEMPLATEPATH . "/styles/style_page.css.html"); ?>
<?php require (TEMPLATEPATH . "/styles/style_content.css.html"); ?>
<?php require (TEMPLATEPATH . "/styles/style_post.css.html"); ?>
<?php require (TEMPLATEPATH . "/styles/style_comment.css.html"); ?>
<?php require (TEMPLATEPATH . "/styles/style_sidebar.css.html"); ?>
Line 58:
Quick Code
<?php require (TEMPLATEPATH . "/styles/ieHacks/style_ie_behavior.html"); ?>
File footer.html
Line 64 :
Quick Code
<?php require (TEMPLATEPATH . "/styles/ieHacks/style_ie_behavior.html"); ?>
In file vSlider3/theme.inc, add this to line 75:
Quick Code
$theme =& $template->getVariableByReference('theme');
foreach ($childIds as $childId){
list ($ret, $resizeTable) = GalleryCoreApi::fetchResizesByItemIds(array($childId));
if (isset($resizeTable[$childId][0])) {
$theme['resizeId'][$childId] = $resizeTable[$childId][0]->getId();
}
}
foreach ($theme['children'] as $id=>$item){
if ($item['descendentCount'] >0 ){
list ($ret, $Descendent) = GalleryCoreApi::fetchItemizedDescendentCounts(array($item['id']));
$theme['children'][$id]['Descendent'] = $Descendent[$item['id']];
}
}
In file vSlider3/templates/album.tpl, find this:
Quick Code
{if (!$theme.lightbox_plugin_active)}
{capture assign=linkUrl}
href="{g->url params=$theme.pageUrl arg1="itemId=`$child.id`"}"
{/capture}
{else}
{capture assign=linkUrl}
href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="lightbox[Photo]" title="{$child.title|markup}<br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">View Photo Page</a>"
{/capture}
{/if}
And replace it with this:
{if (!$theme.lightbox_plugin_active)}
{capture assign=linkUrl}
href="{g->url params=$theme.pageUrl arg1="itemId=`$child.id`"}"
{/capture}
{elseif ($theme.resizeId[$child.id] eq '')}
{capture assign=linkUrl}
href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$child.id`"}" rel="lightbox[Photo]" title="{$child.title|markup}<br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">View Photo Page</a>"
{/capture}
{else}
{capture assign=linkUrl}
href="{g->url arg1="view=core.DownloadItem" arg2="itemId=`$theme.resizeId[$child.id]`"}" rel="lightbox[Photo]" title="{$child.title|markup}<br><a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}">View Photo Page</a>"
{/capture}
{/if}
See? Can’t be more up-to-date than this!
You see it running on this website, so I guess its working…
So, what’s new? Tons of things. For a complete list, check the specific download pages on Cool Stuff, but here are the highlights:
I tested as much as I could, but there were so many changes and new features, a few bugs are bound to appear. If they do, please let me know and I’ll try to fix them ASAP.
Also there were a couple of other features suggested by some of you that I thought would be cool, but didn’t make into this version (you have to draw the line somewhere). They might make it into version 3.1 later on…
I also take this opportunity to present another side project I started with my wife - OneWorldToSee.com. No, it’s another WP theme or another nifty tool. It’s kind of a “life project” - a plan to travel around the world and see *everything* worth seeing. The OneWorldToSee.com website is a blog about this plan and the passion for exploring in general. I invite you all to become members and even post your own texts about travel experiences.
It is also a way to finance it, since we decided to “sell” the world in order to see it - you’ll understand once you see it
All the stuff I’ve been making here in iRui.ac is free and will continue to be. I used to have a donation page and even an Amazon wish list, but that’s all gone now. Instead, if you feel compelled to show your appreciation and help us in process, hop over to OneWorldToSee.com and see how you can contribute.
Have fun with vSlider 3!
]]>Order of the Start Menu items
One of the most irritating features of Windows XP is that you can’t easily sort the program entries on the Start Menu - they just follow the order they are installed. In previous versions there was a “sorting” option, but for some strange reason, Microsoft decided to remove it. Luckily, you can still do it by editing the registry. Open the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\
CurrentVersion\Explorer\MenuOrder\Start Menu2\Programs
(it’s possible that you can have “Start Menu” instead of “Start Menu2”)
There is a binary value called “Order” inside this key – delete it. Next, reboot your computer. Now all the items are sorted by alphabetical order.
Unfortunately, every time you install a new program, it will still go the end of the list, so you might to want to do this trick from time to time. Oh well, better than nothing…
Change the Drive Name and Icon
Most people can have quite a few drives in their Explorer – hard drives, CD-ROMs, DVD burners, external drives and even virtual drives, from applications like DAEMON Tools or similar. Some drives might have their own personalized name and icon, but most often then not they get the Windows default icon and name, like “CD-Rom drive”. It would be much nicer if they had a customized name, like “Sony DVD Burner” or “Maxtor External”. Even better, they could have their own custom icon, like the company logo. Well, you can also achieve this by a few changes to your registry. Open the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\
CurrentVersion\Explorer\DriveIcons
If by any chance this key doesn’t yet exist, create it. Then create a key for each drive that you want to customize, giving the drive letter as a name – for instance “…\DriveIcons\G”.
If you want to define a custom icon, inside the drive letter key create another key called “DefaultIcon” and set the “(Default)” value to the location of an icon file (those tiny files with an .ico extension). You should have a bunch of them already, but you can get more on the Internet or even make your own.
If you want to specify the name, create another key within the drive letter key called “DefaultLabel” and set it’s “(Default)” value whatever text you want, like “My tiny USB stick”.
Refreshing Explorer might be enough to see the results, but you might have to reboot the computer.
-Dsun.java2d.noddraw=true
This disables the use of DirectDraw for that application, and problem solved!
But ever since I got my new computer, I’ve had problems with practically ALL Java applications, including applets and such. At the first I didn’t care much, but lately it started to bother me a lot the way that applications were completely “freezing”. So, what I needed was a way to disable DirectDraw automatically for all applications automatically – a kind of “system wide” parameter. I found some people suggesting to disable video hardware acceleration completely on Windows. But, c’mon, I’m not going to lower the performance of my machine just because of a few measly applets!
Finally I found what I think it’s the perfect solution. I added a System Environment Variable named _JAVA_OPTIONS and provided the value -Dsun.java2d.noddraw=true. Every time the JVM starts, it will look for this environment variable and pass the provided parameters automatically. I can tell you that it works great!
<blockquote>The first step to getting the things you
want out of life is this: Decide what
you want.</blockquote>
Using CSS, we can assign a distinct look and feel to make the quote stand out from the text, like making it italic and maybe even indent it a little. A very common technique is to use an image as the quote symbol, and by setting it as the background of the block, we can have a rather nice effect, without any messy “img” tags.
I’ve created a custom quote image for the vSlider theme, and the CSS to use it, so the previous example would be rendered like this:
The first step to getting the things you want out of life is this: Decide what you want.
Now, the problem is that although this looks quite ok, it would be a lot nicer if we could also have the closing quote as well. And this is where the problems begin, since in CSS there is no way we can use two different images as backgrounds for the same block. If we could, it would be rather simple: the opening quote would be defined in the top left, and the closing quote on the bottom right. Since this is not possible, again we have one of those (unfortunately common) situations where we have to mix semantics and presentation. By adding a “div” tag, we can create a nested block with its own style and that can be used as a placeholder for the closing quote.
In the case of vSlider, I have defined this as a class named blockquote-inner. So, we can slightly change our previous example to:
<blockquote>
<div class="blockquote-inner">The first step to getting
the things you want out
of life is this: Decide what you want.</div>
</blockquote>
And the result would be:
The first step to getting the things you want out of life is this: Decide what you want.
Which looks a lot better, if I may say so. Uglier code, true… but nicer result ![]()
If you are using the vSlider theme, you can give it a try.
Some people have asked me how to change the header image, or how to get the effect they see on iRui.ac of getting a different image on each page refresh. It’s really, really simple. If you look to the folder structure of the theme, you will notice that the default image is located in \vSlider\images\headers\vSlider.jpg, but there is no direct link to this image on the HTML code. That is because I’ve added a little bit of PHP code that selects randomly any image located on that same folder. That is, just dump all your header images there, and they will be immediately picked up – you don’t have to change any code. They should all be the same size as the default one, of course.
I would also like to ask for some feedback on how well the theme works in other browsers and operating systems. As I mentioned in the download page of the theme, I only know how it looks and behaves in IE, FireFox and Opera. If you can leave some comments about this, I would appreciate it.
Also, if you have suggestions for improvements, feel free to shout them out!
Now, there are a couple of options to deal with this. You can disable the wildcard DNS, or mess around with the httpd.conf files, but there are always some loss of functionality if you do this.
For my specific case, I came up with an alternative solution, that doesn’t involve messing around with any configuration whatsoever. You can use a small piece of PHP to interpret the request and then redirect if needed. The basic idea is that if the page sees that the “intended” domain is different, then it redirects the page by sending a new location.
Here’s an example (you have to adapt it to your specific situation):
<?PHP
// Handy function to test end of strings
function endsWith( $str, $sub ) {
return ( substr( $str, strlen( $str ) - strlen( $sub ) ) == $sub );
}
$requested_host = $_SERVER['HTTP_HOST'];
// If the request was meant for xyz.com
if(endsWith($requested_host, "xyz.com")) {
header("Location: http://xyz.com");
}
// Anything else goes here
else {
header("Location: http://abc.com");
}
?>
This may be slightly different for you case, and can even be improved to handle “any” domain, but I think you get the point.
]]>It’s what your browser gets when it can’t find the page you requested.
There, a very low-tech explanation that goes straight to the point. If you want a “real” explanation, I suggest www.plinko.net.
Take a look around - they have everything you need to know about 404, and then some.
When I was making my very own custom 404 page for this blog, which should be a reasonably easy task, I stumbled upon a really weird problem. No matter how much I tried, I could not see the page in Internet Explorer. It was working fine in Firefox, but IE kept showing me its own standard “Page not found”. I went googling on the problem and it became clear that this is a known issue. IE is a little bit too smart for its own good – if you dig through the options, you’ll find a little gem named “Show friendly HTTP error messages”. If this is enabled, then IE can choose to ignore the content of error pages and show its own version of them. And, this option is enabled by default (of course…).
A good workaround is to prevent your browser from knowing that your page is actually a 404 page, and you can do that by forcing the return of a code 200.
How exactly you do that? Well depends on which technology you are using for generating the pages. Basically, you must be able to control the HTTP headers being returned. In the case of PHP (which I use in this case), I could solve my problem by adding this block of code:
<?php
header("HTTP/1.1 200 OK");
header("Status: 200 OK");
?>
The two different styles of declarations are just to ensure that will work, regardless of what version of PHP is being used. Note that this must absolutely be the first thing on the page!
You can check my 404 page. If I did my job right, you should see it, even in IE.