I'm looking for a part-time remote job.

Hire me


I'm the author of:

Mastering Redmine is a comprehensive guide with tips, tricks and best practices, and an easy-to-learn structure.

Check the book's project or

Buy the book

Social pages of the book:

By buying this book you also donate to Redmine (see this page).


Follow me:

Advertising with Redmine

This is a simple plugin for advertising with Redmine and ChiliProject.

The plugin adds advetisements having title, text and optional image to the side bar. Advertisements are shown based on keywords found in the page content (project description, issue description, last comments etc), on languages provided by the browser (which provides languages the user understands), projects (administrators can specify, for which projects an advertisement should be shown or not) and on “hits” (the plugin tries to show advertisements with smaller hits number). Advertisements can be accessed using the special top menu item “Advertisements”. To edit advertisements the user must have the special “Manage advertisements” permission.

Why Reklama?

The plugin’s internal name is “reklama”...

Before “Reklama” the name was “Advertisements” but when used with other plugins, which put their data into the side bar, an advertisement was shown first. So the name was changed to “Reklama” to move advertisements down.

Managing advertisements

The plugin adds the top menu item “Advertisements”, which allows managing advertisements. To access this item the user must have the “Manage advertisements” permission (administrators do not need this permission).

Top menu item

This menu item opens the list of advertisements:

Managing advertisements

The special link “Clear hits” allows to zero hits for all advertisements.

Editing advertisement

The advertisement editing form looks like this:

Advertisement editing form

Some notes about the form:

  • Heading, content and language fields are required;
  • There can be only one image attached;
    But you can link to other images from the Wiki content.
  • Language field holds the language of the advertisement;
  • Keywords should be latin characters only;
  • Keywords are specified one keyword per input field;
  • Strict mode means, that the advertisement is to be shown only for pages having the specified keywords (at least one of them);
  • An advertisement is to be shown only for projects checked in the form.

How it works?

The plugin uses the following algorithm to fetch an advertisement:

  • Tries to find adveretisements by keywords, keywords are extracted from the page content;
    For project this is the project description, for issue this is the issue description, for Wiki page this is the page content and so on.
  • If fails, uses all advertisements;
  • Filters out advertisements, which should not be shown for the project;
  • Filters out disabled advertisements;
  • Filters out advertisements in languages not known to the user (based on data provided by the browser);
  • If advertisements were found by keywords, selects the advertisement with the largest number of keywords and with the smallest number of hits;
  • Otherwise selects an advertisement with just the smallest number of hits.
That is:
  • If a page contains keywords advertisements with these keywords will be shown (even if there will be an advertisement with zero hits);
  • The plugin tries to show each advertisement equal number of times (hits).

Requirements

The Reklama plugin requires RMagick.

Install

To install the plugin:

  • For Redmine 2.x.x and above:
    • Copy reklama directory to #{RAILS_ROOT}/plugins.
    • Run: rake redmine:plugins:migrate RAILS_ENV=production.
  • For older Redmine and ChiliProject:
    • Copy reklama directory to #{RAILS_ROOT}/vendor/plugins.
    • Run: rake db:migrate:plugins RAILS_ENV=production.
  • Restart Redmine/ChiliProject.

Theming

The Advertising plugin can provide custom CSS rules for Redmine themes.

Right now this feature is used to:

  • Add the top menu icon for the Advertisements menu item to the Classic Redmine theme.
  • Make advertisements in the list look like they were on the sidebar for the Red-Andy.

Check also this page for instructions on how to add support for other Redmine themes.

See also

redmine-advertising-menu.png View - Top menu item (3.79 KB) Andriy Lesyuk, 12 Sep 2011 10:38

redmine-advertising-edit.png View - Advertisement editing form (198 KB) Andriy Lesyuk, 12 Sep 2011 10:38

redmine-advertising-list.png View - Managing advertisements (117 KB) Andriy Lesyuk, 12 Sep 2011 10:39

Terms of use | Privacy policy