Posts

How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible)

Image
In this tutorial, I demonstrate how to generate a feed using Php  that can be displayed from a website in multiple formats, including Atom 1.0 and RSS 2.0.  I will be using functionality from the Php FeedWriter class library  to generate the feed, which is available for free  at http://phpFeedWriter.webmasterhub.net/. I have broken up the process below into separate components, and provided additional information to help you learn each aspect of creating the feed using Php.  A download of the completed script written in this tutorial is also provided if required. Summary Prepare your feed script/page - Instantiate a (Php) FeedWriter Class Object Add additional (Channel) data to the feed Add Items to the Feed Get the specified feed output format (Optional) Set the “Content” element of each feed item as type “HTML” Output the Feed XML (Optional) Writing to a file / Caching Feed Content

Php FeedWriter Released - Version 3.0 Beta - Universal Feed Generator

Generate Atom 1.0, RSS 2.0 and RSS 1.0 feeds for free using Php. Php FeedWriter 3.0 beta has been released for download.  The update to the class and functionality builds upon the previous version RSS2Writer v2.1, which limited output to an RSS 2.0 compatible feed only. Php FeedWriter 3.0 now supports multiple feed formats : Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91.  Php FeedWriter povides a set of easy to use functions to handle both feed input and output.

WordPress Breadcrumb Navigation on Pages & Meta Title

Today I needed to include page breadcrumbs on a WordPress blog site.  I only wanted the breadcrumb navigation to be visible on pages, and to not display at all on the homepage (static).

Javascript Query String Manipulation Functions

Javascript Query String Manipulation Functions The following is a series of articles with Javascript functions that can be used to manipulate the query string parameters and variables in the current url.  Use the links below to go to a specific function: Javascript Add Query String Parameter Add a query string parameter to the url of the current page. Javascript Check if Query String Parameter Exists in current URL Test if the query string of the current URL contains a specific parameter. Javascript Remove a parameter from the query string if found in current url Remove a parameter from the query string of the current page. Javascript Get the value of the specified Query String Parameter Find the value of a specific query string parameter in the current URL.  Return the value of the parameter, or false if not found. Javascript Get all parameters and values as an Array Returns a multidimensional array containing parameters and values from the query string ...

Javascript Add query string parameter dynamically to some or all links on the current page

This Javascript function retrieves all <a> tags (hyperlinks) from the current page, and updates each link to include the supplied query string parameter and value. The third (optional) parameter passed to the function is an array of strings containing the domains that should be included when updating links on the page. If a link points to a domain that is not in the array passed to the function, the link will remain unchanged. If no Array of domains to include is supplied when calling the function, only the current domain is used.  For each link on the current page that the function loops through, the query string parameter is added to the link if the host matches one of the hosts in the array of domains.

Javascript Return the url of the current page with no query string parameters

This Javascript function strips/removes any existing query string parameters from the url and returns the 'cleaned' url.

Javascript Get all parameters and values as an Array

This Javascript function extracts each parameter from the query string and returns a multi dimensional array containing the parameter names and values. Array( Array(parameter_name1, parameter_value1) , Array(parameter_name2, parameter_value2) )

Javascript Get the value of the specified Query String Parameter

This Javascript function checks the address of the current page for the supplied query string parameter.  If found, the value of the parameter is used, if the parameter is not found, false is returned. See also:  checkParemeterExists() , which returns true or false if the specified parameter is found or not.

Javascript Remove a parameter from the query sring if found in current url

This Javascript function removes the supplied parameter from the query string if it is present in the current url.  This is done by converting the query string into an array of parameters and values, then rebuilding the final string to exclude the parameter supplied to the function.  The browser is then redirected to the current page with the new query string.

Javascript Check if Query String Parameter Exists in current URL

This Javascript function checks if the parameter supplied exists in the query string.  If the parameter supplied is found in the query string of the current URL, the function will return true.  If the parameter is not found, false is returned. See also:   getParameter() - This function returns the value of the parameter if found, and false if it is not found which can be used instead of the checkParameterExists() function below

Javascript Add Query String Parameter

