Warning: include_once(/www/templates/gt/parts/blogs/carptips/first.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2006_02_01_archive.php on line 19
Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/first.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2006_02_01_archive.php on line 19
Friday, February 17, 2006
CaRP gets podcast support, themes
I released a new version of CaRP yesterday with a few added features. First, the mundane: CaRP error messages are now linked by default to a page in the documentation that explains how to fix them. You can turn the links off or turn the error messages off altogether using the carperrors setting. Now on to the fun stuff.
First, I've added podcast
support. At first, I planned to just write some sample code showing how to do it with the old version, but I quickly discovered that it was impossible! Why? Because enclosures (which carry the link to a podcast) were hard coded to only be used to display images. So I took out the hard coding, and added explicit podcast support.
Second is themes. A theme is a file with a bunch of configuration code that you can install in a new "themes" directory and load for quick configuration. At present, I've got just one theme which sets up CaRP to display the feed as an unordered list with the description truncated to 250 characters. Come up with a nice configuration, submit your own theme
, and become famous and beloved among CaRP users!
Thursday, February 09, 2006
How to display Japanese RSS feeds using CaRP
I just released an update to CaRP that makes the truncation code that is used to limit the length of titles and description multi-byte aware. In the past, CaRP counted each byte as a character even for characters composed of multiple bytes, and ran the risk of chopping a chacter in half if a multibyte character spanned the truncation boundary. The new version won't do that. The bad news is that that's not the only problem CaRP had with multibyte feeds. The good news is that I've got a solution for the other problem.
The other problem was that the only multibyte encoding that CaRP can handle is UTF-8 (since that's the only one that PHP's XML parser can handle). So to display, for example, Japanese feeds encoded in Shift JIS or EUC, you need to first transcode them to UTF-8. And if your webpage isn't encoded in UTF-8, you'll also need to transcode the output to the character set that you're using. If you've purchased CaRP Koi or CaRP Evolution, you'll find a transcoder script that will handle the first half of that, but the second half can be handled in your webpage more efficiently.
Here's some example code--first, for the case where your webpage is in UTF-8:
Notice how CaRP gets the data from transcode.php (in UTF-8, which is transcode.php's default output encoding) by passing the URL of the feed to transcode.php.
Now, how about if your webpage is in Shift JIS:
In this case, you use the outputformat setting to tell CaRP not to output anything, but instead store it in the variable $carpoutput. Then, you use iconv to convert $carpoutput from UTF-8 to Shift JIS, and echo to output the results.
Note that transcode.php and the code shown above require iconv support, so if your server doesn't have it, you'll have to find your own way to handle the transcoding.
So there you have it--CaRP is now suitable for working with feeds in any language!
Friday, February 03, 2006
Incentives for CaRP users to help each other?
I've just posted in the CaRP user forum regarding what incentives I can provide for CaRP users to help each other
with tech support questions and such. It's not that I begrudge doing tech support--just that it's often difficult to impossible to manage all the different tasks that I have to juggle, and if possible, I'd like to free up more time for adding features and working on the next generation versions of CaRP and Grouper and some add-on products that many of you have expressed interest in.
Please share your thoughts on the matter in the forum.
Warning: include_once(/www/templates/gt/parts/blogs/carptips/second.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2006_02_01_archive.php on line 85
Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/second.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2006_02_01_archive.php on line 85
Warning: include_once(/www/templates/gt/parts/blogs/carptips/third.php) [function.include-once]: failed to open stream: No such file or directory in /www/gt/docs/carp/tips/2006_02_01_archive.php on line 92
Warning: include_once() [function.include]: Failed opening '/www/templates/gt/parts/blogs/carptips/third.php' for inclusion (include_path='.:/usr/local/lib/php') in /www/gt/docs/carp/tips/2006_02_01_archive.php on line 92