iBlog random » internet http://blog.zurka.us Just another WordPress weblog Tue, 28 May 2013 20:28:47 +0000 en-US hourly 1 http://wordpress.org/?v=3.6 Microsoft vs. The World (I guess) http://blog.zurka.us/microsoft-vs-the-world-i-guess/ http://blog.zurka.us/microsoft-vs-the-world-i-guess/#comments Thu, 18 Jun 2009 10:49:51 +0000 nasal http://blog.zurka.us/?p=1012

So i’ll just put some links inhere and write a bit, but not much, cause I don’t know what to write.

Did you see Microsoft’s new IE8 campaign? They are giving away $10,000 to the one that finds a hidden webpage that can be seen only using their newest browser.

TenGrandIsBuriedHere.com

Than, a Mozilla developer (IE’s rival, Firefox), shows Microsoft where that ten grand is buried.

TenGrandIsBuriedThere.com (zoom in)

This is just hilarious :D What’s wrong with people? If you check that Microsoft’s page with a browser that is not IE, their site will greet you saying your browser sucks and that you should download their newest one.

I think it’s their fault people are using other browsers. That happened just because they didn’t respect the web standards and then people didn’t care much (they always did but not everyone) optimizing the site for IE. Now they are saying other browsers suck, when their browser sucked more then all of the other browsers will suck together in a hundred years!
:D

And for the finish, take a look at this painting, it’s great.

ie go home!

Have swing!

]]>
http://blog.zurka.us/microsoft-vs-the-world-i-guess/feed/ 1
Make Your Titles Dynamic with PHP http://blog.zurka.us/make-your-titles-dynamic-with-php/ http://blog.zurka.us/make-your-titles-dynamic-with-php/#comments Tue, 26 May 2009 15:25:00 +0000 nasal http://blog.zurka.us/?p=938

When developing your website, if you want to rank well in search engines it is crucial that you use different titles for every sub-page you’ve got online. This is because these search engines (Google, MSN etc) love your titles and categorize your site based on them. This is good for SEO.

This is a simple thing to accomplish using PHP but it really is very effective. I will put dumb text into them but you should use titles rich with keywords related to your niche.

$title = 'Welcome to our website!';
if (key($_REQUEST) == 'register') { $title = 'Register now'; }
if (key($_REQUEST) == '404') { $title = 'Error 404: The page is unavailable'; }
if (key($_REQUEST) == 'about') { $title = 'Who we are, what we do'; }
if (key($_REQUEST) == 'news') { $title = 'Recent news'; }

This would work if you are using urls like yoursite.com/?register, ?news etc. What it does is set a variable $title which will include the text your define according to the page we are watching. Now we need to display it in our browser.

<head>
    <title><?= $title; ?> - Your Company Name</title>
</head>

Pretty easy, isn’t it?

Oh and today I’ve found a FREE product that helps you make some money with google, all you have to pay is less then $3 for shipping and handling and they mail it to you. The offer is only valid for the US though. Click here if you are interested. It can do no harm if you’re serious about making some money online and $3 really isn’t something you could not afford!

Have swing!

]]>
http://blog.zurka.us/make-your-titles-dynamic-with-php/feed/ 2
Use PHP to Fetch an Album Artwork From Amazon http://blog.zurka.us/use-php-fetch-artwork-cd-from-amazon/ http://blog.zurka.us/use-php-fetch-artwork-cd-from-amazon/#comments Sun, 17 May 2009 22:59:16 +0000 nasal http://blog.zurka.us/?p=930

It’s actually pretty easy once you find out how to do it. By having the artist and album name you can fetch the album artwork from Amazon in three different sizes.

With php5 it’s very easy since it has an integrated xml parser. All we have to do is this:

$url = simplexml_load_file('http://webservices.amazon.com/onca/xml?Service=AWSECommerceService&AWSAccessKeyId=12DR2PGAQT303YTEWP02&Operation=ItemSearch&SearchIndex=Music&Artist=ARTIST&ResponseGroup=Images&Keywords=ALBUMNAME');

Please note that in the url I’ve put ARTIST and ALBUMNAME, which you should replace with what you’re searching for. Doing so, we get an xml file from which we can display the image like this:

echo '<img src="' . $url->Items->Item[0]->LargeImage->URL . '" />';

If we want the large one, that is. If we would like the medium one we would use MediumImage and SmallImage for the small one.

That’s it, it’s very useful if you are organizing your mp3 files or maybe building an online community or something.

Hope it helps somebody! If you find it useful, digg it!

ps: I forgot to mention that if you are using php4 this wont work, you will have to use another xml parser to fetch the image location from the xml provided by Amazon.

Have swing!

]]>
http://blog.zurka.us/use-php-fetch-artwork-cd-from-amazon/feed/ 5
Check if A Number is Even or Odd with PHP http://blog.zurka.us/check-number-even-odd-php/ http://blog.zurka.us/check-number-even-odd-php/#comments Thu, 14 May 2009 15:04:29 +0000 nasal http://blog.zurka.us/?p=921

