Posts Tagged ‘bottom’

Displaying the Last Modified Date within a Web Page

Monday, July 14th, 2008

If you would like to display the last modified date on your web page, place the following code within the HTML of your web page where you would like the date to appear.

Example:

This page was last modified on: 06/18/2008 04:45:20

Last Modified HTML Code:

<script language=”Javascript”>
document.write(”This page was last modified on: ” + document.lastModified +”");
</SCRIPT>

Change the text indicated in red to whatever you’d like.

If you would like to use this JavaScript code to display your web page’s last modified date, it is probably best to place the code toward the bottom of your web page.

Wrapping Text Around an Image within an HTML Web Page

Monday, July 14th, 2008

If you’ve ever tried to display an image with your text wrapping around it, you have probably discovered it won’t work with just a plain image tag.

To do so, you must include the ALIGN attribute within your image tag.

Image Displayed on Left:

<IMG BORDER=”0″ ALIGN=”Left” SRC=”yourimage.jpg”>Your Text

By placing the above code within your HTML, your image will be displayed on the left hand side with your text displayed on the right.

As you continue to type your text, it will automatically format itself to wrap around the right side and the bottom of your image. This example has been set up with a table to keep the text neatly aligned within a limited amount of space. The table’s width is set up to span 50% of the page width.

Image Displayed on Right:

<IMG BORDER=”0″ ALIGN=”Right” SRC=”yourimage.jpg”>Your Text

By placing the above code within your HTML, your image will be displayed on the right hand side with your text displayed on the left.

As you continue to type your text, it will automatically format itself to wrap around the left side and the bottom of your image. This example has been set up with a table to keep the text neatly aligned within a limited amount of space. The table’s width is set up to span 50% of the page width.

Displaying Page Loading Time (Steps and Sample Code)

Saturday, June 28th, 2008

Here is how to display your page’s loading time:

1. Use the function microtime() to get the time in micro-seconds
2. Use the explode() function to turn the micro-time into an array.
3. Combine the two parts to the array (the micro-seconds to the seconds).
4. Repeat steps 1,2 and 3 for the bottom of the page
5. Take the time taken at the end of the page from the time taken at the top of the page to determine the total loading time.
6. After rounding the microtime, return it to the browser.

At the top of your page, place:

$m_time = explode(” “,microtime());
$m_time = $m_time[0] + $m_time[1];
$starttime = $m_time;
?>

At the bottom of your page, place:

$round = 3;// The number of decimal places to round the micro time to.
$m_time = explode(” “,microtime());
$m_time = $m_time[0] + $m_time[1];
$endtime = $m_time;
$totaltime = ($endtime - $starttime);
echo “Page loading took:”. round($totaltime,$round) .” seconds”;
?>

Archive Effectively

Thursday, June 19th, 2008

The best archives are carefully organized into subjects and date ranges. For search traffic (particularly long tail terms), it can be best to offer the full content of every post in a category on the archive pages, but from a usability standpoint, just linking to each post is far better (possibly with a very short snippet). Balance these two issues and make the decision based on your goals. A last note on archiving - pagination in blogging can be harmful to search traffic, rather than beneficial (as you provide constantly changing, duplicate content pages). Pagination is great for users who scroll to the bottom and want to see more, though, so consider putting a “noindex” in the meta tag or in the robots.txt file to keep spiders where they belong - in the well-organized archive system.
-