Tuesday, October 20, 2009

Install New Blog Template


How to install a Template?


1. Download a template and unzipp.
2. Go to the Layout section in your blog (Dashboard → Layout → Edit HTML ).
3. Supports your previous template (Download full Template).
4. Find and upload your template.
5. Enjoy your new blog design.

Why I can not install templates blogger? Blogger throws an error.

There are several possible factors that cause an error Bx-xxxx:

  • The code is directly copied, and Blogger did not interpret it.
  • Temporarily not accepting Blogger templates with certain codes or gadgets.

Possible solutions:

  • Remove widgets or gadgets that come with the template downloaded.
  • Clear your browser’s cookies.
  • Trying to upload the template with a different browser (Opera, Firefox, Chrome, etc).
  • No copy and paste the code directly, upload the xml file.
  • Wait 24 hours and try again.

How do I customize my template?

For color and the font size, some Blogger templates offer an option to change it from the Dashboard (Dashboard → Layout → Fonts and Colors).

Major changes in the templates needed to know at least a little CSS and HTML. A quick way to modify a template is change the images in the CSS code. That is the process to change the header of a design, for example.

Additionally, some templates have their own settings instructions and customization, refer to the same download page of your template.


How can I edit the menu of my template?

1. Most templates have a menu that can only be changed from the HTML (Dashboard → Layout → Edit HTML). In many cases the code to look for is:

 

There you can change the expr:href=’…’ with your own links: href=’mylink’. Also see the instructions in your template for more information.

2. Some templates include a gadget to edit the menu directly from the Dashboard (Dashboard → Layout → Page Elements).

Thursday, October 1, 2009

PHP: How to Get the Current Page URL

If you want to get the current page URL that is shown in the browser URL window, Here is how you can do that:

Add the following code to a page:

function curPageURL()
{
$pageURL = 'http';

if ($_SERVER["HTTPS"] == "on")
{
$pageURL .= "s";
}
$pageURL .= "://";

if ($_SERVER["SERVER_PORT"] != "80")
{ $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
}
else
{
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;}
?>

You can now get the current page URL using the line:


echo curPageURL();


Sometimes it is needed to get the page name only. The following example shows how to do it:
{
return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
}
echo "The current page name is ".curPageName();?>

Reference site
..