Download and install

Drigg can be installed in two ways.

The first one is the "express way" - a "Drupal distribution" offered here at drigg-code.org which includes a working copy of Drupal and a basic database schema that will give you a pre-configured site.

Or, you can do it yourself. Doing it yourself is not actually much more complicated. You will still need to configure your web server properly. You may still have to refer to Drupal's official documentation if you have any installation problems.

Drigg requires MySql 4.1 to work!

What about upgrading?

If you are already using Drigg, and would like to upgrade, all you need to do is download new versions of Extra Voting Forms, User Karma and Drigg:

Extra Voting Forms
User Karma
Drigg

If a new version of Drupal is out, the "express way" (below) will definitely use it. If a MAJOR new version of Drupal came out, it might take a while for the modules listed above to catch up.

Detailed upgrading information are in the UPGRADE.txt file in any Drupal package.

Drigg - the "express" way

Installing Drupal this way is a little easier. It's basically a Drupal installation where every single step described in the "manual way" has already been carried out.

Step 1: Install Drupal

Please follow the instructions in the next section "Drigg - the manual way" - but only Step 1, and using Drigg Drupal rather than the official Drupal package.

Please remember to change the file [your_drupal_dir]/sites/default/settings.php so that it contains your database information. Also keep in mind to follow the instructions so that you can enable "Clean URLs". Drigg will only ever work with "CLean URLs" active!

Step 2: Load information into your database

Now, load the database dump [your_drupal_dir]/drigg/drigg_distr_sql.mysql into your Drupal database. You can do this from the command line by typing (assuming that the database name is drigg_db):

cat drigg_distr_sql.mysql | mysql drigg_db

