Archive for the ‘quick fix’ Category

quick fix | No Comments | January 18th, 2013

For ebay listing .. we have to use Inline CSS. every style need to write in component itslef …. no class is used there.

I did some poking around to find a good solution for making CSS inline and I found a VERY useful tool called “Inline Styler” hosted at torchboxapps.com.

http://inlinestyler.torchboxapps.com/styler/ It is an online script/app which will convert a webpage and its CSS or uploaded HTML to HTML with all of the CSS as inline styles. It was originally created to help folks create HTML emails, but I found it useful for converting a template for eBay.

quick fix | No Comments | July 16th, 2012

Hoe to get folder name from current page

Use this function

function getCurrentDirectory() {
$path = dirname($_SERVER[‘PHP_SELF’]);
$position = strpos($path,’/’) + 1;
return substr($path,$position);
}

 

echo getCurrentDirectory();

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 it like ::

echo first_sentence($content);

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 + F
3. Select “Current document” in “Find in” (You can also select the folder if you have multiple files)
4. Search in “Source code”
5. Tick “Use regular expression”
6. Type “[\r\n]{2,}” (without quotes) in “Find”
7. Type “\n” (without quotes) in “Replace”
8. Press “Replace All”

You are done! All the spaces gone.

quick fix | No Comments | 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

quick fix | No 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;

?>

Mode rewrite, quick fix | No Comments | March 2nd, 2009

For that add this code in .htaccess file.

AddType application/x-httpd-php .php .htm .html