[campsite-support] How to create an RSS feed for your site
  • I've written an article on how to create an RSS feed in Campsite:
    http://code.campware.org/manuals/campsite/2.5/index.php?id2

    (Campware's new RSS feed can be found here: http://www.campware.org/en/camp/rss)

    The text of this article follows:
    ---------------------------------------------------

    Creating an RSS feed for your site

    Requirements: You must have PHP wrapper installed.

    Step 1) Create your RSS feed.
    Create a template named "rss.tpl" and copy and paste the template
    written below. You will have to adjust the template tags to fit your
    site. For example, you should change the channel information such as
    the title and link, and the tags inside the "" element
    (" ").

    Notice that there is no "" at the top of the
    template - this is on purpose. If you put it in there the PHP wrapper
    will think this is PHP code and try to execute it. Since it isnt real
    PHP code, the PHP wrapper will crash and show you an error.

    Also note that the publish date can only be specified to the day, not
    the hour and minute. This will be fixed in Campsite 2.6.

    The PHP code at the beginning and end of the sample below is so that
    the HTTP header is set to "text/xml" instead of "text/html".

    Step 2) Create the link to your RSS feed.
    You can do this by using the "URI" keyword:





    RSS Feed


    -----------------------------------------------------------------------
    rss.tpl
    -----------------------------------------------------------------------
    ob_start();
    ?>
    xmlns="http://purl.org/rss/1.0/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">


    Campware News
    http://www.campware.org
    Free Software for a Free Press
    en-us






















    <!** print article name>
    http://www.campware.org
    article body>]]>
    "%Y-%m-%d">T00:00:00+00:00





    header("Content-type: text/xml");
    $content = ob_get_clean();
    echo '';
    echo $content;
    ?>
    -----------------------------------------------------------------------

    Tips & tricks

    If you use XSL, the CDATA sections do not work with Firefox.
    If you dont want to use CDATA sections in your RSS, you can strip the
    HTML from your article this way:

    $allowedTags="<link><description><dc:language><dc:date><item><items>";<br /> $content = strip_tags($content, $allowedTags);<br /> <br /> <br /> Another way to create a link to your RSS feed<br /> Assign the template to a section: create a new section (doesnt matter<br /> where), and call it "rss". Configure the section so that its templates<br /> are "rss.tpl", and give the section the URL name of "rss". The URL for<br /> this section will be the URL to your RSS feed. </div> </div> </li> <div style="float: right; margin-top: 12px; z-index: 999; position: relative"><fb:like href="http://forum.sourcefabric.org//discussion/789/campsite-support-how-to-create-an-rss-feed-for-your-site" layout="button_count" width="60" show_faces="false" font="lucida grande"></fb:like><g:plusone size="medium"></g:plusone></div><div class="Share"><span class="st_twitter_hcount" displayText="Tweet"></span><span class="st_facebook_hcount" displayText="Share"></span><span class="st_email_hcount" displayText="Email"></span><span class="st_sharethis_hcount" displayText="Share"></span></div></ul> <div class="Foot"> <a href="/entry/signin?Target=discussion%2F789%2Fcampsite-support-how-to-create-an-rss-feed-for-your-site%3Fpost%23Form_Body" class="TabLink">Add a Comment</a> </div> </div> <div id="Panel"> <div class="Search"><form method="get" action="https://www.google.com/search"> <div> <input type="hidden" name="sitesearch" value="forum.sourcefabric.org" /><input type="text" id="Form_q" name="q" value="" class="InputBox" /><input type="submit" id="Form_Search" value="Search" class="Searchbutton" /> </div> </form> </div> <a href="/post/discussion/9" class="BigButton NewDiscussion">Start a New Discussion</a><div class="Box GuestBox"> <h4>Howdy, Stranger!</h4> <p>It looks like you're new here. If you want to get involved, click one of these buttons!</p> <div class="P"><a href="/entry/signin?Target=discussion%2F789%2Fcampsite-support-how-to-create-an-rss-feed-for-your-site" class="Button">Sign In</a> <a href="/entry/register?Target=discussion%2F789%2Fcampsite-support-how-to-create-an-rss-feed-for-your-site" class="Button ApplyButton">Apply for Membership</a></div> </div><div class="Box BoxCategories"> <h4><a href="/categories/all">Categories</a></h4> <ul class="PanelInfo PanelCategories"> <li><span><strong><a href="/discussions">All Discussions</a></strong><span class="Count">8,397</span></span></li> <li class="Heading CategoryID_1">Sourcefabric</li> <li class="Depth2 CategoryID_40"><strong><a href="/categories/announcements"><span style="font-size:18px;">↳</span> Announcements</a></strong><span class="Count">25</span></li> <li class="Heading CategoryID_8">Newscoop</li> <li class="Depth2 Active CategoryID_9"><strong><a href="/categories/newscoop-support"><span style="font-size:18px;">↳</span> Newscoop Support</a></strong><span class="Count">2,189</span></li> <li class="Depth2 CategoryID_10"><strong><a href="/categories/newscoop-development"><span style="font-size:18px;">↳</span> Newscoop Development</a></strong><span class="Count">722</span></li> <li class="Depth2 CategoryID_12"><strong><a href="/categories/newscoop-security"><span style="font-size:18px;">↳</span> Newscoop Security</a></strong><span class="Count">13</span></li> <li class="Depth2 CategoryID_13"><strong><a href="/categories/newscoop-documentation"><span style="font-size:18px;">↳</span> Newscoop Documentation</a></strong><span class="Count">17</span></li> <li class="Depth2 CategoryID_14"><strong><a href="/categories/newscoop-templates"><span style="font-size:18px;">↳</span> Newscoop Themes</a></strong><span class="Count">69</span></li> <li class="Heading CategoryID_15">Airtime</li> <li class="Depth2 CategoryID_16"><strong><a href="/categories/airtime-support"><span style="font-size:18px;">↳</span> Airtime Support</a></strong><span class="Count">3,139</span></li> <li class="Depth2 CategoryID_17"><strong><a href="/categories/airtime-development"><span style="font-size:18px;">↳</span> Airtime Development</a></strong><span class="Count">1,286</span></li> <li class="Depth2 CategoryID_18"><strong><a href="/categories/airtime-fr"><span style="font-size:18px;">↳</span> Airtime Français</a></strong><span class="Count">146</span></li> <li class="Depth2 CategoryID_19"><strong><a href="/categories/airtime-documentation"><span style="font-size:18px;">↳</span> Airtime Documentation</a></strong><span class="Count">14</span></li> <li class="Depth2 CategoryID_42"><strong><a href="/categories/airtime-hacks"><span style="font-size:18px;">↳</span> Airtime Hacks</a></strong><span class="Count">102</span></li> <li class="Depth2 CategoryID_20"><strong><a href="/categories/airtime-promote"><span style="font-size:18px;">↳</span> Promote your station!</a></strong><span class="Count">37</span></li> <li class="Depth2 CategoryID_21"><strong><a href="/categories/airtime-security"><span style="font-size:18px;">↳</span> Airtime Security</a></strong><span class="Count">11</span></li> <li class="Heading CategoryID_36">Booktype</li> <li class="Depth2 CategoryID_37"><strong><a href="/categories/booktype-support"><span style="font-size:18px;">↳</span> Booktype Support</a></strong><span class="Count">277</span></li> <li class="Depth2 CategoryID_38"><strong><a href="/categories/booktype-development"><span style="font-size:18px;">↳</span> Booktype Development</a></strong><span class="Count">55</span></li> <li class="Depth2 CategoryID_39"><strong><a href="/categories/booktype-documentation"><span style="font-size:18px;">↳</span> Booktype Documentation</a></strong><span class="Count">7</span></li> <li class="Heading CategoryID_31">Superdesk</li> <li class="Depth2 CategoryID_32"><strong><a href="/categories/superdesk-dev"><span style="font-size:18px;">↳</span> Superdesk Development</a></strong><span class="Count">264</span></li> <li class="Depth2 CategoryID_44"><strong><a href="/categories/web-publisher"><span style="font-size:18px;">↳</span> Web Publisher</a></strong><span class="Count">21</span></li> </ul> </div> <div class="Box"> <h4>Poll</h4> No poll attached to this discussion. </div> <div id="TopPosters" class="Box"> <h4>Top Posters</h4> <ul class="PanelInfo"> <li> <img src="/plugins/TopPosters/badges/1.png"> <strong> <a href="/profile/12/Albert%20FR">Albert FR</a> </strong> <span class="Count"> 1978 </span> </li> <li> <img src="/plugins/TopPosters/badges/2.png"> <strong> <a href="/profile/246/Martin%20Konecny">Martin Konecny</a> </strong> <span class="Count"> 1860 </span> </li> <li> <img src="/plugins/TopPosters/badges/3.png"> <strong> <a href="/profile/2/Andrey%20Podshivalov">Andrey Podshivalov</a> </strong> <span class="Count"> 1526 </span> </li> <li> <img src="/plugins/TopPosters/badges/medal-icon.png"> <strong> <a href="/profile/2509/Voisses%20Tech">Voisses Tech</a> </strong> <span class="Count"> 1423 </span> </li> <li> <img src="/plugins/TopPosters/badges/medal-icon.png"> <strong> <a href="/profile/3101/John%20Chewter">John Chewter</a> </strong> <span class="Count"> 899 </span> </li> <li> <img src="/plugins/TopPosters/badges/medal-icon.png"> <strong> <a href="/profile/56/Daniel%20James">Daniel James</a> </strong> <span class="Count"> 844 </span> </li> <li> <img src="/plugins/TopPosters/badges/medal-icon.png"> <strong> <a href="/profile/2471/Roger%20Wilco">Roger Wilco</a> </strong> <span class="Count"> 784 </span> </li> <li> <img src="/plugins/TopPosters/badges/medal-icon.png"> <strong> <a href="/profile/1740/hoerich">hoerich</a> </strong> <span class="Count"> 627 </span> </li> <li> <img src="/plugins/TopPosters/badges/medal-icon.png"> <strong> <a href="/profile/43/Paul%20Baranowski">Paul Baranowski</a> </strong> <span class="Count"> 389 </span> </li> <li> <img src="/plugins/TopPosters/badges/medal-icon.png"> <strong> <a href="/profile/1570/Cliff%20Wang">Cliff Wang</a> </strong> <span class="Count"> 339 </span> </li> </ul> </div> </div> </div> <div id="Foot"> <!-- Various definitions for Javascript //--> <div id="Definitions" style="display: none;"> <input type="hidden" id="ImageResized" value="This image has been resized to fit in the page. Click to enlarge." /> <input type="hidden" id="DiscussionID" value="789" /> <input type="hidden" id="Emoticons" value="eyI6KV0iOiIxMDAiLCI7KSkiOiI3MSIsIjopPi0iOiI2NyIsIjopJmd0Oy0iOiI2NyIsIjopKSI6IjIxIiwiOikiOiIxIiwiOi0pIjoiMSIsIjoofCkiOiI1MSIsIjooKCI6IjIwIiwiOigiOiIyIiwiOi0oIjoiMiIsIjspIjoiMyIsIjstKSI6IjMiLCI6RCI6IjQiLCI6LUQiOiI0IiwiOzspIjoiNSIsIj46RDwiOiI2IiwiJmd0OzpEJmx0OyI6IjYiLCI6LVwvIjoiNyIsIjpcLyI6IjciLCI6eCI6IjgiLCI6WCI6IjgiLCI6XFxcIj4iOiI5IiwiOlxcXCImZ3Q7IjoiOSIsIjpQIjoiMTAiLCI6cCI6IjEwIiwiOi1wIjoiMTAiLCI6LVAiOiIxMCIsIjotKiI6IjExIiwiOioiOiIxMSIsIj0oKCI6IjEyIiwiOi1PIjoiMTMiLCI6TykiOiIzNCIsIjpPIjoiMTMiLCJYKCI6IjE0IiwiOj4iOiIxNSIsIjomZ3Q7IjoiMTUiLCJCLSkiOiIxNiIsIjotUyI6IjE3IiwiIzotUyI6IjE4IiwiIzotcyI6IjE4IiwiPjopIjoiMTkiLCI+Oi0pIjoiMTkiLCImZ3Q7OikiOiIxOSIsIiZndDs6LSkiOiIxOSIsIjotKCgiOiIyMCIsIjonKCI6IjIwIiwiOictKCI6IjIwIiwiOi0pKSI6IjIxIiwiOnwiOiIyMiIsIjotfCI6IjIyIiwiXC86KSI6IjIzIiwiXC86LSkiOi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mZ3Q7IjoiNzIiLCJvPT4iOiI3MyIsIm89Jmd0OyI6IjczIiwiby0rIjoiNzQiLCIoJSkiOiI3NSIsIjotQCI6Ijc2IiwiXjopXiI6Ijc3IiwiOi1qIjoiNzgiLCIoKikiOiI3OSIsIjotYyI6IjEwMSIsIn5YKCI6IjEwMiIsIjotaCI6IjEwMyIsIjotdCI6IjEwNCIsIjgtPiI6IjEwNSIsIjgtJmd0OyI6IjEwNSIsIiUtKCI6IjEwNyIsIjpvMyI6IjEwOCIsIlhfWCI6IjEwOSIsIjohISI6IjExMCIsIlxcbVwvIjoiMTExIiwiOi1xIjoiMTEyIiwiOi1iZCI6IjExMyIsIl4jKF4iOiIxMTQiLCI6YnoiOiIxMTUiLCI6YXIhIjoicGlyYXRlIiwiWy4uXSI6InRyYW5zZm9ybWVyIn0=" /> <input type="hidden" id="apcavailable" value="" /> <input type="hidden" id="uploaderuniq" value="676cff0df014d" /> <input type="hidden" id="maxuploadsize" value="20971520" /> <input type="hidden" id="TopPostersLimit" value="10" /> <input type="hidden" id="LastCommentID" value="0" /> <input type="hidden" id="Vanilla_Comments_AutoRefresh" value="60" /> <input type="hidden" id="TransportError" value="A fatal error occurred while processing the request.<br />The server returned the following response: %s" /> <input type="hidden" id="TransientKey" value="O4LLAZHFFM2J" /> <input type="hidden" id="WebRoot" value="http://forum.sourcefabric.org/" /> <input type="hidden" id="UrlFormat" value="/{Path}" /> <input type="hidden" id="Path" value="discussion/789/campsite-support-how-to-create-an-rss-feed-for-your-site" /> <input type="hidden" id="SignedIn" value="0" /> <input type="hidden" id="ConfirmHeading" value="Confirm" /> <input type="hidden" id="ConfirmText" value="Are you sure you want to do that?" /> <input type="hidden" id="Okay" value="Okay" /> <input type="hidden" id="Cancel" value="Cancel" /> <input type="hidden" id="Search" value="Search" /> </div> </div> </div> <iframe src="https://www.sourcefabric.org/forum_foot" border="0" style="width: 100%; height: 500px; border: 0pt none; display: block;" frameborder="0" height="460" scrolling="no" width="100%"></iframe> </body> </html> <script type="text/javascript"> jQuery(document).ready(function(){ jQuery("pre").each(function(){ if(jQuery(this).attr("lang")!="") { var codeText=jQuery(this).html(); codeText = codeText.replace(/<br>/g, "\n"); jQuery(this).html(codeText); jQuery(this).attr("class","brush:"+$(this).attr("lang")); } }); SyntaxHighlighter.autoloader.apply(null, path( "applescript @shBrushAppleScript.js", "actionscript3 as3 @shBrushAS3.js", "bash shell @shBrushBash.js", "coldfusion cf @shBrushColdFusion.js", "cpp c @shBrushCpp.js", "c# c-sharp csharp @shBrushCSharp.js", "css @shBrushCss.js", "delphi pascal @shBrushDelphi.js", "diff patch pas @shBrushDiff.js", "erl erlang @shBrushErlang.js", "groovy @shBrushGroovy.js", "java @shBrushJava.js", "jfx javafx @shBrushJavaFX.js", "js jscript javascript @shBrushJScript.js", "perl pl @shBrushPerl.js", "php @shBrushPhp.js", "text plain @shBrushPlain.js", "py python @shBrushPython.js", "ruby rails ror rb @shBrushRuby.js", "sass scss @shBrushSass.js", "scala @shBrushScala.js", "sql @shBrushSql.js", "vb vbnet @shBrushVb.js", "xml xhtml xslt html @shBrushXml.js" )); SyntaxHighlighter.defaults["toolbar"]=false; //SyntaxHighlighter.defaults["gutter"]=false; SyntaxHighlighter.all(); }); function path() { var args = arguments, result = [] ; for(var i = 0; i < args.length; i++) result.push(args[i].replace("@", "/plugins/G_SyntaxHighlighter/scripts/")); return result }; </script>