Friday, October 29, 2010

show and hide text in texbox

jQuery(document).ready(function(){
     jQuery('#search').focus(function(){
 if(this.value=='Search fonts to Download...') { this.value='' }
     });
    jQuery('#search').blur(function(){
 if(this.value=='') { this.value='Search fonts to Download...' }
   });
});

Thursday, October 28, 2010

Breadcrumbs in wordpress

global $post; // if outside the loop

if (is_page() && $post->post_parent) {
    $parent_title = get_the_title($post->post_parent);

    echo ' » ' . $parent_title . ' » ';
    wp_title('');

} else if (is_page()) {
    echo ' » ';
    wp_title('');

} else {

}

Display title of parent & sub page

global $post;
if($post->post_parent)
{
$parent_title = get_the_title($post->post_parent);
echo $parent_title;
}
else 
{
wp_title('');
}

Friday, September 10, 2010

How to Add the Parent Category as a Class in body_class()


<?php $class=''; /* Make it void by default */

if ( is_single() || is_category() ) { /* Only do this if we're on a single post or category page */
$category = get_the_category();
$parent = $category[0]->category_parent;
$class = get_cat_name($parent); /* assign the permalink name for the parent category to the object $class */
}?>

<body <?php body_class($class); /* This will add our custom class, which is void if we aren't on a single post or category page */ ?>>

Monday, September 6, 2010

How to add span tag into page navigation

<?php 
echo preg_replace('@\<li([^>]*)>\<a([^>]*)>(.*?)\<\/a>@i', '<li$1><a$2><span>$3</span></a>',wp_list_pages('echo=0&orderby=id&title_li=&depth=1'));
?>

Wednesday, August 25, 2010

remove default feed in wordpress

go to edit wp-includes/feed.php


function get_default_feed() {
//return apply_filters('default_feed', 'rss2');
}

Wednesday, August 18, 2010

how to add odd/even loop in array

1. ount the loop number


for($i=0;$i<$blah;$i++)
if($i&1){
// ODD
}else{
// EVEN
}



2. odd loop itteration


$oddLoop = false;
foreach ($findposts as $findpost):
//.....
if($oddLoop=!$oddLoop){
// code for odd loop numbers
}else{
// code for even loop numbers
}


3. Odd ID number

