Showing posts with label Php. Show all posts
Showing posts with label Php. Show all posts

Tuesday, August 31, 2010

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 trying to generate an RSS Feed using the class. View the RSS Feed CDATA Troubleshooting post.

[Update: The Php RSS 2.0 Writer class that this post refers to has been upgraded, and has also moved to a dedicated site.  The updated package is now Php FeedWriter, which supports output of multiple RSS formats and also Atom 1.0.  A tutorial is available on this blog to help with: Creating a custom feed using Php FeedWriter.  A link to download the package for free is available from the post also. ]

Wednesday, August 25, 2010

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 description element of the field, it didn't work.

Saturday, January 9, 2010

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

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 RSS2Writer class to generate an RSS Feed from website or database content, as well as additional functionality required to generate valid RSS 2.0 Feeds. Usage instructions for the class are below.

Download Php RSS2Writer - Version 2.1
The download page also provides some additional information about the class and sample controller.


Wednesday, January 6, 2010

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.

Tuesday, June 2, 2009

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.

Saturday, May 23, 2009

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.

Friday, May 22, 2009

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.

Thursday, May 21, 2009

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.

Saturday, May 9, 2009

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.

Monday, April 13, 2009

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 Writer - Download and Usage Instructions

Understood
This website is using cookies. More details