WESSITE

Archives

You are currently viewing archive for March 2008
Lately I have been seeing a lot of websites which you can use to retrieve the flv url of a YouTube video. If you are browsing in a safari browser of apple it's actually very easy to get this url of the video file without using such a retrieval website. Because the addresses of everything which is downloaded to see an internet page is stored temporarily in the Activity monitor. Just click "window" in the upper menu of safari and choose "Activity monitor". Now a window will open, something like this:

Safari's Activity Monitor

Now just select the flv url, copy it, enter it in your browser url box and there you go. You can use this method on almost every flash video website for that matter.
  • 2008Mar 05
  • PUBLISHED IN Apple
A while back I was searching on the internet for a decent photo popup script but I didn't find the one I was looking for. I started to code one of my own using bits and peaces of other scripts. This is the code I ended up with and I'm pretty satisfied with it. It is pretty simple and does the things I want it to do.

function Foto(img,txt,width,height) {

        foto1 = document.createElement('img');
        foto1.src = img;
       
        if(!txt) {txt=img}
        vars="width="+width+",height="+height+",left="+((screen.width-width)/2)+",top="+((screen.height-height)/2);
       
        newwindow=window.open("","newwindow",vars);
        newwindow.document.clear();
        newwindow.document.write("<html>\n<head>\n<title>"+txt+"</title>\n");
        newwindow.document.write("<meta http-equiv=\"imagetoolbar\" content=\"no\">\n");
        newwindow.document.write("</head>\n\n<body style=\"margin:0px; padding:0px; cursor:pointer;\" onblur=\"javascript:window.close();\">\n");
        newwindow.document.write("<img src=\""+img+"\" border=\"0\" onclick=\"javascript:window.close();\">\n");
        newwindow.document.write("</body>\n</html>\n");
        if(newwindow.document.focus) {newwindow.document.focus();}
        newwindow.document.close();
}

To use this script save this code in a file called popup.js or click here to download it and upload it to your server with your favorite ftp client. The next step is to add a small piece of code to your head part of your page, something like this:

<script type="text/javascript" src="/popup.js"></script>

Now you can add popup links to your pictures by using a link format like the following:

<a href="/img/bigimage.jpg" onclick="Foto(this.href, 'My Photo Title', '800', '600'); return false;">Link</a>

Notice the href attribute just points to the image url not a javascript function, so when a visitor who has javascript disabled clicks the link or thumbnail he will still go to the big image in the same window. This is also the case with the crawlers of search engines, so your images will still get indexed.
Last month I wanted to make a zebra effect for the headlines list on my nucleus site bmxaction.net. I didn't find a plugin or something for it so I wrote a little script for it. It's actually really easy to get this effect.

First I made a little zebra.php file with the following code:

<?php
global $z;
if($z % 2 !== 0) {
      echo ' class="zebra"'; $z = 1;
}
$z++;
?>

To add the this in the iteration of my items I went to the my headline template and added this in a phpinclude tag like so:

<li<%phpinclude(zebra.php)%>>
<div class="date"><%date%></div>
<h2><a href="<%itemlink%>" title="Read entry: <%title(attribute)%>"><%syndicate_title(50)%></a></h2>
</li>

The last step is to add some css to make a difference in background:

.zebra
{
      background:#CCC;
}

That's it! Now you have a cool zebra effect.