if ( ( $findpost->ID ) != $id ) {
if($findpost->ID & 1){
// ODD
}else{
//EVEN
}



The three ways are


1. Modulo
for ($i = 0; $i < 10; $i++)
{
 
if ($i % 2 == 0)
 
{
    echo
"even";
 
}
 
else
 
{
    echo
"odd";
 
}
}


2. Flipping boolean value

$even = true;
for ($i = 0; $i < 10; $i++)
{
 
if ($even)
 
{
    echo
"even";
 
}
 
else
 
{
    echo
"odd";
 
}

  $even
= !$even;
}


3. mentioned boolean operator

for ($i = 0; $i < 10; $i++)
{
 
if ($i & 1 == 0)
 
{
    echo
"even";
 
}
 
else
 
{
    echo
"odd";
 
}
}

Friday, August 13, 2010

Add custom CSS classes to the wysiwyg drop-down


function ses_tinymce_css($wp) {
$wp .= ',' . get_bloginfo('stylesheet_url');
return $wp;
}
add_filter( 'mce_css', 'ses_tinymce_css' );

or

add_filter('mce_css', 'plugin_mce_css');
function plugin_mce_css() {
return plugins_url().'/plugin/customTinyMCE.css';
}

Thursday, August 12, 2010

Add Favicon on WordPress Blog

There are several ways to add favicon on WordPress blog

1.code on the header


<link rel="shortcut icon" href="/favicon.ico" />
<link rel="icon" type="image/png" href="/favicon.ico">


2. using WordPress Hook


function add_theme_favicon() { ?>
<link rel="shortcut icon" href="/images/favicon.ico" >
<?php }
add_action('wp_head', 'add_theme_favicon');

Thursday, July 29, 2010

Disable links Via jQuery

<script>

$(function(){

//grab all a tags

$('a').each(function(){

//click on a link....

$(this).click(function(){

alert($(this).attr('href')+' is not available');

//disable link

return false;

});

});

});

</script>

Wednesday, July 7, 2010

PHP pagination class


[PHP]
class pagination
{
public function __construct()
{
}
public function calculate_pages(&$total_rows, $rows_per_page, &$page_num)
{
$arr = array();
// calculate last page
$last_page = ceil($total_rows / $rows_per_page);
// make sure we are within limits
$page_num = (int) $page_num;
if ($page_num < 1)
{
$page_num = 1;
}
elseif ($page_num > $last_page)
{
$page_num = $last_page;
}
$upto = ($page_num - 1) * $rows_per_page;
$arr['limit'] = 'LIMIT '.$upto.',' .$rows_per_page;
$arr['current'] = $page_num;
if ($page_num == 1)
$arr['previous'] = $page_num;
else
$arr['previous'] = $page_num - 1;
if ($page_num == $last_page)
$arr['next'] = $last_page;
else
$arr['next'] = $page_num + 1;
$arr['last'] = $last_page;
$arr['info'] = 'Page ('.$page_num.' of '.$last_page.')';
$arr['pages'] = $this->get_surrounding_pages($page_num, $last_page, $arr['next']);
return $arr;
}
function get_surrounding_pages($page_num, $last_page, $next)
{
$arr = array();
$show = 5; // how many boxes
// at first
if ($page_num == 1)
{
// case of 1 page only
if ($next == $page_num) return array(1);
for ($i = 0; $i < $show; $i++)
{
if ($i == $last_page) break;
array_push($arr, $i + 1);
}
return $arr;
}
// at last
if ($page_num == $last_page)
{
$start = $last_page - $show;
if ($start < 1) $start = 0;
for ($i = $start; $i < $last_page; $i++)
{
array_push($arr, $i + 1);
}
return $arr;
}
// at middle
$start = $page_num - $show;
if ($start < 1) $start = 0;
for ($i = $start; $i < $page_num; $i++)
{
array_push($arr, $i + 1);
}
for ($i = ($page_num + 1); $i < ($page_num + $show); $i++)
{
if ($i == ($last_page + 1)) break;
array_push($arr, $i);
}
return $arr;
}
}
[/PHP]

call

$p = new pagination();

$arr = $p->calculate_pages(70, 10, 1);

Display random image


[PHP]
# Init Array
$files = array();
# Get Folder
if($_GET['folder']) {
$folder = $_GET['folder'];
} else {
# Set Default Folder
$folder = '/img/';
}
# Set Full Path
$path = $_SERVER['DOCUMENT_ROOT'] . '/' . $folder;
# Open Directory
if($handle = opendir($path)) {
# Loop Through Directory
while(false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
if(substr($file, -3) == 'gif' || substr($file, -3) == 'png' || substr($file, -3) == 'jpg' || substr($file, -4) == 'jpeg') $files[count($files)] = $file;
}
}
}
# Close Handle
closedir($handle);
# Init Random
$rand = rand(0, count($files)-1);
# Check Header Type
# GIF
if(substr($files[$random], -3) == 'gif') header("Content-type: image/gif");
# JPEG
elseif(substr($files[$random], -3) == 'jpg') header("Content-type: image/jpeg");
elseif(substr($files[$random], -4) == 'jpeg') header("Content-type: image/jpeg");
# PNG
elseif(substr($files[$random],-3) == 'png') header("Content-type: image/png");
# Read File
readfile($path . '/' . $files[$random]);
[/PHP]