Redirect to the current page including the specified query string parameter and value This Javascript function redirects the browser back to the current page with the query string parameter data included that is passed to the function.  If the current url already contains the supplied query string and value, no redirect will take place.  Existing parameters and values are retained in the url after the redirect. This function can be useful when a common query string parameter is required across multiple pages on a site, such as a session hash/id or similar.   The current page will reload to include the specified parameter and value if it doesn't already exist.  Use this function in combination with the  updateLinks() function to add and manage query string parameters and variables across pages on a site dynamically.

Outlook (2007) Ribbon: Issue adding new group to Message tab

When writing a COM Addin for Microsoft Outlook 2007 , I came across a scenario where I needed to add buttons to the Ribbon when composing or reading an email message.  Using the IRibbonExtensibility methods, I was able to add a new tab with groups and controls to the read and compose inspectors.  The issue was that I needed to include an additional group in the Message tab of an email when composing or viewing.  If I set the tab id to that of the read or compose message class (TabNewMailMessage or TabReadMessage), the group would not display at all. The new group would only display if added to a new tab.  When I set the tab id to that of the Message tab for the read and compose message classes, the new group would not display at all.  This was not ideal, as the solution required that the new group and buttons were displayed first before the standard groups within the Message Tab.   There were a number of reasons that the custom group woul...

Outlook VBA Macro Cause Close Loop

When developing a macro for Outlook 2007 Visual Basic Editor, part of the macro code caused outlook to close unexpectedly (“Unexpected Error has occurred”) while attempting to load. This meant that I was not able to easily access the macro to fix the issue. The article Outlook Close Loop - VB Macro Development suggested to adjust the macro security check option via the registry to allow Outlook to open again. This worked, which allow Outlook to open without the error. When prompted to enable or disable macros while loading, I opted to disabled macros. This allowed Outlook to full load, and gave me access to the VB Editor to fix the issue.

Web Development & SEO: Considerations / Gotchas when Outsourcing SEO Services

Web Development and online Marketing in the industry today often involves a large number of broad areas such as planning / BA, website or system design, system or application development, system testing., server configuration and maintenance, DNS configuration, Internet Marketing / SEO, etc. There are many cases where a developer will carried out similar tasks to the webmaster, SEO or internet marketing consultant, especially when the Web site is managed externally by a single company. Most companies and individuals who offer online services for the development of web sites may also need to configure and maintain the DNS and web server. Many developers become experienced in some of these areas, but to become a real expert in any given area requires a lifetime of knowledge and experience. This is often the deciding point between outsourcing website development and SEO services to an individual with lower prices, or a larger company higher prices, but have access to a much greater range ...

User Acceptance of Innovations and new Solutions

The following provides some things to consider when developing and implementing new solutions for large volumes of end users, with a primary focus on user acceptance.  The information is my own personal opinion which is based on my experience as a Solution Architect and Developer.  I have struggled on many occasions to have users accept and adopt a new system or process, and as a result now incorporate number of techniques and methods to assist with user acceptance when designing and developing a solution.  Some of these would be common sense, but others are often overlooked as an important part of the planning, development, testing and implementation phases of a new innovation.  The main focus is on some of the reasons for the non-acceptance of new solutions and some techniques to help improve level of user acceptance.  This applies to the implementation of any new system or process for any large group of users, and is not dependent on the platform used to deve...

Optimise Database & Application Scripts for Performance - Web Development

Improving the performance of a Web Application or website can sometimes be difficult depending on the factors that are contributing to downgraded performance. In some cases, performance issues may be related to server hardware or network issues to limitations which would usually cost money to improve. In other cases, there are many factors that can impact on the overall performance of a web application or website that can be changed easily.

Text in textarea chopped off after quote or apostrophe

I had an issue, where the text in a textarea input was being cut off after a quote or apostrophe.  The form was submitting to a ‘confirm’ mode, which displayed the details entered into the form back to the user for confirmation.  The details were being passed between each page/mode using hidden fields.  I found that if there was a quote or apostrophe in the text entered into the textarea field, it would be chopped of once the data had been submitted, or if pressing the ‘modify’ button on the confirm page.  After having a look at the page source of the confirm page, I noticed that the value from the textarea field which was being stored in a hidden variable spanned across multiple lines in the code.  As the value of the hidden text field was wrapped in quotation marks, the result was that the parser would stop think that the textarea content had finished.  As the content spanned across multiple lines, the parser would resume rendering the page content even t...

