none

quick fix | No Comments | February 8th, 2010

use this function ::
function first_sentence($content) {

$pos = strpos($content, ‘.’);

if($pos === false) {
return $content;
}
else {
return substr($content, 0, $pos+1);
}

}
and then call [...]

....Read More
none
none

quick fix | No Comments | February 8th, 2010

Sometimes code in dreamweaver got space in between. This will make your code very lengthy and hard to read. To remove the space you can use this method in Dreamweaver
1. Open the file (source code)2. Click CTRL + F3. Select “Current document” in “Find in” (You can also select the folder if you have multiple [...]

....Read More
none
none

wordpress | No Comments | February 1st, 2010

just add this
<?php wp_get_archives(’title_li=&type=postbypost&limit=10′); ?>
it will add title with link inside <li></li>

....Read More
none
none

wordpress | 1 Comment | January 26th, 2010

Add this function to function.php file
function getImage($num) {
global $more;
$more = 1;
$link = get_permalink();
$content = get_the_content();
$count = substr_count($content, ‘
$start = 0;
for($i=1;$i<=$count;$i++) {
$imgBeg = strpos($content, ”);
$postOutput = substr($post, 0, $imgEnd+1);
$postOutput = preg_replace(’/width=”([0-9]*)” height=”([0-9]*)”/’, ‘/width=”117″ height=”68″/’,$postOutput);
$postOutput = preg_replace(’/alignright/’, ‘alignleft’,$postOutput);
$image[$i] = $postOutput;
$start=$imgEnd+1;
}
if(stristr($image[$num],’‘.$image[$num].”“; }
$more = 0;
}
and call it as where you want to show image <?php getImage(’1′); ?>  .. inside [...]

....Read More
none
none

quick fix | 1 Comment | January 16th, 2010

add this code in your .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} .*jpe?g$|.*gif$|.*png$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !yoursiteurl\.com [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !live\. [NC]
RewriteCond %{HTTP_REFERER} !yahoo\. [NC]
RewriteCond %{HTTP_REFERER} !msn\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule .* – [F]
and replace this :: yoursiteurl with your site URL

....Read More
none
none

Uncategorized | No Comments | January 7th, 2010

CGI server cant parse php in html pages with .htaccess
In that case we can use SSI (Server Side Includes).
you need to use SSI in your .html and htm files. There is an easy solution for this.
Just add the following line in your .htaccess file:
AddHandler server-parsed .html .htm
This line will tell the server to parse your [...]

....Read More
none
none

quick fix | 4 Comments | April 2nd, 2009

<?php
// Our original decimal number
$number = 21357.44;
// Let’s use PHP’s built-in function to format the number into US currency
$formatted = number_format($number, 2);
// The following statement will print 21,357.44
echo “\$” . $formatted;
?>

....Read More
none