Get text height, width

  1. define("F_SIZE", 8);
  2. define("F_FONT", "arial.ttf");
  3.  
  4.  
  5. function get_bbox($text){
  6.  return imagettfbbox(F_SIZE, 0, F_FONT, $text);
  7.  }
  8.  
  9. function text_height ($text) {
  10.  $box = get_bbox($text);
  11.  $height = $box[3] - $box[5];
  12.  return $height;
  13.  }
  14.  
  15. function text_width ($text) {
  16.  $box = get_bbox($text);
  17.  $width = $box[4] - $box[6];
  18.  return $width;
  19.  }

Monday, July 5, 2010

Text Resizing With jQuery


$(document).ready(function(){
// Reset Font Size
var originalFontSize = $('html').css('font-size');
$(".resetFont").click(function(){
$('html').css('font-size', originalFontSize);
});
// Increase Font Size
$(".increaseFont").click(function(){
var currentFontSize = $('html').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*1.2;
$('html').css('font-size', newFontSize);
return false;
});
// Decrease Font Size
$(".decreaseFont").click(function(){
var currentFontSize = $('html').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*0.8;
$('html').css('font-size', newFontSize);
return false;
});
});

Tuesday, June 29, 2010

Display 5 latest posts in each category in WordPress

<div id="page-not-found" class="post-page">

<?php
$cat_args = array(
'orderby' => 'name',
'order' => 'ASC',
'child_of' => 0
);

$categories = get_categories($cat_args);

foreach($categories as $category) {
echo '<dl>';
echo '<dt> <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>' . $category->name.'</a></dt>';

$post_args = array(
'numberposts' => 5,
'category' => $category->term_id
);

$posts = get_posts($post_args);

foreach($posts as $post) {
?>
<dd><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></dd>
}
echo '<dd class="view-all"> <a href="' . get_category_link( $category->term_id ) . '" title="' . sprintf( __( "View all posts in %s" ), $category->name ) . '" ' . '>View all posts in ' . $category->name.'</a></dd>';
echo '</dl>';
}
?>
<div class="page-end"></div>

</div>



CSS

#page-not-found dl {
width: 200px;
float: left;
padding: 0 18px 0 0;
height: 250px;
}

#page-not-found dt {
font-weight: bold;
font-size: 1.1em;
padding: 10px 0;
}

#page-not-found dt a {
color: #b0bf32;
}

#page-not-found dd.view-all {
border-top: 1px solid #c9c9c9;
font-size: 0.9em;
margin: 5px 0;
padding: 2px 0 0;
text-align: right;
}

#page-not-found dd.view-all a {
color: #999;
}

.page-end {
clear: both;
}

display the_content with setup_postdata

<?php

global $more;

$cat= 3;
$posts = get_posts ("cat=$cat&showposts=5");
if ($posts) {
foreach ($posts as $post):
$more = false;
setup_postdata($post);
?>
<h3 class="storytitle"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
<p class="storycontent"><?php the_content('Read more...'); ?></p>
<?php
endforeach;
$more = true;
}

?>

Monday, June 28, 2010

Show future posts on single post

today i show how to display future posts in single.php. you just copy code below into funciton.php.

add_filter('the_posts', 'show_future_posts');

function show_future_posts($posts)
{
global $wp_query, $wpdb;

if(is_single() && $wp_query->post_count == 0)
{
$posts = $wpdb->get_results($wp_query->request);
}

return $posts;
}

Displaying Future Posts in WordPress

If you do like I do and schedule posts ahead of time (especially on the podcast), there’s a way inside of WordPress to show your readers what posts are coming up next:

<?php
$my_query = new WP_Query('post_status=future&order=DESC&showposts=5');
if ($my_query->have_posts()) {
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<?php the_date(); ?> - <?php the_title(); ?>
<?php endwhile;
}
?>


This will display up to 5 “scheduled” posts wherever you drop in the code. Add a headline <h2> tag if you want to give it a title (should you want to use it as a widget).

Want to see this code in action? Check the WordPulse podcast page‘s sidebar to see it working!

Display a List of Upcoming Posts in WordPress

