Archive for August, 2007

h1

Opacity

August 26, 2007

It works on all browsers except IE6. Because IE sucks!

filter:alpha(opacity=25);
-moz-opacity:.25;
opacity:.25;


From my codix.

h1

Links In and/or Out of Site

August 26, 2007

Due to power of CSS3 (yes, no IE6 again, because IE sucks), you can have an specific style for all links that belonged to a specific domain of your choice.

a[href*="http"] {

}

Example:

a[href*="www.beyondeternal.com"] {

}


From my codix.

h1

Truncates Words

August 26, 2007

This code truncates the sentence into specified number of words.

//-- truncates entries
$entry = "This is where the long entry is placed.";
$words = split(" ",$entry);
$excerpt = join(" ",array_slice($words,0,50));
echo $excerpt;
echo " [more]";


From my codix.

h1

Scrollbar (All browser)

August 26, 2007

Want a vertical scrollbar? Use this:

overflow: -moz-scrollbars-vertical;
overflow-y: scroll;


From my codix.

h1

Read Line Breaks in Post

August 26, 2007

To read line breaks (\n) to post, use:

nl2br($result['message']);


From my codix.

h1

Styling Input Boxes

August 26, 2007

This is a CSS3 feature. Therefore, no IE6.

To style a text input box:

input[type=text] {
[insert code here]
}

To style a submit button:

input[type=submit] {
[insert code here]
}


From my codix.

h1

First Letter of a Paragraph

August 26, 2007

To style a first letter of a paragraph:

p:first-letter {
[insert code here]
}


From my codix.

h1

Image Within Boxes

August 26, 2007

boxes.jpg

To attain something like that above using Adobe Illustrator, here’s what you should do:

  1. Path Finder
  2. Shape Modules > Add
  3. Clipping Mask


From my notebook back in DTW.

h1

Auto Hyperlink

August 26, 2007

Honestly, I don’t get all the\\ and the //.function auto_hyperlink($hyperlink) {
$href_link = eregi_replace("([[:alnum:]]+)://([^[:space:]]*)([[:alnum:]#?/&=])", "<a href=\"\\1://\\2\\3\">\\1://\\2\\3</a>", $hyperlink);
$mailto_link = eregi_replace("(([a-z0-9_]|\\-|\\.)+@([^[:space:]]*)([[:alnum:]-]))", "<a href=\"mailto:\\1\">\\1</a>", $href_link);
return($mailto_link);
}
$true_msg = auto_hyperlink($true_msg);


From my codix.

h1

Truncates Sentences

August 26, 2007

This code truncates a paragraph to specified sentences:

$entry = "This is the first sentence. And the second sentence. The third sentence. And the fourth.";
$sentence = preg_split("/[\.\!\?]/", $entry);
for($i=0; $i<count($sentence);>
echo("$sentence[$i]<br />\n");
}</count($sentence);>


From my codix.