SharePoint Development at a Higher Level

SharePoint development may be required to provide an environment that is custom to a business as well as to enable additional features and integrate with existing and new technologies.  Many companies provide consulting services for SharePoint, allowing an understanding to be gained on the capabilities of the core features provided by SharePoint, and how they can be utilised or developed to build solutions for the business.  Custom SharePoint Development may include anything from the construction of an intranet environment to the development of complex workflow involving many people within the business, that may also draw from a range of existing sources for data such as project reporting or accounting systems.

Php RSS 2 Writer Update (v2.1) - CDATA Enabled

The Php RSS 2.0 Writer class has been recently updated to include the option of writing CDATA in the RSS feed item title or description components. This allows the feed to be parsed even when the content within a feed item contains special characters that would usually be parsed as an XML element, such as HTML code. When the xml parser reaches a CDATA tag, the content within will be ignored, allowing special characters to be included in the content. Please note that you are still required to encode any special character that appears in a CDATA tag, which is commonly '<', '>' and '&' characters. View more details about the update and the Php RSS 2 Writer class file. Further information is also available ablut the recent updates to the class as well as general usage information for the class. The class file and sample constructor is also available for downloaded on this page. The CDATA update was prompted by an issue someone was having when t...

C# Generate Random String of a Specific Length

The following function will generate a random string of the supplied length.  The function uses the Random object to generate random integer values that correspond to ASCII values within a specific range (a-z, 0-9).  Once a random string has been generated that is the required length, it is then returned.

Windows Phone 7 Development Resources

The following page lists some good Windows Phone 7 Development articles and resources: Local database support for Windows Phone 7, Windows Phone 7 SDK, SharePoint & Windows Phone 7, Windows Phone 7 Development Training , Developer Tools and much more. See: Windows Phone 7 Development

RSS Feed CDATA Troubleshooting

RSS2Writer v2.1 has been updated to v3.0 beta.  The new version can be downloaded at the Php FeedWriter website:  http://PhpFeedWriter.WebmasterHub.net/ Php FeedWriter (v3.0 beta) now provides the ability to output to various feed formats.  Php FeedWriter can currently generate Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91 compatible feeds .  View more information about Php FeedWriter , including online documentation .  For information about the latest update and release, see the article Php FeedWriter 3.0 (beta) Released . A tutorial demonstrating how to build a feed using Php FeedWriter is also available on this blog: How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible) RSS Feed CDATA was not working properly in the Php RSS 2.0 Writer class when trying to generate an RSS feed, as CDATA was not initially supported by the class. When the CDATA tags were included using '<![CDATA[' . $content . ']]>' as the value in the descripti...

InfoPath SharePoint Development

SharePoint News & Development Resources DevSharePoint.com provides the latest SharePoint news and resources. Stay up to date with SharePoint 2010, MOSS 2007, WSS, SharePoint Designer (2007/2010), InfoPath. InfoPath & SharePoint Development Tutorials, Resources & How To's InfoPathSharePoint.net provides the latest InfoPath development tutorials, InfoPath Form Services administration tips, tricks and how to's. InfoPath SharePoint Integration: Integrate InfoPath Forms with SharePoint lists, libraries & workflow. SharePoint & InfoPath News & Resources SharePoint Administration, Development, Design & Customization Resources from around the internet. SharePoint & InfoPath News. InfoPath SharePoint Integration. InfoPath Form Template Design. InfoPath Form layouts, design tips & techniques.

Post Update: VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String

The following post has been updated to include a number of different methods to remove characters from strings in VBScript. Remove or Replace Characters using regular Expressions Remove or Replace Characters using the Replace Function Remove or Replace Characters without using the Replace Function Details are also provided to remove from a specified set of charcters if found in the input string, or to remove all character expept a rage, such as 0-9, a-z, and A-Z. VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String - Code-Tips.com

Apache mod_rewrite (.htaccess) - Rewrite or Redirect Request URLs if page not found, or no www

Apache mod_rewrite ( .htaccess ) - Request rewrites & redirects to site root if page or directory not found There are many scenarios where mod_rewrite can be used on a web server to improve usability, optimise for search engines, perform redirects based of specific criteria and much more. The following are some examples of how to configure .htaccess files on an Apache web server to alter requests and actions taken by the web server, including configuring the server to redirect to the site root (or other specified page) if a page or directory is not found, configuring the server to convert components of a http request into query string parameters to be passed to a specific page/script for processing and display (without altering the original address entered into the browser).