I’m going to show you a very simple method for finding out if a number is even or odd in php. You could use this for many things but usually this is mostly used when you have a, let’s say, table and you want to color the background of every second row differently.

The php code looks like this:

if ($number % 2) {
    echo 'The number is even';
} else {
    echo 'The number is odd';
}

In real life we would use something like this:

$i = 0;
while ($something = mysql_fetch_assoc($query)) {
    echo '<div style="padding: 5px; background: #' . ($i % 2 ? 'eee' : 'ddd') . ';">Content</div>';
    $i++;
}

And of course, likewise you could check if a number is divisible by another number using this:

if ($number % 3 == 0) {
    echo 'The number is divisible by 3';
} else {
    echo 'The number is not divisible by 3';
}

Easy peasy, as always!
Have swing!

]]>
http://blog.zurka.us/check-number-even-odd-php/feed/ 0
Simple Way of Implementing BBCode with PHP http://blog.zurka.us/simple-way-of-implementing-bbcode-with-php/ http://blog.zurka.us/simple-way-of-implementing-bbcode-with-php/#comments Fri, 08 May 2009 22:46:06 +0000 nasal http://blog.zurka.us/?p=916

When posting on forums, we usually use BBcode for styling our texts. When developing webpages, if we want to let our users style their profiles but don’t want to give them permission to style directly with CSS or html (<strong> etc..), we could simply use this piece of code to let them use those BBcodes.

Please note that we could do this using REGEX but as I used the word ‘simple’ in the title of the post, I’m going to make it really simple :)

The first thing we do is create an array with the tags we are going to use. In my case, my array is $bbcode and I’m going to use codes in square brackets, just as forum platforms do. Take a look at the code, you will see it really is simple.

$bbcode = array(
    "[big]" => "<big>",
    "[/big]" => "</big>",
    "[b]" => "<strong>",
    "[/b]" => "</strong>",
    "[i]" => "<em>",
    "[/i]" => "</em>",
    "[u]" => "<u>",
    "[/u]" => "</u>",
    "[img]" => "<img src=\"",
    "[/img]" => "\" border=\"0\" />",
    "[sup]" => "<sup>",
    "[/sup]" => "</sup>",
    "[sub]" => "<sub>",
    "[/sub]" => "</sub>",
    "[quote]" => "<span class=\"quote\">",
    "[/quote]" => "</span>",
);

As you can see, for the quotes I use a SPAN element with class=”quote” but it could be a DIV as well, since I’m styling it as a block element in my CSS file.

Next, to change our text into the styled one, all we have to do is use the strtr function and use our array as the – guess what – array with replace pairs.

echo strtr('Hello. I am [b]bolded[/b], I am [u]underlined[/u] and I am [big]big[/big]!', $bbcode);

That’s it! As Duke Nukem would say.. piece of cake.

Have swing!

ps. I know it doesn’t include the useful codes as [url] but for that we should already use regex.

]]>
http://blog.zurka.us/simple-way-of-implementing-bbcode-with-php/feed/ 1
The Complete Animated History of the Internet http://blog.zurka.us/the-complete-animated-history-of-the-internet/ http://blog.zurka.us/the-complete-animated-history-of-the-internet/#comments Tue, 10 Feb 2009 17:49:02 +0000 nasal http://blog.zurka.us/?p=848

A nice watch about teh internets.

And sorry for not writing lately :) Will do something soon, I promise.

]]>
http://blog.zurka.us/the-complete-animated-history-of-the-internet/feed/ 0
The easiest 100€ per month you will ever earn http://blog.zurka.us/the-easiest-100e-per-month-you-will-ever-earn/ http://blog.zurka.us/the-easiest-100e-per-month-you-will-ever-earn/#comments Tue, 04 Nov 2008 14:27:25 +0000 nasal http://blog.zurka.us/?p=645

As everyone knows, there is a ton of affilate programs in which you need to be accepted, and it may happen that you wait for a long time and then your site doesn’t get even accepted.

The story is different with the Matched affilate program, where the method for earning 100€ (a little less) per month is actually very easy.

So here it goes:

- Register to Matched as a publisher and you get £5 (6,26€) only for registering (yes, only for taking the time to fill a form).

- Add your website and 5 sub-pages (they don’t need have a lot of visits)

- You can add up to 5 webpages

- In the next 24 hours, you should see a notice saying that they are trying to match an ad to your page. When it’s done you just add their code to your site.

- For every page you earn £3. With a simple calculation, we see that we can earn £3 * 5 * 5 = £75 = 93,98€ every month, practically by doing nothing.

- In yuor account click “Affilates” and in a moment you are an Affilate, get a link to give to your friends so they can register as well. Did I mention that you get £5 for everyone that registers through your link? ;)

I suggest you registering to Matched and giving it a try. You have nothing to lose and a lot to earn :)

If you register with my affilate id, I can return the favor by putting a banner pointing to your site for one month (in the sidebar) or by registering as your affilate. Thank you!

PS. they pay on PayPal

]]>
http://blog.zurka.us/the-easiest-100e-per-month-you-will-ever-earn/feed/ 0