When you have completed a post in WordPress, you have the ability to save it as a draft, publish it immediately or schedule a future date when it will be published automatically.

This is extremely helpful if you want to plan ahead or if you use your WP site for events. Creating a simple list of upcoming posts lets your visitors know what they can look forward to and is pretty simple to do.




The following code can be placed in your sidebar on within any
template.
<?php
$futurePosts = new WP_Query();
$futurePosts->query('showposts=5&post_status=future&order=ASC');

if ($futurePosts->have_posts()) : while ($futurePosts->have_posts()) :
?>
<ul>
<li><?php the_title(); ?><br /><small><?php the_time(get_option('date_format'); ?></small></li>
</ul>
<?php endwhile; else: ?>
<ul>
<li>No upcoming events.</li>
</ul>
<?php endif; ?>

If you want to only display future posts from a specific category, you

$futurePosts->query('showposts=5&post_status=future&order=ASC&cat=12');

can add a cat=$id to the query like so:

Sunday, June 13, 2010

unknow error occurred (0xE8008001)

today i show you how to fixed unknow error occurred (0xE8008001) when you jailbreak ipod

http://thy4u.blogspot.com/2010/06/how-to-jailbreak-your-iphone-with.html

Thursday, June 10, 2010

How to jailbreak your Ipod with BlackRa1n RC3

Step 1: Update iTunes to the latest version available and reboot your computer.

Step 2: Download BlackRa1n RC3 from our iPhone downloads page and install it, then reboot your computer.

Step 3: Plug your iPhone in your computer and launch BlackRa1n RC3. Click on "make it ra1n"



Step 4: Your iPhone will enter recovery mode. The regular recovery mode image on your iPhone will be replaced by a picture of GeoHot (same as image above).



Step 5: BlackRa1n will run on your iPhone and then it will reboot.



A pop up will show up asking you to donate. If you successfully jailbreak your iPhone, I suggest you send $5 or $10 to GeoHot.



Step 6: Once your iPhone reboots, you will have a new icon on your springboard. This is BlackRa1n. Now make sure you have internet connection and launch BlackRa1n on your iPhone.



Step 7: Choose what installer applications you want to install on your iPhone and then tap “Install”. I suggest only installing Cydia but you may install them all if you want to.



BlackRa1n will download and install the selected applications.

Step 8: Once done installing, your iPhone will respring and you should see your installer app on your springboard.




Step 9: Once your installer app (Cydia in our case) is installed. You can safely uninstall BlackRa1n by launching the app and selecting “uninstall balckra1n”.



Step 10: Reboot your iPhone. You’re done!

Step 11: install appsync from http://www.sinfuliphonerepo.com

Goto: Cydia > Manage > Sources > Edit > Add



Hopefully this jailbreak will go more smoothly than with BlackRa1n RC3. If you have any question or comment, please leave a comment below.

Tuesday, June 8, 2010

String Search & Replace (AS2 & AS3)


function strReplace($str:String, $search:String, $replace:String):String
{
return $str.split($search).join($replace);
}
var str:String = new String();
str = "we are Khmer!"
trace(strReplace(str,"we","We"));

The "split" function splits the string at the word ($search) you're searching for. And the "join" inserts the new word ($replace) between the elements, concatenates them, and returns the resulting string

Friday, May 21, 2010

Wordpress get Page content By Page ID


<?php
if(!function_exists('getPageContent'))
{
function getPageContent($pageId,$max_char)
{
if(!is_numeric($pageId))
{
return;
}
global $wpdb;
$nsquery = 'SELECT DISTINCT * FROM ' . $wpdb->posts .
' WHERE ' . $wpdb->posts . '.ID=' . $pageId;
$post_data = $wpdb->get_results($nsquery);
if(!empty($post_data))
{
foreach($post_data as $post)
{
$text_out=nl2br($post->post_content);
$text_out=str_replace(']]>', ']]>', $text_out);
$text_out = strip_tags($text_out);
return substr($text_out,0,$max_char);

}
}
}
}
?>

How to Call function getPageContent?

<?php echo getPageContent(11,150); //First parameter is PAGE ID and second is number of words displayed. ?>

Friday, April 9, 2010

Limit the Number of Characters in a Textarea or Text Field

removing link outline around

Some browser when you click on link text or link image you always see outline box around text or image link.


a, object {
outline: none;
}

safari disable resize textarea

You can use the CSS3 'resize' property to "specify whether or not an element is resizable by the user":


textarea
{
resize:none;
}


or you can use


textarea
{
max-width: 175px; /* RESTRICT SAFARI RESIZE */
max-height: 250px; /* RESTRICT SAFARI RESIZE */
}

Tuesday, April 6, 2010

Wordpress get page title by page id.

Get page content by page id Wordpress

I have written a function and now I can fetch the content of any page or one more pages just by the page id.

<?php
if(!function_exists('getPageContent'))
{
function getPageContent($pageId)
{
if(!is_numeric($pageId))
{
return;
}
global $wpdb;
$sql_query = 'SELECT DISTINCT * FROM ' . $wpdb->posts .
' WHERE ' . $wpdb->posts . '.ID=' . $pageId;
$posts = $wpdb->get_results($sql_query);
if(!empty($posts))
{
foreach($posts as $post)
{
return nl2br($post->post_content);
}
}
}
}
?>

For exampe,

<?php echo getPageContent(6); ?>

Get page content by page id Wordpress

Get file extension

function file_get_ext(filename)
{
return typeof filename != "undefined" ? filename.substring(filename.lastIndexOf(".")+1, filename.length).toLowerCase() : false;
}

Thursday, March 18, 2010

How To Remove the White Space in wp_list_pages

The Problem

The wp_list_pages() generates either a series of
  • elements containing links to all of you blog’s pages, or a full unordered list with a heading at the beginning.
    The output of this list looks like this:

    <ul>
    <li><a href="#">Page name</a></li>
    <li><a href="#">Page name</a></li>
    </ul>


    While some browsers don’t have a problem with elements being generated on new lines, in some, this method causes a white space to show up in front of each list item. This space becomes visible and annoying when trying to create a horizontal menu with background colors and equal horizontal spacing.

    The Fix

    To get rid of the white space, your output would need to look like this:


    <ul><li><a href="#">Page name</a></li><li><a href="#">Page name</a></li></ul>


    This can be achieved by using a small PHP function that will take the code generated by wp_list_pages() and turn it into something similar to the example above. To make this function available for use in your templates you need to edit the “functions.php” file, found in you theme’s directory. If you don’t have such a file, create an empty one and name it “functions.php”.

    In functions.php add the following code at the beginning or at the end of the file. Just be careful not to paste it inside another function and cause the script to break.


    function qbkl_nospace($input) {
    $output = str_replace(array("\n", "\r", "\t"), "", $input);
    echo $output;
    }


  • Check validate HTML and CSS

    http://jigsaw.w3.org/css-validator/#validate_by_uri

    http://validator.w3.org/check?verbose=1&uri=http://thy4u.blogspot.com

    Array Max


    <html>
    <head>
    <title>Array Max</title>
    <script type="text/javascript">
    // From: http://codingforums.com/showthread.php?t=152260

    var v=[10,8,42,50] // So looking to find 50
    function srchMaxV() {
    var maxV = 0; // or value smaller that smallest in array to search, like = -1000;
    for (i=0; i if (v[i] > maxV) { maxV = v[i]; }
    }
    return maxV;
    }

    function NumSort(a,b) { return a-b; } // required for sorting numbers only
    function sortMaxV() {
    var sortedV = new Array();
    sortedV = v.sort(NumSort);
    alert('Max: '+sortedV[sortedV.length-1]+'\nMin: '+sortedV[0]);
    }
    </script>
    </head>
    <body>
    <button onclick="alert('Max: '+srchMaxV())">Search for Max
    <button onclick="sortMaxV()">Sort for Max/Min
    </body>
    </html>

    Friday, March 5, 2010

    Image watermark with PHP

    Steps:

    1. Load both images
    2. Get size of both images
    3. Copy watermark to main image
    4. Print image to screen



    PHP functions:
    imagecreatefromgif
    imagecreatefromjpeg
    getimagesize
    imagecopymerge
    header
    imagejpeg
    imagedestroy

    Watermark image:



    Main image:




    <?php  

    $main_img = "Happy_valentines_day.jpg"; // main big photo / picture
    $watermark_img = "watermark.gif"; // use GIF or PNG, JPEG has no tranparency support
    $padding = 3; // distance to border in pixels for watermark image
    $opacity = 100; // image opacity for transparent watermark

    $watermark = imagecreatefromgif($watermark_img); // create watermark
    $image = imagecreatefromjpeg($main_img); // create main graphic

    if(!$image || !$watermark) die("Error: main image or watermark could not be loaded!");


    $watermark_size = getimagesize($watermark_img);
    $watermark_width = $watermark_size[0];
    $watermark_height = $watermark_size[1];

    $image_size = getimagesize($main_img);
    $dest_x = $image_size[0] - $watermark_width - $padding;
    $dest_y = $image_size[1] - $watermark_height - $padding;


    // copy watermark on main image
    imagecopymerge($image, $watermark, $dest_x, $dest_y, 0, 0, $watermark_width, $watermark_height, $opacity);


    // print image to screen
    header("content-type: image/jpeg");
    imagejpeg($image);
    imagedestroy($image);
    imagedestroy($watermark);
    ?>


    Check password safety with JavaScript while typing

    <script language="javascript">

    function check_password_safety(pwd){

    var msg = "";
    var points = pwd.length;
    var password_info = document.getElementById('password_info');

    var has_letter = new RegExp("[a-z]");
    var has_caps = new RegExp("[A-Z]");
    var has_numbers = new RegExp("[0-9]");
    var has_symbols = new RegExp("\\W");

    if(has_letter.test(pwd)) { points += 4; }
    if(has_caps.test(pwd)) { points += 4; }
    if(has_numbers.test(pwd)) { points += 4; }
    if(has_symbols.test(pwd)) { points += 4; }


    if( points >= 24 ) {
    msg = 'Your password is strong!';
    } else if( points >= 16 ) {
    msg = 'Your password is medium!';
    } else if( points >= 12 ) {
    msg = 'Your password is weak!';
    } else {
    msg = 'Your password is very weak!';
    }

    password_info.innerHTML = msg ;
    }


    </script>

    <input type="text" name="pwd" id="pwd" size="20" onkeyup="return check_password_safety(this.value);" />

    Type your password!

    Monday, March 1, 2010

    How to Send Email from a PHP Script Using SMTP Authentication

    require_once "Mail.php";

    $from = "Sandra Sender ";
    $to = "Ramona Recipient ";
    $subject = "Hi!";
    $body = "Hi,\n\nHow are you?";

    $host = "mail.example.com";
    $username = "smtp_username";
    $password = "smtp_password";

    $headers = array ('From' => $from,
    'To' => $to,
    'Subject' => $subject);
    $smtp = Mail::factory('smtp',
    array ('host' => $host,
    'auth' => true,
    'username' => $username,
    'password' => $password));

    $mail = $smtp->send($to, $headers, $body);

    if (PEAR::isError($mail)) {
    echo("

    " . $mail->getMessage() . "

    ");
    } else {
    echo("

    Message successfully sent!

    ");
    }
    ?>

    Friday, February 19, 2010

    Standard module chrome styles

    From Joomla! Documentation


    • none. Output the raw Module content with no wrapping.
    • table. Output the module in a table.
    • horz. Output the module as a table inside an outer table.
    • xhtml. Output the module wrapped in div tags.
    • rounded. Output the module wrapped in nested div tags to support rounded corners.
    • outline. Output the module wrapped with a preview border.

    Applying custom module chrome

    From Joomla! Documentation

    To define custom Module chrome in your template you need to create a file called modules.php in your template html directory. For example, this might be PATH_TO_JOOMLA/templates/TEMPLATE_NAME/html/modules.php.

    In this file you should define a function called modChrome_STYLE where 'STYLE' is the name of your custom Module chrome. This function will take three arguments, $module, &$params, and &$attribs, as shown:

    <?php 
    function modChrome_STYLE( $module, &$params, &$attribs )
    {
    /* chromed Module output goes here */
    }
    ?>


    Custom chrome attributes

    It is also possible to pass further attributes into the Module chrome function using the same statement that sets the Module chrome. These additional attributes can be anything you like, and are stored in the $attribs array. Take the following example Module chrome function:

    <?php
    function modChrome_custom( $module, &$params, &$attribs ) {
    if (isset( $attribs['headerLevel'] ))
    {
    $headerLevel = $attribs['headerLevel'];
    } else {
    $headerLevel = 3;
    }

    if (isset( $attribs['background'] ))
    {
    $background = $attribs['background'];
    } else {
    $background = 'blue';
    }

    echo '<div class="' .$params->get( 'moduleclass_sfx' ) .'" >';

    if ($module->showtitle)
    {
    echo '<h' .$headerLevel .'>' .$module->title .'</h' .$headerLevel .'>';
    }

    echo '<div class="' .$background .'">';
    echo $module->content;
    echo '</div>';

    echo '</div>';
    }
    ?>

    Thursday, February 18, 2010

    Convert to ico format using free online sites

    Customize Your Profile Widget

    Put your updates anywhere or create a live stream for an event. Compatible with Facebook, MySpace, Blogger etc.

    http://twitter.com/goodies/widget_profile?

    Customize Your Profile Widget

    Put your updates anywhere or create a live stream for an event. Compatible with Facebook, MySpace, Blogger etc.

    http://twitter.com/goodies/widget_profile?

    Wednesday, February 10, 2010

    The History of Valentine s Day

    How did February 14 become a day for romance? Legend has it that during the third century, Valentine, who was a devout Christian, would perform marriages for young couples. Emperor Claudius II, however, banned marriage because he did not want young men getting married. He believed that single young men made better soldiers than men who were married; therefore he did not want his potential crop of soldiers to be depleted.

    Valentine defied Claudius ban on marriage and continued to perform marriages for young couples in secret. Once Claudius discovered what Valentine was doing, he ordered him put to death.

    While Valentine was in jail awaiting his death, he left a goodbye note to a young girl who he was in love with. He signed the note, "From your Valentine," words that are often used today on Valentine s Day cards. It is widely believed that the young girl Valentine was in love with was also the daughter of Claudius. Valentine was put to death on February 14, 269 AD. Later, in 498 AD, Pope Gelasius declared Valentine to be the patron saint of lovers.

    Over time, Valentine s Day became the day for couples to share messages of love with one another, as Valentine shared his message with the woman he loved. The day is celebrated with gifts, flowers, candy, and cards for our loved ones.

    Thursday, February 4, 2010

    joomla step by step

    Thursday, January 21, 2010

    Show/Hide Text in Textbox

    <input type="text" name="search" class="form1" onblur="if (this.value == '') {this.value = 'thy4u.blogspot.com';}" onfocus="if (this.value == 'thy4u.blogspot.com') {this.value = '';}" value="thy4u.blogspot.com" />


    Monday, January 11, 2010

    Popup Window

    Joomla! 1.5.15 Released - Get It While It's Hot!

    The Joomla! Project announced the release of Joomla! 1.5.15 today. This release contains a couple of security fixes, so be sure and upgrade as soon as possible.

    Get the browser width and height in internet explorer


    <script type=”text/javascript”>
    w = 0;
    h = 0;
    w = document.documentElement.clientWidth;
    h = document.documentElement.clientHeight;

    alert("w: " + w + ", h: " + h);


    </script>

    Sunday, January 10, 2010

    Removing “Welcome To The Frontpage” In Joomla

    The setting for the Page Title is located in the parameters of each Menu Item under "Parameters (System)".

    For Example to change the Page Title for the Home page of the Sample web site, you would navigate to Menus / Main Menu, click on "Home" to open the Menu Item:[Edit] screen. Then click on "Parameters (System)" to show the System Parameters, and either change the "Page Title" parameter or set "Show Page Title" to "No".

    Wednesday, January 6, 2010

    Creating Flash Projects

    Flash makes it easy for you to create a project. When you open Flash, one of your first options is to create a Flash project. Under the central Create New selection, you’ll want to choose the final option, Flash Project.



    Select Flash Project to create a new project. The New Project window opens and asks you for a name and location for you new project file (the extension to all Flash projects is FLP).



    After you’ve created your project file, a new window—called the Project window—opens to list all of the files in your project.



    What you now have is an empty project folder. At this point, all you have to do is add your folders and files.

    Working With Text: Embedding Fonts

    By default, Static text embeds the font outlines of this text so that it looks the same in your Web browser. Dynamic and Input text do not. If the user does not have the font on his computer, the text will look like error.

    Font embedding is managed in the Properties Inspector for any Dynamic or Input text. In the following image, I’ve selected a Dynamic text block from the Stage and highlighted the Properties for it. You’ll see a button on the right side labeled "Embed..."



    Selecting the Embed... button opens the Character Embedding window:

    Embedding fonts in AS3

    I love this! ... library, be-gone!

    package {

    import flash.util.describeType;
    import flash.display.MovieClip;
    import flash.display.TextField;
    import flash.text.TextFormat;
    import flash.text.AntiAliasType;

    public class Test extends MovieClip {

    // be sure this is pointing to a ttf font in your hardrive
    [Embed(source="C:\WINDOWS\Fonts\somefont.ttf", fontFamily="foo")]
    public var bar:String;

    public function Test() {

    var format:TextFormat = new TextFormat();
    format.font = "foo";
    format.color = 0xFFFFFF;
    format.size = 130;

    var label:TextField = new TextField();
    label.embedFonts = true;
    label.autoSize = TextFieldAutoSize.LEFT;
    label.antiAliasType = AntiAliasType.ADVANCED;
    label.defaultTextFormat = format;
    label.text = "Hello World!";
    addChild(label);
    }
    }
    }

    Tuesday, January 5, 2010

    Loading XML data using ActionScript 3.0

    Using XML is one of the best ways for structuring external content in a logical format that is easy to understand, process, and update. This tutorial will teach you the basics on how to load and process XML in Flash using ActionScript 3.0. You are assumed to have basic knowledge of ActionScript in order to follow this tutorial.

    Here is sample code loading XML in ActionScript 3



    Here is sample XML code



    Download here

    Retrieve Flash Variables in Actionscript 3

    In Actionscript 3 variables that are passed in through query string have been moved to the parameters property of LoaderInfo instance. Here’s a real simple way to retrieve flash variable in Actionscript 3

    1. To access the query string fileName in Actionscript 3 , all you have to do in your actionscript 3 source code is



    2. Here Html Code access Flash variables



    Download here

    Monday, January 4, 2010

    Open new window in WSS

    today i testing Open New Window in Quick launch WSS Navigation.
    javascript:window.open('http://
    www.google.com','_blank');history.go(0);

    Custom Welcome User message in SharePoint

    Default Setting SharePoint display Logged-in user name as Welcome UserName.

    I have create Custom UserControl (name CustomWelcomeUser.ascx)



    1. Go go C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\CONTROLTEMPLATES then create new folder name "CustomWelcome"

    2. Go go CustomWelcome then create New Custom UserControl name "CustomWelcomeUser.ascx"