Php RSS2Writer (v2.1) - Generate RSS 2.0 Feed - Usage Instructions & Download

Image
RSS2Writer v2.1 has been updated to v3.0 beta.  The new version can be downloaded at the Php FeedWriter website:  http://phpfeedwriter.webmasterhub.net/ Php FeedWriter (v3.0 beta) now provides the ability to output to various feed formats.  Php FeedWriter can currently generate Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91 compatible feeds .  View more information about Php FeedWriter , including online documentation .  For information about the latest update and release, see the article Php FeedWriter 3.0 (beta) Released . A tutorial demonstrating how to build a feed using Php FeedWriter is also available on this blog: How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible) Generate RSS 2.0 Compatible feeds in Php, using the Free Php RSS2Writer Class. The Php RSS2Writer class has been updated. Recently implemented v2.1 updates allow CDATA to be incorporated if required. Version 2.0 included improved usability when using the RSS2Wri...

Php Date Time - 7 Methods to Calculate the Difference between 2 dates

Calculate the difference between two Dates (and time) using Php. The following page provides 7 methods for calculating the difference between two dates using Php, as well as some additional related resources to help with Date/Time calculations and manipulation using Php. Depending on the type of server running Php (Windows/IIS/Apache, Unix/Apache), standard date methods provided by Php can sometimes produce inconsitent or incorrect results. The various methods provided on the page below cater for different scenarios where date/time calculations need to be made using Php to calculate the difference between dates. See Php Date Time - 7 Methods to Calculate the Difference between 2 dates for details.

Improve Performance for Websites with a Database Back-end & Dynamic Content

Improve Performance for Websites with a Database Back-end & Dynamic Content How to improve the performance of web pages, and the overall performance of a website by minimise front-end processing and additional server/client DNS requests required to fully load each page. Identify the areas/scripts for a website which are frequently used Identify scripts which take the longest time to process or load Identify DNS Requests that can be removed from front-end pages Create scripts to perform background processing, then store website content (HTML) in a database table. Replace code in scripts to retrieve the pre-formatted content from a database The techniques described below focus on reducing the processing requirements and DNS requests required to generate and load a page for both the server-side and client-side aspects of a web application or website. The steps explain how to identify, and reduce the amount of processing required by the front-end server of a website by perfo...

SEO Tips: Keyword Research, Target Key Phrases, Site Navigation

Image
SEO Tips for Website & Database Application Development I wanted to share a few of my experiences with developing websites and database applications in relation to optimising the structure, navigation, layout and content of websites to help increase rankings in popular search engines, including Google, Bing and Yahoo. Some key areas covered include designing and developing a website to have a logical page hierarchy and navigation paths. I have developed a range of websites both static and interactive with a database or sometimes file system back-end to enable content to be published and maintained dynamically. The Search Engine Optimisation techniques described below are based on my own personal experiences with various methods of building a dynamic website. They are basic in nature, and provide an idea of just some of the many techniques to optimise a website for Search Engines. Any concepts or conclusions reached are a result of my own research, experimentation and opinio...

Web Programming, SEO & SharePoint Resources

Web-Resource.org - SharePoint, Web Programming & SEO Resources Web-resource.org provide a range of resources from around the web for Web Development & Programming, SharePoint & InfoPath Development and Search Engine Optimisation. Resources have been hand selected by the team at Web-Resource.org, and suggested by users. Some of the many resources include:

InfoPath Code - Loop through items in a secondary data source from a SharePoint List

The article linked below demonstrates using JScript or VBScript, how to loop through items in a secondary data source until one is found which either contains a specific value, or has a specific value for a known attribute. InfoPath - Update Repeating Elements in a Secondary Data Source

Fix Corrupt Table in PhpBB3 MySQL Database - Grant Administrator/Founder using PhpMyAdmin

How to fix corrupt table in PhpBB3 Database using PhpMyAdmin (phpbb_users table corrupt in PhpBB3 forum). How to add a forum administrator/founder using PhpMyAdmin. PhpBB3 is used for a forum application. The forums were all working fine until I started receiving the following SQL error when trying to access the forum website: Can't open file: 'phpbb_users.MYI'. (errno: 145) [1016] The users table in the database had become corrupt or deadlocked.

