Blog

02 December 2007

The second version of the Personalise Site plugin has just been released and now includes methods to implicitly gain a users geo data.

These additions are intended to be used to further customise and improve a users browsing experience.

For example you may want to display content on a homepage that is relevant to a users location or you may want to automatically select the right country in a registration form to improve the signup experience.

Note. This plugin will currently return UK if in development mode.

This can be achieved in your views by making use of these methods:

Returns which country the user is in

<%= which_country %>



Returns which city the user is in

<%= which_city %>



The users geographical coordinates
longitude:

<%= longitude_coordinate %>


latitude:

<%= latitude_coordinate %>



As usual, if anyone has any suggestions on how to further improve this plugin, please send your comments over.

Homepage: http://www.railslodge.com/plugins/303-personalise-site
SVN: http://svn.railslodge.com/svn/plugins/personalise_site/

30 September 2007

This plugin provides helpers for your views that allow you to gain implicit data about the user browsing the site.

This is intended to be used to customise what the user see's, maybe to improve usability or for cross-browser issues

The following methods are available:

Returns the name of the browser the user is using

<%= which_browser %>



Returns the version number of the browser being used

<%= which_browser_version%>



Returns the name of the platform the user is using

<%= which_platform %>



Nil is always returned if the data is unavailable

==== Example usage

An example below looks at the platform and outputs the right command to install this plugin

<% if which_platform? == 'Windows' -%>
	ruby script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/
<% elsif which_platform? == 'Mac' -%>
	./script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/
<% else -%>
	script/plugin install http://svn.railslodge.com/svn/plugins/personalise_site/
<% end -%>
10 September 2007

TextFormatter plugin allows you filter user input, use the syntax gem, before it is saved to the database.

Install the plugin:

ruby script\plugin install http://svn.railslodge.com/svn/plugins/text_formatter/



Install the following gems:

gem install htmltokenizer
gem install syntax
gem install hpricot



If you are using the syntax highlighting method, copy the css from /vender/plugins/text_formatter/stylesheets/text_formatter.css into your css file.

The following methods can be used in your models:

===Remove HTML Tags
Remove all html tags from the given fields

tf_remove_html_tags :fieldname
#e.g. tf_remove_html_tags :title, :post




===Escape HTML Characters
Escape all tags and special characters

tf_escape_html_characters :fieldname
#e.g. tf_escape_all_html_characters :title, :post




===Escape Only Text Characters
Escape all text except html tags

tf_escape_text_characters :fieldname
#e.g. tf_escape_text_characters :title, :post




===Syntax Highlighting
Add syntax highlighting to all text within pre tags

tf_syntax_highlighting :fieldname
#e.g. tf_syntax_highlighting :title, :post




===Simple Text Markup
Apply SimpleTextMarkup

tf_simple_text_markup :fieldname
#e.g. tf_simple_text_markup :title, :post




===Content Formatter
Remove all html tags, SimpleTextMarkup, encode tags within html tags, syntax highlighting

tf_content_formatter :fieldname
#e.g. tf_content_formatter :title, :post




===Basic Formatter
Remove all html tags, SimpleTextMarkup, encode tags within html tags

tf_basic_formatter :fieldname
#e.g. tf_basic_formatter :title, :post
08 September 2007

This is a simple plugin that will add a before_save callback to add nofollow to all links within the given fields.

Example use:

Install the plugin:

ruby script\plugin install http://svn.railslodge.com/svn/plugins/nofollow_links/



Simply add this to the required fields

e.g. Example model:

class Plugin < ActiveRecord::Base
    #plugins
    nofollow_links :content, :title
end



See http://www.railslodge.com/plugins/106-nofollow-links for further details.