Change the page that the blog displays on
SETTINGS –> Reading –>
Remove search box from main nav menu
Remove search box from main nav menu:
Go to ‘Appearance > Editor > Header (header.php)
Find the following close to the end:
<?php get_search_form(); ?>
Remove it, or, replace it with the follow:
<!– <?php get_search_form(); ?> –>
focus() in Firefox
You have to set a little delay in the focusing of the field.
setTimeout(function(){field.focus()}, 10);
I found this from at http://www.codingforums.com from a user post.
Javascript not inline
window.onload = function()
{
document.getElementById(‘div1’).onclick=readPage;
}
function readPage()
{
alert(‘test’);
}
CSS3 IE ie-css3.htc
CSS3 support for Internet Explorer 6, 7, and 8
What is it?
IE-CSS3 is a script to provide Internet Explorer support for some new styles available in the upcoming CSS3 standard.
How it works
If you’re viewing this page in Internet Explorer, some of the elements have been rebuilt by the script in Vector Markup Language (VML), an IE-specific vector drawing language. VML supports things that are missing from IE’s CSS implementation like rounded corners and blur effects.
How to use it
Just add CSS styles as you normally would, but include one new line:
.box { -moz-border-radius: 15px; /* Firefox */ -webkit-border-radius: 15px; /* Safari and Chrome */ border-radius: 15px; /* Opera 10.5+, future browsers, and now also Internet Explorer 6+ using IE-CSS3 */ -moz-box-shadow: 10px 10px 20px #000; /* Firefox */ -webkit-box-shadow: 10px 10px 20px #000; /* Safari and Chrome */ box-shadow: 10px 10px 20px #000; /* Opera 10.5+, future browsers and IE6+ using IE-CSS3 */ behavior: url(ie-css3.htc); /* This lets IE know to call the script on all elements which get the 'box' class */ }
Issues and Workarounds
You would expect URLs in behavior: url(...)
to be relative to the current directory as they are in a background-image: url(...)
style for example, but instead Microsoft decided to ignore standards here and make them relative to the docroot instead. So behavior: url(ie-css3.htc)
should work if ie-css3.htc is in the root directory of the site.
You will probably run into issues with z-index, especially if embedding one IE-CSS3 enabled element inside of another. There are two simple workarounds:
- Set the z-index of the IE-CSS3 element to a number larger than its surrounding elements.
- Make sure the IE-CSS3 element is positioned, such as with
position: relative
orposition: absolute
Sometimes an IE-CSS3 element will show up at a slightly different position than the original, untouched element. There could be a few reasons for this:
- You have broken tags somewhere in your markup, probably above the IE-CSS3 element.
- You are experiencing misc IE6 and IE7 bugs. Try adding the styles
zoom: 1
and/orposition: relative
to the IE-CSS3 element and its immediate parent. You could also try removing any margins on the IE-CSS3 element and/or its parent, use padding instead.
Styles and their status
Style | What works | What doesn’t work |
---|---|---|
border-radius |
|
|
box-shadow |
|
|
text-shadow |
|
|
http://fetchak.com/ie-css3/
PHP Security Guide
I can never read too many of these.
This guide aims to familiarise you with some of the basic concepts of online security and teach you how to write more secure PHP scripts. It’s aimed squarely at beginners, but I hope that it still has something to offer more advanced users. Enjoy.
PHP crypt() – Using PHP encryption methods
I had not done any user registration type stuff in the past and needed to figure this out. I wanted to store an encrypted password in a database, and then be able to compare a submitted pw at login.
I tried using crypt() and it did successfully store the encrypted password in the db. Then I need to be able to compare it to form submitted pw to let the user login. I tried to just encrypt the submitted pw the same way, but this didn’t work.
There is a second “optional” argument (salt string) for the crypt() function, but for my purposes, this was required. I used the salt method described on the site below and it worked like a charm. I can’t pretend that I understand exactly how the salt works, but it does.
I found the solution here: http://php.ss23.geek.nz/2011/01/12/Using-crypt.html
$Salt = uniqid(); // Could use the second parameter to give it more entropy.
$Algo = ‘6’; // This is CRYPT_SHA512 as shown on http://php.net/crypt
$Rounds = ‘5000’; // The more, the more secure it is!
// This is the “salt” string we give to crypt().
$CryptSalt = ‘$’ . $Algo . ‘$rounds=’ . $Rounds . ‘$’ . $Salt;
$PASSWORD = crypt($PASSWORD_REG,$CryptSalt);
Cross-Browser Inline-Block
Does it seriously need to be this hard to do what seems to be a simple thing?
display: inline-block is really a cool thing, or is it?
http://blog.mozilla.com/webdev/2009/02/20/cross-browser-inline-block/
JavaScript: change CSS
This is a simple script that will change the CSS of any object.
You send the function the ID, the CSS attribute you want to change, and the value..
I actually struggled a bit with this as using dot syntax for the CSS attribute would not work. I had to use brackets.
<div id=”myDiv” onclick=”CSS_change(‘myDiv’,’color’,’#ff0000′)”>Change Color</div>
function CSS_change(ID, CSSATTRIB, VALUE)
{
var obj_style = document.getElementById(ID).style;
obj_style[CSSATTRIB] = VALUE;
}
setAttribute(“class”…… does not work in IE9
This does not work in IE9:
var button_div_container = document.createElement(“div”);
button_div_container.setAttribute(‘class’, ‘button’);
You must do it this way:
var button_div_container = document.createElement(“div”);
button_div_container.className = “button”;
WTF?