Important note: the main user's name is "admin", the password is "adminhere". You NEED to change this as soon as you log in.
There is also another user, "admin user", with extra powers (he's marked as "Drigg administrator"). The password, again, is "adminhere" - you NEED to change this too!

Step 3: Customise it!

At this point, you will want to change some of the information that comes "in stock" with this prepackaged version:

  • Username, email addresses and passwords for the users "admin" and "admin user". Go to Administer -> User Management -> Users
  • The "site's" email address. Go to Administer -> Site Configuration -> Site information

Step 4: That's it!

You might want to go through the step below, so that you know what the step would have been if you hadn't been lazy.

Drigg - the manual way

Step 1: Install Drupal

Installing Drupal is the biggest favour you can do to yourself if you want to run a web site.
The latest version of Drupal available is 5.7.
You can get it here: http://ftp.drupal.org/files/projects/drupal-5.7.tar.gz
(Please check http://www.drupal.org if the link above is indeed the latest version of Drupal!)

If you don't have access to your server, contact your provider and ask if they have Drupal available as an optional piece of software.

Go through the normal installation procdure (the file "INSTALL.txt"), including the creation of the admin account and the setup of cron tasks.

Important note: for Drigg to work, you need to:

  • Enable "Clean URLs". This means that Drupal will allow pages like this: http://www.localhost.com/admin rather than http://www.localhost.com?p=admin. Do do this, you will need to change your .htaccess file, and will need to configure Drupal appropriately by going to Administer -> Site Configuration -> Clean URLs.

Step 2: Install the required modules Drigg depends on

It's much better to install extra modules in the directory [your_drupal_dir]/sites/all/modules. This will keep your core drupal installation completely "clean".

Voting API

The module VotingAPI is a powerful set of functions used by Drigg in order to allow voting. It's a very important contributed module in Drupal. Drigg depends on it.

  • Uncompress it into your modules directory (often sites/all/modules)
  • Go do Administration -> Site Building -> Modules and check VotingAPI's checkbox
  • Click "Save configuration"

VotingAPI doesn't provide any "visible" feature. Therefore, it doesn't require any configuration.

Extra Voting Forms

The module Extra Voting Forms provides Javascript-enabled voting buttons which use the powerful VotingAPI. Installing it properly is absolutely crucial. Note that you can actually use _any_ voting module. However, Drigg has been tested with Extra Voting Forms, which is developed by the same team.

  • Uncompress it into your modules directory (often sites/all/modules)
  • Go do Administration -> Site Building -> Modules and check Extra Voting Forms's checkbox
  • Click "Save configuration"

User Karma

The module User Karma provides a subsystem to assign karma to users according to their activity. It was developed specifically for Drigg, although it is a generic module which stands on its own. Since Karma is such an important concept in Drigg, the module is required by Drigg.

  • Uncompress it into your modules directory (often sites/all/modules)
  • Go do Administration -> Site Building -> Modules and check User Karma's checkboxes. NOTE: There is more than one checkbox for this module! This is because the User Karma module is made up of one main module, and several plugin which define HOW a user can get karma. At this stage, just to make sure, enable all of them!
  • Click "Save configuration"

Drigg

This is the "actual" Drigg module.

  • Uncompress it into your modules directory
  • Go do Administration -> Site Building - Modules and check Drigg's check boxes. NOTE: There is more than one checkbox for this module! However, to simplify things just tick "Drigg META BASE package", which will enable the most commonly needed modules.
  • Click "Save configuration"

Step 2A: Install the important extra modules your users will love

Tagadelic

Well, this is not strictly required by Drigg. However, I can promise you that you'll like it and will want to use it!
It's the same story:

  • Uncompress it into your modules directory (often sites/all/modules)
  • Go do Administration -> Site Building -> Modules and check "Tagadelic"'s checkbox
  • Click "Save configuration"

Captcha

This module is important to prevent abuse and spam.

  • Uncompress it into your modules directory (often sites/all/modules)
  • Go do Administration -> Site Building -> Modules and check "Captcha"'s check boxes (also for Captcha images and text)
  • Click "Save configuration"

Step 2B: Create two categories

It's now time to create two important "dictionaries": one to hold the scoops' categories, and one to hold the scoops' tags. So:

  • Go to Administration -> Content Management -> Categories
  • Click on "Add vocabulary"
  • Fill out the form: Vocabulary Name should be "Category", Types should be "Scoop", "Required" should be checked. Do not tick "Multiple select" nor any "hierarchy" options. In fact, please don't tick any options for this taxonomy, or you might have problems.
  • You can see the list of categories now, which includes "Category". Click on "Add terms"
  • Add at least a couple of terms. Don't worry: these categories are not final.

Now, repeat the same thing for the tags:

  • Click on "Add vocabulary"
  • Fill out the form: Vocabulary Name should be "Tags", Types should be "Scoop", "Free tagging" and "Required" should be checked.

Done!

Step 2C: Configuring the modules

You will now need to configure Extra Voting Forms, User Karma and Drigg in order for them to suit your needs.
Their configuration interfaces are here:

  • Administer -> Settings -> Extra Voting Forms.. IMPORTANT: tick the checkbox "Scoop" in the section "Node types that will accept karma:"
  • Administer -> Settings -> User Karma. NOTE: You will need to configure both the main module, and its plugins (in the other tabs). If you don't do that, no user will ever get any karma!
  • Administer -> Settings -> Drigg. Don't despair if you don't understand all of the options just yet! The defaults are likely to do just fine. Please note that the first two select boxes should contain "Section" and "Tags" respectively. Those are the categories you just created, and will "link" the Drigg sections to the terms you created earlier. NOTE: There are several sub-tabs, one for each Drigg submodule you enabled! You will need to save the settings for each tab.

You need to click on "Save configuration" in every single screen here. This will set some "good defaults" for the modules to work with.

Finally, go here: Administer -> Content Management -> Content Types -> Scoop and untick "Promoted to front page" in the list of the default options.

Step 2D: Small categories hack

Got technical reasons, edit a category name you created previously. It doesn't need to be different -- the important thing is that you hit the "save" button. This is a chicken-and-the-egg issue... :-D

  • Go to Administration -> Content Management -> Categories
  • Click on "list terms" for the categry called "Category"
  • Click on "edit" for ANY one of the terms
  • Click on "Submit"..

For techs: by doing this, Drigg will automatically create a cached list of categories which will be used extensively throughout the module. Drigg didn't create the cache automatically before because it wasn't active when the sections were added.

Step 3: Configuring the modules' access

You will also need to configure access to these modules, in order to decide which user can do what. Standard Drupal has two types of users: "anonymous" and "logged in".

So:

  • Go to Administration -> User Management -> Access Control
  • In the "drigg module" section, grant "submit drigg stories" access to authenticated users; grant "view drigg stories" to both anonymous and authenticated users
  • In the "extra_voting_form module" section, grant "give points with extra voting forms" access to authenticated users
  • In the "comment module" section, grant "access comments" access to anonymous users

The Drigg and the Extra Module Forms modules also give you other permissions. However, it requires some (basic) Drupal knowledge to know about those ones.For now, you can ignore them.

Step 3a: Turn Drigg into your site's home page

This is probably what you will want to do. So, go to Administer -> Site Configuration -> Site Information and change the default front page from "node" to "drigg_home". This is also a good time to set the Email address.for your Drupal installation

Step 3b: Add the Drigg default theme

Drigg needs the theme to do a few very important things:
For example, in page.tpl.pgp it calls:

  • print extra_voting_forms_insert_js_css() . This is needed by Extra Voting Forms
  • print drigg_ui_sections();. This will print out the sections defined as a clickable menu.
  • print drigg_ui_submit_button();. This will display the "submit" button
  • print drigg_ui_type_menu();. This will define what the user is looking at, Drigg-wise: "Published", "Upcoming" or "Archived".
  • print drigg_ui_order_menu();. This will allow the user to pick the story's order: newest, oldest, etc.

The example theme, in node-drigg.tpl.pgp, calls:

  • print drigg_embed_contents(). This is to show embedded contents.
  • drigg_rl_related_links_get_html(). This will pull up an unordered list of related scoops.
  • drigg_ui_article_menu(). This will print the menu "Who voted", "Comments" etc. at the bottom of the article

The easiest way to go about the theme is to just use the default theme file that comes with Drigg. In the drigg directory (located under [your_server]/modules/drigg/, you will find:

  • drigg_theme

Move or copy drigg_theme in the "themes" directory in your server located in [your_drupal_dir]/sites/all/themes

You now need to enable the theme. go to Administer -> Site Building -> Themes, and pick "Drigg Theme". The layout of your site will change dramatically. Now, your scoops will look right.

Step 3c: Fix jquery's hiccups with jquery

First, you must overwrite the version of jQuery that ships with Drupal ([your_server]/misc/jquery.js) with the latest version found in the extra_voting_forms module directory (the file is named jquery-1.2.1.pack.js, but you will have to rename it to jquery.js and then move it to [your_server]/misc.

Unfortunately, Drupal 5 has a few problems when using the latest version of JQuery (needed by Drigg). Try to resize a field to see what can happen... A possible solution, waiting for Drupal 6, is to:

* Download jquery_update (don't activate it -- just download it):
http://ftp.drupal.org/files/projects/jquery_update-5.x-1.x-dev.tar.gz

* Copy the files collapse-fix.js and compat-1.0.js (found in the package before) to the /misc directory in your Drupal installation ([your_server]/misc

* Make sure that your theme has:

  < script type="text/javascript" src="/misc/collapse-fix.js">
  < script type="text/javascript" src="/misc/compat-1.0.js">

(Remove the spaces after the < symbols)
The default theme in Drigg assumes that these files are there, since I can't imagine somebody not wanting those glitches fixed.

Step 3d: Extra small step to configure Drupal right

Go to Administer -> Site Building -> Themes, hit the "Configure" tab, and check "Scoop" in "Display post information on".NOTE: to actually save this option, you will need to make sure that the "files" directory in your Drupal installation is writable by Apache. You can do this the "dirty" way ("chmod 777 files") or the proper way (assigning the directory "files" to the Apache server user).

Step 4: Play with the system!

It is now time to submit a couple of stories (Create Contents -> Scoop), and make sure that everything is OK. Voting should work. Try to create a couple of extra users, test their votes, and so on.
You will notice that nodes have

Step 4a: Create an "admin user" and give it extra powers

Now that you've played with the system, it's time to create a "special" user.

Go Administer -> User Management -> Roles and create a "drigg admin" role.

Now create a new user: "admin user" from Administer -> User Management -> Users -> Add User. Make sure you assign the user the "drigg admin" role.

Finally, go to Administer -> User Management -> Access Control. From there, under "extra_voting_forms" and "drigg", you will be able to assign extra powers to all the users with the role "karma admin" attached to them.

Step 5: Add blocks

At this point, you should have some testing nodes. You can now add some blocks. Go to Administer -> Site Building -> Blocks. There are five blocks you can have:

  • Best karma users
  • Best scoops
  • Best comments
  • Top upcoming in current category
  • Top published in current category
  • Drigg categories
  • Tags in tags (You can rename this block's title from its configuration)

The interface to add blocks is very simple: play with it, remembering that you need to have some fake stories and comments in order to actually have something to see!

Remember that by default stories in the blocks don't show the karma amounts. However, you might want to enable it: you can do so on a per-block basis by clicking on "configure" in each block.

Step 4c: An extra touch

Since you are using the default drigg, you might as well use some of its pretty images!
Go to Administer -> Settings -> Drigg -> Drigg UI

In "Feed string for feeds pointing to all articles", add

<img src="/sites/all/themes/drigg_theme/img/block_feedicon.gif" title="RSS Feed - All stories" />

Go to Administer -> Settings -> Drigg -> Drigg Users

In "Feed string for feeds pointing to promoted articles", add

&nbsp;<img src="/sites/all//themes/drigg_theme/img/block_feedicon.gif" title="RSS Feed - Only published stories" />

In "String to show next to the username if the user voted the story UP", add

<img src="/sites/all//themes/drigg_theme/img/whovoted_up.gif" alt="Up" />

In String to show next to the username if the user voted the story DOWN, add

<img src="/sites/all//themes/drigg_theme/img/whovoted_down.gif" alt="Down" />

Step 5: Nice aliases

While playing with the system, you must have noticed that stories are referred to as /node/3 or /node/5 etc. This is less than optimal. In order to have URLs like /Category/The_articles_title_more_or_less, you will need to:

  • Open the file [your_server]/sites/all/modules/drigg/custom_url_rewrite_function.php. This file came with the drigg module.
  • Select all of the text and copy it to the clipboard (all of it, from function custom_url_rewrite($op, $result, $path, $path_language=NULL) to the end of the file
  • Paste it right at the end of your settings.php file, which is probably located in sites/default/settings.php
  • That's it!

Reload a page, and notice that the URLs have drastically changed.

Step 6: More aliases

The current link to add a scoop is the Drupal-looking add/node/scoop. Yuck! Do this:

  • Go to Administer -> Site Building -> Modules, tick the "Path" module and hit "Save Configuration"
  • Go to Administer -> Site Building -> URL Aliases
  • Click on "Add alias"
  • In "Existing system path", type "node/add/drigg". Underneath, type "submit"

Done. If you see other URLs you don't like, you can change them in the same way.

Step 7: Remember to have a bookmarklet!

If you want people to submit to your site, remember to give them a bookmarklet!
Here is an example code:

<a href="javascript:q=(document.location.href);t=(document.title);void(open('http://WWW.EXAMPLE.COM/node/add/drigg?url='+escape(q)+'&title='+escape(t),'','resizable,location,menubar,toolbar,scrollbars,status'));" title="Submit to EXAMPLE.COM" alt="Submit to EXAMPLE.COM"><img src="http://WWW.EXAMPLE.COM/path_to_your_image.png" alt="Submit to EXAMPLE.COM"/></a>

To obtain (note that the image here is missing):

Submit to EXAMPLE.COM

Keep in mind that you will have to change EXAMPLE with your site's URL, and will have to create a "submit.png" image. If you created an alias between "node/add/drigg" and "submit", then you can just have "submit" there.

This button can be used in two ways:

* You can ask other sites to place them in their pages. This means that the site's users will be able to submit news to your site very quickly

* You can place it somewhere on your site, and tell people to place it in their bookmarks. When, whenever they are visiting something worthwhile, they can click on their bookmarks, and they will be submitting to your site!

Step 8: Enjoy your site!

Well, that's it. It was a lot of work, but it was definitely worth it!