<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.vanhecke.info/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.vanhecke.info/~d/styles/itemcontent.css" type="text/css" media="screen"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">

<channel>
	<title>PHP Notebook</title>
	
	<link>http://php.vanhecke.info</link>
	<description>Occasional notes on some php-related projects and experimenting</description>
	<pubDate>Wed, 27 Feb 2008 15:57:33 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.vanhecke.info/PhpNotes" type="application/rss+xml" /><item>
		<title>Republish a feed (or other data) protected by HTTP basic access authentication</title>
		<link>http://php.vanhecke.info/2008/01/20/republish-a-feed-or-other-data-protected-by-http-basic-authentication/</link>
		<comments>http://php.vanhecke.info/2008/01/20/republish-a-feed-or-other-data-protected-by-http-basic-authentication/#comments</comments>
		<pubDate>Sun, 20 Jan 2008 14:41:10 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
		
		<category><![CDATA[Scripts]]></category>

		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://php.vanhecke.info/2008/01/20/republish-a-feed-or-other-data-protected-by-http-basic-authentication/</guid>
		<description><![CDATA[Some services let you access or download data on a url that is protected by username and password-popup, or &#8220;basic access authentication&#8220;, for example your twitter replies at http://twitter.com/statuses/replies.rss &#8230;:

&#8230; or your bloglines subscriptions in opml format at http://rpc.bloglines.com/listsubs :



PHP script to access authenticated URL
Use Cases
Keeping Private Feeds private
Support for access:restriction element


PHP script to access [...]]]></description>
			<content:encoded><![CDATA[<p>Some services let you access or download data on a url that is protected by username and password-popup, or &#8220;<a href="http://en.wikipedia.org/wiki/Basic_access_authentication">basic access authentication</a>&#8220;, for example your twitter replies at <a href="http://twitter.com/statuses/replies.rss" title="http://twitter.com/statuses/replies.rss">http://twitter.com/statuses/replies.rss</a> &#8230;:</p>
<p><img src="http://php.vanhecke.info/wp-content/uploads/2008/01/basic-authentication-example-twitter-replies.gif" style="border-width: 0px" alt="basic-authentication-example-twitter-replies" border="0" height="217" width="408" /></p>
<p>&#8230; or your bloglines subscriptions in opml format at <a href="http://rpc.bloglines.com/listsubs" title="http://rpc.bloglines.com/listsubs">http://rpc.bloglines.com/listsubs</a> :</p>
<p><img src="http://php.vanhecke.info/wp-content/uploads/2008/01/basic-authentication-example-bloglines-subscriptions.gif" style="border-width: 0px" alt="basic-authentication-example-bloglines-subscriptions" border="0" height="217" width="446" /></p>
<div class="toc">
<ol>
<li><a href="http://php.vanhecke.info/2008/01/20/republish-a-feed-or-other-data-protected-by-http-basic-authentication/#toc-php-script-to-access-authenticated-url">PHP script to access authenticated URL</a></li>
<li><a href="http://php.vanhecke.info/2008/01/20/republish-a-feed-or-other-data-protected-by-http-basic-authentication/#toc-use-cases">Use Cases</a></li>
<li><a href="http://php.vanhecke.info/2008/01/20/republish-a-feed-or-other-data-protected-by-http-basic-authentication/#toc-keeping-private-feeds-private">Keeping Private Feeds private</a></li>
<li><a href="http://php.vanhecke.info/2008/01/20/republish-a-feed-or-other-data-protected-by-http-basic-authentication/#toc-support-for-accessrestriction-element">Support for access:restriction element</a></li>
</ol>
</div>
<h3 id="toc-php-script-to-access-authenticated-url">PHP script to access authenticated URL</h3>
<p>With the following simple php script you can access  those files and make them available without authentication:</p>
<p>download <a href="http://php.vanhecke.info/wp-content/uploads/2008/01/basic-authentication-removed.zip">Authentication Script zipped together with Snoopy Class file</a>.</p>
<p>Unzip and configure the file/page to fetch (e.g. <a href="http://twitter.com/statuses/replies.rss" title="http://twitter.com/statuses/replies.rss">http://twitter.com/statuses/replies.rss</a> for Twitter) and your username and password:</p>
<p style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<p style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #008000">// Configuration! Change values here, </span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #008000">// leave rest of script untouched.</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white">$url_to_be_fetched           = <span style="color: #006080">"http://someserver/somepage/"</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">$username_to_be_sent        = <span style="color: #006080">"your_user_name"</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white">$password_to_be_sent        = <span style="color: #006080">"your_password"</span>;</pre>
<p>Upload it to a directory on your (php-capable) webserver together with the (included in the zip file) <a href="http://sourceforge.net/projects/snoopy/">Snoopy PHP class file</a>.</p>
<h3 id="toc-use-cases">Use Cases</h3>
<ul>
<li>Bloglines allows you to publish (part of) your subscriptions (example <a href="http://www.bloglines.com/public/PascalVanHecke" title="http://www.bloglines.com/public/PascalVanHecke">http://www.bloglines.com/public/PascalVanHecke</a> - see your <a href="http://www.bloglines.com/profile?mode=1">Blogroll settings</a>), and have your opml downloaded (example: <a href="http://www.bloglines.com/export?id=PascalVanHecke" title="http://www.bloglines.com/export?id=PascalVanHecke">http://www.bloglines.com/export?id=PascalVanHecke</a>) but this means feedpublishers see your username as well.  You can use the script to give other people or applications access to your opml without having to give them your username/pswd.</li>
<li><a href="http://twitter.com/statuses/replies.rss">Twitter replies</a>  and all other feeds requiring authentication</li>
</ul>
<h3 id="toc-keeping-private-feeds-private">Keeping Private Feeds private</h3>
<p>In case of personalised RSS feeds, most services do not protect the feed with authentication, but provide the user with a freely accessible feed at a &#8220;secret url&#8221;.  As soon as you use that feed in Web-based feed readers (<a href="http://www.bloglines.com">Bloglines</a>, <a href="http://www.google.com/reader/">Google Reader</a>&#8230;) chances are other users will stumble on them when searching.</p>
<p>Which is why Bloglines <a href="http://www.bloglines.com/about/specs/fac-1.0">introduced</a> an &lt;access:restriction&gt; element:</p>
<pre> &lt;access:restriction relationship="deny" /&gt;</pre>
<p>If a feed contains this element, it won&#8217;t show up in searches within Bloglines.  Which is why I&#8217;ve included the restriction by default in the feed, although you can switch it off by setting the $feed_preferably_private to false:</p>
<p style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<p style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #008000">// in case you use this to be able to read an authenticated feed </span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4"><span style="color: #008000">// via Bloglines, you probably do not want it to show up in search </span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"><span style="color: #008000">// results</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">$feed_preferably_private    = <span style="color: #0000ff">true</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white"></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: #f4f4f4">// end configuration</pre>
<h3 id="toc-support-for-accessrestriction-element">Support for access:restriction element</h3>
<p>I haven&#8217;t found any mentions of Google Reader supporting it as well, but I have a feed in Google reader with this restriction for more than a month now, and it doesn&#8217;t show in the results when I search for it (using a different account).   Some people <a href="http://andybeard.eu/2007/09/open-social-web-google-reader.html">have pointed out</a> though that Google does allow you to share these &#8220;protected feeds&#8221; via Google Shared Items or Feedburner.</p>
<p>From the services with &#8220;personalised/secret feeds&#8221; I am using, Facebook <a href="http://www.facebook.com/help.php?page=23">supports it</a>, most others like <a href="http://www.google.com/help/reader/sharing.html">Google Reader Shared Items</a>, the <a href="http://del.icio.us/help/for">del.icio.us &#8220;for&#8221;</a> feed and <a href="http://wakoopa.com/">Wakoopa alerts</a>  don&#8217;t.</p>
<p>Feel free to leave your comments!</p>
<img src="http://feeds.vanhecke.info/~r/PhpNotes/~4/219872719" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://php.vanhecke.info/2008/01/20/republish-a-feed-or-other-data-protected-by-http-basic-authentication/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Gregarius plugin: do not aggregate yourself (when aggregating search feeds)</title>
		<link>http://php.vanhecke.info/2007/05/10/gregarius-plugin-do-not-aggregate-yourself-when-aggregating-search-feeds/</link>
		<comments>http://php.vanhecke.info/2007/05/10/gregarius-plugin-do-not-aggregate-yourself-when-aggregating-search-feeds/#comments</comments>
		<pubDate>Wed, 09 May 2007 22:38:03 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
		
		<category><![CDATA[Gregarius]]></category>

		<category><![CDATA[Syndication]]></category>

		<guid isPermaLink="false">http://php.vanhecke.info/2007/05/10/gregarius-plugin-do-not-aggregate-yourself-when-aggregating-search-feeds/</guid>
		<description><![CDATA[Yesterday evening I knocked together&#160;this &#8220;Paola246&#8220;&#160;aggregator site.&#160; Paola246 aka Paolavdb is&#160;the Flemish version of &#8220;Lonelygirl15&#8220;: a fictitious online persona&#160;posing as real.&#160; &#8220;Paola&#8221; tried&#160;to tap into social media&#160;so systematically (starting a&#160;Twitter, Flickr, Youtube and a few blog accounts in one day&#160;), that no one seems to have ever believed she was genuine.&#160; Still, nothing beats a [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday evening I knocked together&nbsp;this &#8220;<a href="http://paola246.be/">Paola246</a>&#8220;&nbsp;aggregator site.&nbsp; Paola246 aka Paolavdb is&nbsp;the Flemish version of &#8220;<a href="http://en.wikipedia.org/wiki/Lonelygirl15">Lonelygirl15</a>&#8220;: a fictitious online persona&nbsp;posing as real.&nbsp; &#8220;Paola&#8221; tried&nbsp;to tap into social media&nbsp;so systematically (starting a&nbsp;Twitter, Flickr, Youtube and a few blog accounts in one day&nbsp;), that no one seems to have ever believed she was genuine.&nbsp; Still, nothing beats a good <a href="http://en.wikipedia.org/wiki/Alternate_reality_game">Alternate Reality Game</a>, and I guess quite some people will have fun following the story as it unfolds.</p>
<h3 id="toc-do-not-feed-yourself">Do not feed yourself</h3>
<p>If you aggreate Technorati searchfeeds (blogs writing about <a href="http://technorati.com/search/paola246">Paola246</a>/<a href="http://technorati.com/search/paolavdb">PaolaVdb</a>), and you syndicate the superfeed, then chances are URLs of your aggregator site will show up in your search feeds.&nbsp; That is because Technorati indexes pages and not only feeds.&nbsp; So I needed to filter out all URLs from the originating site.</p>
<h3 id="toc-gregarius-plugins">Gregarius plugins</h3>
<p>Gregarius has a <a href="http://wiki.gregarius.net/index.php/Plugin_Authoring">plugin architecture</a>, just like Wordpress&nbsp;(<a href="http://pascal.vanhecke.info/2006/03/18/wp-shortstat-plugin-broken-after-upgrading-to-wordpress-202/">example</a>) and <a href="http://php.vanhecke.info/category/applications-and-platforms/vanilla/">Vanilla</a>.&nbsp; There&#8217;s an <a href="http://wiki.gregarius.net/index.php/Plugin_API">API</a> you can use and a long list of &#8220;<a href="http://wiki.gregarius.net/index.php/Plugin_Hooks">hooks</a>&#8220;, with which can inject your own code into in the script without touching the core - so you can upgrade very easily.&nbsp; Probably you will not even need to study the API, because there are already a lot of <a href="http://plugins.gregarius.net/">plugins available</a> to modify.</p>
<h3 id="toc-filtering-incoming-items">Filtering incoming items</h3>
<p>In my case, I started from the &#8220;<a href="http://gregarius-plugin-itemfilter.googlecode.com/svn/trunk/PerFeedItemFilter.php">PerFeedItemFilter</a>&#8220;, that allows to filter every incoming feed with&nbsp;a specific&nbsp;regular expression.&nbsp; I just wanted to prevent both aggregating and displaying (if the harm already had been done) URLs with the same hostname, so I just stripped most of the code and inserted twice a snippet like this:</p>
<pre>      $parsed_feed_url = parse_url($item-&gt;url);
      if (is_array($parsed_feed_url)) $parsed_host = $parsed_feed_url["host"]; 

      #-- kill item if regex DOES NOT match
      if ($parsed_host == $_SERVER['HTTP_HOST']) {
         $item = NULL;
      }
</pre>
<p>Upload and activate the plugin in the Admin Panel&#8230; and done!&nbsp; Download the plugin <a href="http://php.vanhecke.info/_resources/DoNotIndexYourSelfFilter.php.txt">here</a>.</p>
<h3 id="toc-about-gregarius">About Gregarius</h3>
<p><a href="http://gregarius.net/">Gregarius</a> is a php-based RSS aggregator: put it on a site,&nbsp;add feeds to the configuration, and it will create a so-called &#8220;planet site&#8221; with all the items of the added feeds in a &#8220;<a href="http://www.reallysimplesyndication.com/riverOfNews">river of news</a>&#8221; display.&nbsp; Typically you&#8217;ll want to follow a planet site on a specific topic or group of people when you want the maintainer of the planet to do the selection of feeds for you.</p>
<p>The resulting superfeed has links that don&#8217;t point to the planet, but to the individual original items.</p>
<div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:412a34f1-e277-4d1c-afb6-25fa229d00a2" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px">[tags]Gregarius, Plugin, Plugins, technorati, searchfeeds, search feeds, loop, filter[/tags]</div>
<img src="http://feeds.vanhecke.info/~r/PhpNotes/~4/177421255" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://php.vanhecke.info/2007/05/10/gregarius-plugin-do-not-aggregate-yourself-when-aggregating-search-feeds/feed/</wfw:commentRss>
		</item>
		<item>
		<title>FCKeditor extension for Vanilla: long URLs don’t work</title>
		<link>http://php.vanhecke.info/2007/03/20/fckeditor-extension-for-vanilla-long-urls-dont-work/</link>
		<comments>http://php.vanhecke.info/2007/03/20/fckeditor-extension-for-vanilla-long-urls-dont-work/#comments</comments>
		<pubDate>Tue, 20 Mar 2007 18:35:59 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
		
		<category><![CDATA[Vanilla]]></category>

		<guid isPermaLink="false">http://php.vanhecke.info/?p=11</guid>
		<description><![CDATA[The FCKeditor extension for Vanilla is a great plugin that (obviously) enables the FCK editor for forum posts, including an easy way to posts videos from the major online video sites (Youtube, Google Video&#8230;).
There&#8217;s one issue however I&#8217;ve been struggling with: some long html links simply did not display, i.e.  a xhref=&#8221;http://somelongurl&#8221; mce_href=&#8221;http://somelongurl&#8221; was [...]]]></description>
			<content:encoded><![CDATA[<p>The FCKeditor extension for Vanilla is a great plugin that (obviously) enables the FCK editor for forum posts, including an easy way to posts videos from the major online video sites (Youtube, Google Video&#8230;).</p>
<p>There&#8217;s one issue however I&#8217;ve been struggling with: some long html links simply did not display, i.e.  a xhref=&#8221;http://somelongurl&#8221; mce_href=&#8221;http://somelongurl&#8221; was in the database, but in the html output the href attribute simply was missing.</p>
<p>This turns out to be configurable in /extensions/FCKeditor/settings.php (line 6):</p>
<p><code>// $FCKeditor_allowed_tags = array( 'a' =&gt; array('accesskey' =&gt; 1, 'class' =&gt; 1, 'href' =&gt; array('maxlen' =&gt; 100), 'tabindex' =&gt; 1, 'title' =&gt; 1, 'target' =&gt; 1, 'onmouseover' =&gt; 1), // modif pvh 20070320 maxlen modified urls -&gt; up to 300</code></p>
<p>$FCKeditor_allowed_tags = array( &#8216;a&#8217; =&gt; array(&#8217;accesskey&#8217; =&gt; 1, &#8216;class&#8217; =&gt; 1, &#8216;href&#8217; =&gt; array(&#8217;maxlen&#8217; =&gt; 300), &#8216;tabindex&#8217; =&gt; 1, &#8216;title&#8217; =&gt; 1, &#8216;target&#8217; =&gt; 1, &#8216;onmouseover&#8217; =&gt; 1),</p>
<p>Problem solved!</p>
<div style="margin: 0px; padding: 0px; display: inline" id="0767317B-992E-4b12-91E0-4F059A8CECA8:36f55271-af6c-41c7-a8f6-a7a10863b584" class="wlWriterSmartContent">[tags]Vanilla, FCKeditor, extension, add-on, long url, long urls, links not showing, length, configuration[/tags]</div>
<img src="http://feeds.vanhecke.info/~r/PhpNotes/~4/177421256" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://php.vanhecke.info/2007/03/20/fckeditor-extension-for-vanilla-long-urls-dont-work/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Adding a tab to your Vanilla Menu - the AddGabblyToMenu Extension as an example</title>
		<link>http://php.vanhecke.info/2007/03/19/adding-a-tab-to-your-vanilla-menu-example-the-addgabblytomenu-extension/</link>
		<comments>http://php.vanhecke.info/2007/03/19/adding-a-tab-to-your-vanilla-menu-example-the-addgabblytomenu-extension/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 01:05:34 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
		
		<category><![CDATA[Vanilla]]></category>

		<guid isPermaLink="false">http://php.vanhecke.info/?p=10</guid>
		<description><![CDATA[Gabbly is a service with which you can transform any web page to a chat box - simply by prefixing the web page with http://gabbly.com/.
There are lots&#160;of situations where this can be handy -&#160;in&#160;my case, I&#160;was asked to create a chat&#160;box on&#160;a&#160;Dutch-language Second Life Forum in case the SL grid goes down (and people flock [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://gabbly.com/">Gabbly</a> is a service with which you can transform any web page to a chat box - simply by prefixing the web page with <a title="http://gabbly.com/" href="http://gabbly.com/">http://gabbly.com/</a>.</p>
<p>There are lots&nbsp;of situations where this can be handy -&nbsp;in&nbsp;my case, I&nbsp;was asked to create a chat&nbsp;box on&nbsp;a&nbsp;<a href="http://slforum.be/">Dutch-language Second Life Forum</a> in case the SL grid goes down (and people flock to the forum in search of an alternative :-).</p>
<p>Let&#8217;s implement this with an extra link in the upper menu, and create a the most basic of all Vanilla extensions for it.</p>
<h3 id="toc-how-to-create-an-extension">How to create an extension?</h3>
<ul>
<li>make a subfolder in the folder /extensions, e.g. &#8220;AddGabblyToMenu&#8221;
<li>create a page called default.php
<li>you first need to include some information about the extension, as is documented in the Vanilla Wiki:</li>
</ul>
<pre>&lt;?php
/*
Extension Name: Your Extension Name Here
Extension Url: The url to where this extension can be downloaded
Description: A description of your extension
Version: The current version of your extension
Author: Your Name
Author Url: Your personal url
*/

// your code starts here
?&gt;</pre>
<p>Typically, your extension will contain some info that&#8217;s configurable: names of menus or links (you need to separate them out in order to make them easily translatable), the place on the page where the output of the extension will come.&nbsp; In Vanilla, you define this respectively &nbsp;in the &#8220;Dictionary&#8221; and &#8220;Configuration&#8221; of the global $Context variable:</p>
<p><code>$Context-&gt;Dictionary['AddGabblyToMenu'] = &#8216;ChatBox&#8217;;<br />$Context-&gt;Configuration['TAB_POSITION_GABBLYCHAT'] = &#8216;80&#8242;;</code> </p>
<p>So now we want to add our Gabbly Link to the Menu.&nbsp; The $Menu object happens to be another global variable that you can simple call a method &#8220;AddTab&#8221; from:&nbsp;</p>
<p><code>if (isset($Menu)) <br />{<br />&nbsp; $Menu-&gt;AddTab(&nbsp;<br />&nbsp;&nbsp;&nbsp; $Context-&gt;GetDefinition(&#8217;AddGabblyToMenu&#8217;),&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;</code><code>// the&nbsp;menu text<br />&nbsp;&nbsp;&nbsp; &#8216;AddGabblyToMenu&#8217;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; // the menu item name<br />&nbsp;&nbsp;&nbsp; &#8220;http://gabbly.com/&#8221;.$Configuration['BASE_URL'],&nbsp; <br />&nbsp;&nbsp;&nbsp; // the&nbsp;menu link<br />&nbsp;&nbsp;&nbsp; &#8220;rel=nofollow&#8221;,&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; // extra attributes for the link (optional)<br />&nbsp;&nbsp;&nbsp; $Configuration['TAB_POSITION_GABBLYCHAT']&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; // the&nbsp;position in the menu<br />&nbsp; );<br />}</code> </p>
<p>Here you see how to access terms from the dictionary&nbsp;($Context-&gt;GetDefinition()) - and from the configuration (the $Configuration[]) array.&nbsp; Note that the order of the tabs in the Vanilla upper menu is determined by an integer number.&nbsp; You&#8217;ll find the order of the default menu options defined in /appg/settings.php - you&nbsp;determine your menu&nbsp;tab position by choosing a numer between or greater than those:</p>
<p><code>// Vanilla Tab Positions <br />$Configuration['TAB_POSITION_DISCUSSIONS'] = &#8216;10&#8242;; <br />$Configuration['TAB_POSITION_CATEGORIES'] = &#8216;20&#8242;; <br />$Configuration['TAB_POSITION_SEARCH'] = &#8216;30&#8242;; <br />$Configuration['TAB_POSITION_SETTINGS'] = &#8216;40&#8242;; <br />$Configuration['TAB_POSITION_ACCOUNT'] = &#8216;50&#8242;; </code></p>
<p>And that&#8217;s it!&nbsp; The only thing you need to do now, is to enable your extension in the adminstration panel and you&#8217;re done!&nbsp;</p>
<h3 id="toc-remarks">Remarks:</h3>
<ul>
<li>it was only while writing and searching on the Vanilla Community forum that I noticed there alread is a <a href="http://www.mfkne.de/127/lussumo-vanilla-gabbly-extension">GabblyChat extension</a> for Vanilla (see also <a href="http://lussumo.com/community/discussion/5508/start-gabbly-chat/">extension page</a>, discussion <a href="http://lussumo.com/community/discussion/1963/offer-gabbly-chat-extension/">here</a>) - this solution adds a link in the right nav bar.
<li>Probably a link&nbsp;in the right nav bar is even better from a usability standpoint, but anyway, Gabbly was a good excuse to show how to add a link to the menu with a Vanilla extension&#8230;</li>
</ul>
<div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:6847b04f-b896-4216-a73d-b3686daf9a96" contenteditable="false" style="padding-right: 0px; display: inline; padding-left: 0px; float: none; padding-bottom: 0px; margin: 0px; padding-top: 0px">[tags]Vanilla, extension, menu, tab order, Gabbly[/tags]</div>
<img src="http://feeds.vanhecke.info/~r/PhpNotes/~4/177421257" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://php.vanhecke.info/2007/03/19/adding-a-tab-to-your-vanilla-menu-example-the-addgabblytomenu-extension/feed/</wfw:commentRss>
		</item>
		<item>
		<title>My favourite Vanilla extensions</title>
		<link>http://php.vanhecke.info/2007/02/18/my-favourite-vanilla-extensions/</link>
		<comments>http://php.vanhecke.info/2007/02/18/my-favourite-vanilla-extensions/#comments</comments>
		<pubDate>Sun, 18 Feb 2007 13:06:07 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
		
		<category><![CDATA[Forums and discussion]]></category>

		<category><![CDATA[Vanilla]]></category>

		<guid isPermaLink="false">http://php.vanhecke.info/?p=8</guid>
		<description><![CDATA[For the Second Life discussion site, I&#8217;ve used:

Account Pictures
This extension will allow your users to upload their icon and picture and store it on your server. You&#8217;ll have to create an upload directory and make it writeable. Also, the files which will get uploaded should have writing permissions. You can change the icon and picture [...]]]></description>
			<content:encoded><![CDATA[<p>For the <a href="http://slforum.be/">Second Life discussion site</a>, I&#8217;ve used:</p>
<ul>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=54">Account Pictures</a><br />
This extension will allow your users to upload their icon and picture and store it on your server. You&#8217;ll have to create an upload directory and make it writeable. Also, the files which will get uploaded should have writing permissions. You can change the icon and picture sizes on the settings .</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=153">Attachments</a></li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=95">Comment Removal</a><br />
Allows administrators and comment/discussion authors to delete posts and discussions directly from the database (ie. no first hide then clean up procedure). Please be aware that this is a permission, so if you&#8217;re an admin and you&#8217;re not seeing any &#8216;remove&#8217; button on posts, it&#8217;s because you haven&#8217;t</li>
<li>C<a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=86">omments Permalinks</a><br />
Adds a permalink in every comment, so you can share a single comment&#8217;s url.</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=178">FCKeditor</a><br />
FCKeditor is a popular WYSIWYG toolbar for your comment forms and posts. Includes Source editing, smileys and Youtube/Google/Soapbox/Vimeo/Revver/Dailymotion/VideoJug/MetaCafe video embedding</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=159">Google Analytics</a><br />
Adds the Google Analytics code to your vanilla forum pages. You must set up an account with Google Analytics and enter your account number in default.php before this add-on will work. Also see further discussion at <a href="http://lussumo.com/community/discussion/3507/">http://lussumo.com/community/discussion/3507/</a></li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=9">Guest Welcome Message</a><br />
Adds a welcome message to the panel if the person viewing the forum isn&#8217;t signed in.</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=154">Inline Images</a><br />
This extension will display uploaded image attachments in your comments. Users can use an image tag (e.g. [Image_154]). You can only use the image tag for comments where you uploaded the image to. !!!REQUIRES ATTACHMENTS 2!!!</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=104">Next Unread Discussion Link</a><br />
This extension adds two links between the last comment of a discussion and the comments form. Previous Page Next Unread &#8220;Previous Page&#8221; simply goes back in the browser history. &#8220;Next Unread&#8221; will link to the most recently active discussion which contains unread comments.</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=48">Notify</a><br />
The extension &#8220;Notify&#8221; enables to subscribe to the complete forum, categories or single discussions to be notified about new comments/discussions. Every user won&#8217;t get more than one mail, until he visits the forum again.</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=20">Predefined Attributes</a><br />
The extension allows administrators to predefine attributes. Administrators may add custom fields like &#8220;Phone-Nr.&#8221; or &#8220;Shirt-Size&#8221; (Respect your users privacy). Users fill this information on Appliance and on the Account &#8220;Personal Information&#8221; page.</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=73">RSS2 Feed</a><br />
Adds a link to an RSS2 feed on any applicable pages of Vanilla. It&#8217;s a WYSIWYG type of feed where it will deliver exactly what you see when you are browsing the forum. So, if you run a search and then click the RSS2 feed, you will get a feed of the search results.</li>
<li><a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=115">Sidepanel</a> 1.0<br />
Enables you to insert everything you want to appear in the sidepanel easily (based on Statcounter by JP Mitchell) this is basically the code to extend the sidepanel.</li>
</ul>
<div style="margin: 0px; padding: 0px; display: inline; float: none" id="0767317B-992E-4b12-91E0-4F059A8CECA8:0f6f6ad7-572c-4fc1-85b8-e77ae53d58f1" class="wlWriterSmartContent">[tags]Vanilla, extensions, RSS, notification, navigation, custom attributes, image upload, FckEditor[/tags]</div>
<img src="http://feeds.vanhecke.info/~r/PhpNotes/~4/177421258" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://php.vanhecke.info/2007/02/18/my-favourite-vanilla-extensions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PHP forum software: phpBB, BBpress or Vanilla?</title>
		<link>http://php.vanhecke.info/2007/01/17/php-forum-software-phpbb-bbpress-or-vanilla/</link>
		<comments>http://php.vanhecke.info/2007/01/17/php-forum-software-phpbb-bbpress-or-vanilla/#comments</comments>
		<pubDate>Wed, 17 Jan 2007 12:24:54 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
		
		<category><![CDATA[Forums and discussion]]></category>

		<guid isPermaLink="false">http://php.vanhecke.info/?p=9</guid>
		<description><![CDATA[I was searching for bulletinboard/forum software for a a Second life forum  that was:

easy to set up
easy to maintain, in the sense that I didn&#8217;t want to develop basic functionality myself
had a sufficiently large community

BBpress

themes system not yet in place..
integration with Wordpress would be interesting for the longer term, but not just now

Vanilla

webstandards based
smallish [...]]]></description>
			<content:encoded><![CDATA[<p>I was searching for bulletinboard/forum software for a a <a title="Second Life forum" href="http://slforum.be/">Second life</a> <a href="http://slforum.be/categories/">forum</a>  that was:</p>
<ul>
<li>easy to set up</li>
<li>easy to maintain, in the sense that I didn&#8217;t want to develop basic functionality myself</li>
<li>had a sufficiently large community</li>
</ul>
<h3 id="toc-bbpress"><a href="http://bbpress.org/">BBpress</a></h3>
<ul>
<li>themes system not yet in place..</li>
<li>integration with Wordpress would be interesting for the longer term, but not just now</li>
</ul>
<h3 id="toc-vanilla"><a href="http://getvanilla.com/">Vanilla</a></h3>
<ul>
<li>webstandards based</li>
<li>smallish community</li>
<li>contributions:</li>
<ul>
<li>Themes: templates that involve php code</li>
<li>styles: pure layout, ie css and image</li>
<li>Add-ons: adds new functionality</li>
</ul>
</ul>
<h3 id="toc-phpbb"><a href="http://www.phpbb.com/">phpBB</a></h3>
<ul>
<li>huge community</li>
<li>lots of extensions, but mod system</li>
<li>no webstandards-based</li>
<li>no good seo, no friendly urls</li>
</ul>
<h3 id="toc-drupal"><a href="http://drupal.org/">Drupal</a></h3>
<ul>
<li>huge community</li>
<li>more a development platform than an application</li>
</ul>
<p>Are there any other options?  <a href="http://en.wikipedia.org/wiki/Comparison_of_Internet_forum_software">Full list on Wikipedia</a>.</p>
<h3 id="toc-outcome">Outcome:</h3>
<p>I went for Vanilla:</p>
<ul>
<li>it just did what was needed</li>
<li>I found this nice <a href="http://lussumo.com/addons/index.php?PostBackAction=AddOn&#038;AddOnID=146">Vanilla green</a> style by <a href="http://www.krijtenberg.nl/">Maurice Krijtenberg</a></li>
<ul>
<li>note: use the default theme, most styles are based upon it - so in the end you have greater choice</li>
</ul>
<li>Have a look at the <a href="http://php.vanhecke.info/?p=8">Vanilla extensions I used</a></li>
</ul>
<div style="margin: 0px; padding: 0px; display: inline" id="0767317B-992E-4b12-91E0-4F059A8CECA8:d4d1a96a-6468-4f40-8b3e-e9a626bd3669" class="wlWriterSmartContent">[tags]vanilla, bbpress, drupal, phpbb, extensions, forum, bulletin board, comparison[/tags]</div>
<img src="http://feeds.vanhecke.info/~r/PhpNotes/~4/177421259" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://php.vanhecke.info/2007/01/17/php-forum-software-phpbb-bbpress-or-vanilla/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Avoiding phpBB registration spam</title>
		<link>http://php.vanhecke.info/2006/12/01/avoiding-phpbb-registration-spam/</link>
		<comments>http://php.vanhecke.info/2006/12/01/avoiding-phpbb-registration-spam/#comments</comments>
		<pubDate>Fri, 01 Dec 2006 11:54:30 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
		
		<category><![CDATA[Forums and discussion]]></category>

		<category><![CDATA[PhpBB]]></category>

		<guid isPermaLink="false">http://php.vanhecke.info/?p=7</guid>
		<description><![CDATA[Online marketing report boosts a phpBB registration bot - a tool that will register a user on a phpBB forum, in order to drop a link in the user profile.
Since phpBB doesn&#8217;t put a nofollow tag on a profile link (check for yourself on the mother of all phpBB forums), phpBB forum memberlists are an [...]]]></description>
			<content:encoded><![CDATA[<p>Online marketing report <a href="http://onlinemarketingreport.blogspot.com/2006/10/new-piece-of-software-forum-register.html">boosts a phpBB registration bot</a> - a tool that will register a user on a phpBB forum, in order to drop a link in the user profile.</p>
<p>Since phpBB doesn&#8217;t put a nofollow tag on a profile link (check for yourself on the <a href="http://www.phpbb.com/phpBB/memberlist.php">mother of all phpBB forums</a>), phpBB forum memberlists are an easy target for linkspamming.</p>
<p>I used to manually remove fake registrations on a phpBB forum I run until I got sick of it and installed this <a href="http://www.phpbb.com/phpBB/viewtopic.php?t=373695">anti-registration-spam mod</a>.  It simply removes the url field upon registration, and discards the registration if an automated process tries to post a url field anyway.</p>
<div class="wlWriterSmartContent" id="0767317B-992E-4b12-91E0-4F059A8CECA8:6ff50366-0420-4d47-bafe-462ee6ac88f5" style="margin: 0px; padding: 0px; display: inline">[tags]phpbb, spam, anti-spam, registration, nofollow, memberlist, forum, mod, phpbb mod[/tags]</div>
<img src="http://feeds.vanhecke.info/~r/PhpNotes/~4/177421260" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://php.vanhecke.info/2006/12/01/avoiding-phpbb-registration-spam/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Inline Flash Player mod for PhpBB</title>
		<link>http://php.vanhecke.info/2006/09/05/inline-flash-player-mod-for-phpbb/</link>
		<comments>http://php.vanhecke.info/2006/09/05/inline-flash-player-mod-for-phpbb/#comments</comments>
		<pubDate>Mon, 04 Sep 2006 22:06:07 +0000</pubDate>
		<dc:creator>Pascal</dc:creator>
		
		<category><![CDATA[PhpBB]]></category>

		<guid isPermaLink="false">http://php.vanhecke.info/?p=3</guid>
		<description><![CDATA[- based on&#8230;
player&#8230;
youtube&#8230;
other inline players: list, also list to playlist thingies
]]></description>
			<content:encoded><![CDATA[<p>- based on&#8230;</p>
<p>player&#8230;</p>
<p>youtube&#8230;</p>
<p>other inline players: list, also list to playlist thingies</p>
<img src="http://feeds.vanhecke.info/~r/PhpNotes/~4/177421261" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://php.vanhecke.info/2006/09/05/inline-flash-player-mod-for-phpbb/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
