Posts

Showing posts from May, 2009

IE / Firefox Alignment Issues Solved

When testing the layout of a website template that I was creating in Internet Explorer (IE) and Firefox, I had a lot of trouble getting both browsers to display the content as required. The main content is a fixed width, which is in a panel (div) that should be centered. Setting the css property text-align to "center" works for IE, but not Firefox. After doing some research, I found that FireFox has a specific CSS attribute to center align content: "-moz-center ". This fixed the problem for Firefox, but the everything was left aligned in IE. After a bit of playing around with combinations of styles and attributes I managed to have both Internet Explorer and Firefox render the page properly using the same style sheet and set of styles. My solution: Set the alignment for Firefox in the attached stylesheet for the required div elements: text-align: -moz-center Set the alignment for Internet Explorer using the align attribute of the div element: <div align="cen...

Search Engine Optimization (SEO) for Blogger

Looking to increase visits to your blog? While doing a little research around SEO for my own blogs, I came accross the following article by Mike which offers a method of adding keyword and description metatags . Blogger SEO Tip: Use Post Labels as Meta Keywords The code incorporates conditions to show the labels / tags for a post as keywords if a post page is being viewed. If the blog homepage or a search page is being viewed, the blogs keywords abd description are used.

XML-RPC Blog Ping

I am developing a Php script which uses the Weblog_Pinger class written in php by Rogers Cadenhead. The script currently logs all pings to a MySQL database table, but is controlled using a single php script which calls the ping_ping_o_matic function for each site. I noticed that once more than about 20 sites were being pinged, the script sometimes timed out. Instead of adjusting settings in php.ini or the web server, I decided to implement the Weblog_Pinger class with a controller which uses a MySQL database to store addresses to servers which support XML-RPC pings. The database will also store details of the blogs / rss feeds being submitted. When commencing the bulk ping, a dialog will allow a selection from the list of blogs / rss feeds, and the "changes url" for each selection to be specified. The php interface will also allow XML-RPC servers and additional blogs or rss feeds to the database.

SEO - Crawler interpreting external links

The following is in relation to my previous post Php: Log Clicks on Links to External Sites . The post demonstrates how to log a clock on a link pointing to an external address. This may cause some search engines to get confused when crawling the page, as the link will be pointing the the load.php script on your site, when it actually reads and takes the user to an external site. A solution for this would be to use the actual address of the external site as the value for the href attribute, and call a javascript function which changes the href value to toint to the redirect script which logs click / hit statistics. Links would then appear to search engine crawlers to point to the correct address, and not a page on your site. If javascript is not enabled, the user will still reach the required destination, but statistics for the click will not be logged.

Php: Log Clicks on Links to External Sites

The following demonstrates a method of logging clicks on hyperlinks to external sites using Php and MySQL. This can be used to generate statistics for content on your site such as "Popular links/sites", or keeping track of a frequent user or member's actions (ie. Recently Browsed). The Php uses the PEAR MDB2 Package to create a connection to the database. For information on installing or using PEAR and the MDB2 package, see http://pear.php.net/ . Once the processing has completed for the item/link, the user is redirected to the address of the selected url.

XML Parser

The following php code processes an xml file and displays contents in the browser. Each element is displayed, followed by the name and value of any attributes. The text value will be disaplyed on if the element is not empty. It uses various methods from the XMLReader class (php), to move through each element and attribute of the xml document displaying each element and attribute name, and any values.

Free online webmaster, web development and web design tools and resources

The following is a set of free tools and resources which can be used to help create valid and attractive websites in a short amount of time.