What’s Digg? You may have been sitting under a rock for years and not no anything about Digg. Digg is a user content driven site, users submit links to article and sites that interest them and other uses either give it the thumbs up or the thumbs down. The most popular sites get onto the front page and can have literally thousands of hits this is reffered to as the Digg effect.
How to create a site like Digg with no programming? We are going to go step by step how you can develop such a site using Drupal CMS which is available from drupal.org if your unfamiliar with Drupal we have an overview here.
Before we start you will need.. A web server running PHP 4+ and a relational SQL database such as MySQL this tutorial presumes you have access to both of these.
- Downloading required modules and Drupal
- Setting up Drupal 4.7
- Installing Modules
- Configuring Modules
- Testing the Site
Downloading required modules and Drupal. We are going to use Drupal 4.7 for this site, Drupal 5 beta 2 is available but currently several of the modules we will use do not support this version of Drupal. We will be using the following modules, which should be downloaded via drupal.org please make sure you download the 4.7 versions of these modules.
These packages come as a gzip files and will need to be unzipped before they can be used. Setting up Drupal 4.7 Unzip the Drupal 4.7 files into your web root or folder which you will be working from, then unzip all the above module files moving the individual module folders into the module directory of your Drupal install. So you should end up with a Module folder that has 6 folders with files in them in addition to the files in the original module folder. Next you need to insert your SQL into your Database if you have phpmyadmin this is really easy, I will go through generic steps below consult your database administration control documents for more details.
- Create a new database (if your using a cheap host they may have already created you one)
- Import the database .sql file in phpmyadmin this is done through the import tab.
- Navigate to the database folder in your Drupal install
- Select the database that corresponds to yours
- select that file to import, and off you go.
- You should see 94 queries are executed and 57 new tables have been added to the database
- Final step – edit the file settings.php in sites/default in your Drupal install, after the initial text there is a place for you to enter your database details
Next fire up your browser and point it at your site you should see something like this If your not something has gone wrong, if you are congratulations you have just installed Drupal. Now make an administrator account by clicking “create the first account” and enter your email address and username, the next screen will offer you a chance to change these. Installing Modules Luckily all the hard parts are done so now we will install some modules to do this go to administer and then modules. you will see a big list of modules, some will have ticks next to them leave the ones that are ticked and tick the following
- Voting actions
Note any errors if there are any, if it occurred successfully you are almost there now we need to configure the site to act like Digg
- Go to Administer/Access Control and set access control for your new modules
- For vote_story links set use and edit story links for authenticated user
- For vote_up_and_down set use to authenticated user and view to both authenticated and anonymous
- Go to Administer/actions – this will activate actions
- Go to Administer/Settings/Content types then configure StoryLink and un-select Promoted to front page.
- Go to Administer/Settings/vote_up_down
- Set the types to Story Link
- In widget settings for nodes – Set alternative +1 style disable vote widget display and link display
- In widget settings for comments – select don not display for both widget and link
- Go to Administer/voting actions
- Set the name as Promote node to front page and save
- Press edit and add the following
- Value type = points
- comparison=Greater than
- Value however many points you want to set before an item appears on the front page I suggest 5
- Action choose Promote node to front page
The final thing to do is go into the module folder of vote_up_down and you will find 2 files node-storylink.tpl.php and template.php move them to the bluemarine folder. (note you will have to copy these files to which ever theme your using!) bluemarine is the default. Testing the site If your still with us by the end you have a Digg like site you can create new links by going to create content and the ability to vote up a story to get it to the front page, you can see your story links in the navigation window, now you just need some users. In part 2 we will look at some more useful modules to our Digg like site and part 3 looks at categories.