Affiliates

 Affiliates of Code-Tips.com:

InfoPath - Programming Tips - InfoPath Form Development

When should code be used in an InfoPath form and when should it be avoided? There is no simple answer to this question, as it comes down to a matter of personal preference. This article is aimed at reducing the development time for InfoPath forms of various scales. The following are some tips to help you make the right decision.

Php XML-RPC Bulk Ping Sites and Directories - FREE SEO

WebmasterHub.net - FREE SEO - Submit to Directories Only recently launched, WebmasterHub.net provide FREE SEO including a bulk ping service to submit sites, blogs and/or RSS feeds. The bulk ping service uses XML-RPC and the weblogUpdates.ping, or weblogUpdates.extendedPing method if available. The service currently pings around 100 popular directories, but is still evolving. Free Bulk Ping Tool - Bulk Ping Sites & RSS Feeds

SEO Tips for Beginners

A few SEO (Search Engine Optimisation) tips for webmasters and bloggers. SEO (Search Engine Optimisation) Tips and Tools

WebmasterHub.net - Webmasters Developers and Designers

Image
WebmasterHub.net is live!! WebmasterHub.net offers a directory of resources, tools and tutorials for webmasters, web developers and designers. Register for free to receive free Search Engine Optimisation (SEO) including access to submit a site or resource to the resource directory and the Webmasterhub.net Bulk Pinger to bulk submit your site or blog to many popular sites and directories.

Php: Manage session times using code - Expiration / Timeout script

The following article demonstrates how to take control of php session times by including a php script into pages on your site. This can be useful if you don't have access to the php installation and the php.ini configuration file, as it gives you the flexibility to choose the length of php sessions on your site without requiring access to the server or config.

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.

VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String

VBScript String Clean Functions -3 Methods to Remove or Replace Characters in a String Original Post: 21st April 2009 Updated: 16th March 2010 The following VBScript / VBA function removes special (illegal in file names) characters from a string and returns a clean string. Illegal/special characters are replaced by a space by default, but can be set to replace specific characters with another string/character. The function can be used to remove characters not supported in filenames and directory names of the file system, SharePoint lists, etc.

Free Php RSS 2.0 feed generator class (RSS2Writer)

RSS2Writer v2.1 has been updated to v3.0 beta.  The new version can be downloaded at the Php FeedWriter website:  http://phpfeedwriter.webmasterhub.net/ Php FeedWriter (v3.0 beta) now provides the ability to output to various feed formats.  Php FeedWriter can currently generate Atom 1.0, RSS 2.0, RSS 1.0, RSS 0.92 and RSS 0.91 compatible feeds .  View more information about Php FeedWriter , including online documentation .  For information about the latest update and release, see the article Php FeedWriter 3.0 (beta) Released . A tutorial demonstrating how to build a feed using Php FeedWriter is also available on this blog: How to Generate Feed Using Php (Atom 1.0 and RSS 2.0 Compatible) [Edit: 9th January 2010] This Class has now been updated to Version 2. The information provided in this post is now out of date . Please see the Php RSS2Writer Class page for information about the updated version (Version 2.0). Updated Version (2.0): Php RSS 2...

Microsoft Outlook: Calling VBA Class Module function using VBScript

Although it is not recommended by Microsoft (see below), a procedure can be created in VBA (Visual Basic for Applications) and called using VBScript (Visual Basic Scripting Edition). By default, VBA is not initialised disabled when Outlook is started for performance reasons. If Outlook is started and an item opened (containing VBScript which calls a VBA procedure in the ThisOutlookSession Class Module), an error will occur as the required VBA procedure/function will not be available. For procedures to be called from the ThisOutlookSession module, security settings need to be adjusted to allow the macros to run. To call a VBA procedure in the ThisOutlookSession module from VBScript, create an Outlook. Application object, which will then allow the procedure to be called.

Privacy Policy

Third-party advertising companies are used to serve ads when you visit this blog. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here .

New Web Development Blog

This is my new web development blog location. Posts will be related to web development, php application development, general html javascript and css. Please have a look at my SharePoint Administration and Development blog.