Many Faces of TimRSS Icon

Want to create a site like Digg with no programming?

Hi there, this post was originally on Venture Skills blog which is now defunct, but I have moved it over here to save it from vanishing forever. However I haven't done anything other then copy and paste so their maybe formatting or broken links. Also note comments will be switched off by default on these posts

Vote for Drupal in the CNet Webware 100 Awards! One of our clients wanted to create a social networking site similar to Digg, it will go live just after Christmas but in the process we have learnt a lot about Drupal and how sites like Digg work.

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.

Contents

  1. Downloading required modules and Drupal
  2. Setting up Drupal 4.7
  3. Installing Modules
  4. Configuring Modules
  5. 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

  • actions
  • Voting actions
  • cre
  • links
  • path
  • Vote_storylink
  • vote_up_down
  • votingapi

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

  1. 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
  2. Go to Administer/actions - this will activate actions
  3. Go to Administer/Settings/Content types then configure StoryLink and un-select Promoted to front page.
  4. 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
  5. 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
    • Tag=vote
    • function=sum
    • 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.

Quickly Linking?

If you want to link to this post quickly please use: http://tnash.eu/t413

alternativly use one of these services Tiny URL | bit.ly |is.gd

RSS feed | Trackback URI | Add your comment!

81 Comments »

Comment by Dries
2006-12-06 08:25:10
Dries avatar

You might also be able to use the queue.module. :)

 
Comment by ventureskills
2006-12-06 11:45:32
ventureskills avatar

agreed the next part of the article goes through a group of modules suggesting improvments along with a few cosmetic ones.

 
Comment by Chuck
2006-12-28 00:11:11
Chuck avatar

What about the voting_actions module? You tell us to download it, but do we not enable it? Sorry, I’m a newbie at Drupal. Great guide, though.

 
Comment by ventureskills
2006-12-28 00:44:59
ventureskills avatar

Well spotted enable it as well its some what important ;) and is referred to later I will edit the post.

 
Comment by Chuck
2006-12-28 01:08:12
Chuck avatar

I’m also having a problem with the votingapi module after I enable it. Here’s the error I get: user warning: Table ‘kelp_tutorialwhore.votingapi_vote’ doesn’t exist query: SELECT DISTINCT uid from votingapi_vote in /home/kelp/public_html/tutorialwhore/includes/database.mysql.inc on line 121. Any ideas what causes this?

 
Comment by ventureskills
2006-12-28 01:47:17
ventureskills avatar

Hi Chuck, try disabling the module, then renabling and running the update.php also continue through the tutorial if its possible to do so, if you still have the error reply and we will do some digging into why that query isn’t working, I would have suggested posting on drupal.org as well but I notice you have already done that :)

 
Comment by Chuck
2006-12-28 02:43:28
Chuck avatar

Hey, Now that I actually completed the tutorial, I don’t think the error effected the outcome much. I have the website running like a Digg site. I just need to create my own personal theme. Thanks a lot, this is a great tutorial! I better go address the problems I posted on the forum :) BTW, if someone’s looking for a digg-clone, forget pligg, use this tutorial along with Drupal for better results. Drupal is much more advanced, while pligg is still at its baby stages. There is almost no flexibility with pligg. You’re almost helpless if you’re not a programmer.

 
Comment by Michael Visser
2007-01-02 12:14:16
Michael Visser avatar

Going through your tutorial now. Thanks! :D

 
Comment by ventureskills
2007-01-02 12:39:14
ventureskills avatar

cool, I’m in fact testing the final section of the part3 of the tutorial for bugs, all being well should be out this afternoon (or tomorrow) ;)

 
Comment by joomlaturk
2007-01-12 00:27:15
joomlaturk avatar

where is the part 3 of tutorial do you have a sample web site that shows digg like drupal

 
Comment by ventureskills
2007-01-12 17:55:39
ventureskills avatar

Part 3 is coming honest… In the mean time try our new series on CCK & Views part 1 of which is up now. As for sites using Digg like Drupal we are in the final stages of finishing a site for a client which has been the bases of this tutorial when completed we will post a link. There are however several good Digg clones using Drupal I believe if you visit the vote up/down project page it has a link to several.

 
Comment by Shaun Anderson
2007-02-03 20:35:11
Shaun Anderson avatar

I’m new to Drupal and just mucking about but I love the tutorial. Except none of my stories links actually link to the source as I specify it - they all just point internal - what am I doing wrong please?

 
Comment by Venture Skills Team
2007-02-03 22:29:33
Venture Skills Team avatar

Just check with me, when your creating content your going to create content -> Story Link Then adding the title, URL (full including http?) and description If you do this what does the node look like once its up?

 
Comment by Nick
2007-02-05 05:25:02
Nick avatar

Hey the tutorial worked great! Now how do I enable the same thing for a story. In other words I’d like to let users submit news stories on their own as editorials. When I enabled Storys it lets me submit a story but there is no vote box next to it. Any ideas? (also any way to add a tag cloud?) Thanks! N

 
Comment by Venture Skills Team
2007-02-05 09:02:26
Venture Skills Team avatar

repeat the above replacing stoy link with which ever node type you want. tagadelic module for all your tag cloud goodness

 
Comment by Greg Rebuck
2007-02-07 02:30:04
Greg Rebuck avatar

I’m having the same problem that Shaun is having. The link just points to http://www.example.com/?q=node/3 which doesn’t do us much good. The URL is apparently set up to point elsewhere on the web so I don’t know what’s wrong.

 
Comment by Greg Rebuck
2007-02-07 05:57:28
Greg Rebuck avatar

BTW, don’t click on the fake link I provided, unless you want to buy “ourdomain.com”…for about $14,000! I probably should have checked to see what was there before I posted P->

 
Comment by Venture Skills Team
2007-02-07 09:15:39
Venture Skills Team avatar

That’s odd, I will send you an email with some more detailed questions, did you have Drupal installed prior to this? and are you using Drupal 4.7?

 
Comment by Venture Skills Team
2007-02-07 09:40:39
Venture Skills Team avatar

“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.” Guessing that’s the problem if your using a different theme it may already have a template.php file don’t over ride it simply open the template.php from vote_up_down and copy the function to the themes template.php.

 
Comment by Graeme
2007-02-07 10:53:43
Graeme avatar

Thanks for the hard work on this guys. Seems a shame to restrict it to an old version of Drupal though. Any chance of updating it for version 5.0+? (Or are you restricted by the versioning of the modules? - I see Voting_Actions appears to only be for 4.7) Thanks

 
Comment by Venture Skills Team
2007-02-07 11:07:41
Venture Skills Team avatar

only voting actions needs to be updated so when the module owner updates it we will rewrite the tutorial for Drupal 5!

 
Comment by Graeme
2007-02-07 11:48:56
Graeme avatar

Yeah, cool beans. Thanks again!

 
Comment by Venture Skills Team
2007-02-07 11:54:57
Venture Skills Team avatar

If you put a site up place a link in the comments and I will add it to the article.

 
Comment by Greg Rebuck
2007-02-07 17:33:25
Greg Rebuck avatar

Thanks Tim, Regarding the link problem, I *did* in fact overwrite the template.php file so that may be my problem. My bad. I’ll repair this and try it again. Thanks!

 
Comment by JandB
2007-02-17 17:10:39
JandB avatar

Would you know how to do on drupal the server side of “digg it” button. http://www.digg.com/tools/integrate gives some explaination digg’s user to do on there webpage. But for obvious reason not on the server side. I think it’s a great feature to go viral. Thanks for your great works.

 
Comment by Venture Skills Team
2007-02-18 10:30:51
Venture Skills Team avatar

Hello JandB, The digg buttons are nearly always javascript, and so a server side version wouldn’t be required, however you have a look at this post for a couple of modules that may help.

 
Comment by JandB
2007-02-18 18:31:28
JandB avatar

Thank the link that gives interesting answer about SEO. However when a blogger submit a link in Digg he can put an icon in his post (with some javascript indeed) that would enable to vote for him on Digg. As I want to do the same thing in drupal I need to do something in my website to count those vote. Any idea how to do it ? Thank As we speak of SEO I’m sure it’s very good way to improve my page rank.

 
Comment by Venture Skills Team
2007-02-18 20:45:02
Venture Skills Team avatar

JandB look at service links in that article, alternativly add the Digg javascript code, to your nodes directly, by changing the content type to full html, finally put the code in your node template, if you want it set up that way.

 
Comment by JandB
2007-02-19 16:25:14
JandB avatar

Thank you but I don’t understand how to use the service ‘links’ I think you misunderstood my question I don’t want to put link from my site to Digg but to put in place the same mechanism than Digg. I want to count the number of person that on an icon from other website. In this way bloggers that put there links in my digg like website would put in place the link in there blog to increase the chance to increase there score in my digg like website.

 
Comment by Venture Skills Team
2007-02-19 16:27:28
Venture Skills Team avatar

I completely misunderstood, hmm let me give it some thought, I will see if we can create something…

 
Comment by JandB
2007-02-19 18:48:30
JandB avatar

Thank you. I think it’s a great part of seo benefit that involve in the digg mechanism. JB

 
Comment by deepak
2007-02-21 12:23:51
deepak avatar

Thanks for great advice, but i am having some difficulty. After following all the steps on this page, I am getting an error when I try to submit content Fatal error: Call to undefined function: links_normalize_url() in /home/.kemage/doc_web/news2.co.uk/modules/vote_up_down-4.7.x-1.0/vote_up_down/vote_storylink.module on line 544 How should I rectify it, plz advice Thanks Deepak

 
Comment by Venture Skills Team
2007-02-21 12:27:33
Venture Skills Team avatar

Ignore it and carry on through, it seems to be a small bug in the code, but does not effect the overall result (may have some other side effects) its been raised as an issue with the module developers.

 
Comment by deepak
2007-02-21 20:12:34
deepak avatar

But this message comes when I click on submit content/ story_link page, which means I cant submit story at all. So it wudnt work Thanks

 
Comment by Venture Skills Team
2007-02-21 20:28:52
Venture Skills Team avatar

have you gone through and done all the steps detailed on this page?

 
Comment by deepak
2007-02-21 20:56:21
deepak avatar

yes Link to my site is http://www.news2.co.uk

 
Comment by Venture Skills Team
2007-02-22 11:19:47
Venture Skills Team avatar

which version of the module are you using? , the site link doesn’t show any content, do you have an account I can log into (you can send the details to t.nash @ venture-skills.co.uk)

 
Comment by Rohan
2007-04-24 07:05:30
Rohan avatar

Thanks for the nice tutorial. I just got my site up and running. But I have a question. When user posts new story link, where do others see it? The story is not by default promoted to front page, so “Home” or frontpage does not list the new storylink. So as users can’t see it, they can’t vote. So only admin can promote the story to frontpage. I guess that is bad. So is there a link/page to view new stories? Thanks Rohan

 
Comment by Venture Skills Team
2007-04-24 07:10:43
Venture Skills Team avatar

the story links can be found on the node storylink, though you would be better off using the view module, combined with a good taxonomy structure. http://ventureskills.wordpress.com/2007/02/07/cck-views-the-ultimate-combination-part-2/

 
Comment by Mike
2007-04-30 21:57:00
Mike avatar

It takes a hell of a lot more than what you explainined. My site, tweako.com, was previously a “digg clone”. It took a good three months to develop and I just wanted to point out that there is a ton of things not explained in this article that need to be done in order to actually have a good site ready to be torn apart by tons of users.

 
Comment by Venture Skills Team
2007-04-30 22:31:07
Venture Skills Team avatar

The 3 part series will make a pretty robust site, but like all things it needs tweaking, I’m not sure what things you feel we have missed perhaps we could do a follow up article?

 
Comment by Jimbo
2007-05-02 04:07:53
Jimbo avatar

I’ve been wondering when this tutorial will be updated for Digg 5? It looks like releases for each of the required modules are now available. I tried to make it work with 5, however, without success. Up for a challenge?

 
Comment by Venture Skills Team
2007-05-02 07:33:24
Venture Skills Team avatar

Its on the cards but I believe a couple of modules haven’t been updated yet, however we have a sightly hacked Drupal 5 version running on a test server, so expect one soon.

 
Comment by ian-d
2007-05-17 15:33:56
ian-d avatar

Guys, really need some help, done all stages of part 1 and can publish a story/note etc and it appears on the front page, but there is no option to vote it up/down. I’m not too clued up on all this but am i doing something wrong? What i want is a system where by i can place adverts on a page, and customers can digg them up/down accordingly depending on service. From there the advert will either rise or fall in position. What would be the best method of doing this? Thanks for any help.

 
Comment by Venture Skills Team
2007-05-17 16:14:28
Venture Skills Team avatar

Well following this article would have got you to that stage ;) so I’m guessing at some point you didn’t quite follow the article fully. When creating your adverts are you using the storylinks content type?

 
Comment by Droople
2007-05-22 00:26:06
Droople avatar

How do i make all the story linsk open in a new window?

 
Comment by Gaurav
2007-07-24 20:36:05
Gaurav avatar

I am getting the following error when I am activating actions module from ‘administer->actions’: “Table ‘Drupal.actions’ doesn’t exist query: SELECT * FROM actions …” I am using actions-4.7.x-1.x-dev.tar.gz and drupal-4.7.6.tar.gz. The ‘actions’ tables is not created for some reason. I also don’t see any tables for ‘cre’ module. The new tables created other than the default 57 tables are: votingapi_action votingapi_action_condition votingapi_action_set I tried running ‘update.php’ with no luck. I am stuck, please help.

 
Comment by Gaurav
2007-07-26 23:22:14
Gaurav avatar

I looked a little deeper in the modules to solve my problem mentioned earlier about tables not getting created. I still dont know the reason, but I learned that as of Drupal 4.7, modules have an .install file so that any database tables which the module requires are created automatically when the module is enabled. Earlier versions 4.6 and older used to have a modulename.mysql and/or modulename.pgsql file that had the SQL queries to create/update the database tables. To get around my problem, I had to create these .mysql files from the .install files manually (Simply cut pasting the SQL queries). This was really annoying but I got it working. Now, I just need the answer that: - How are .mysql files gets created from .install files automotically. - Why is it not working for me?

 
Comment by Venture Skills Team
2007-07-26 23:33:51
Venture Skills Team avatar

sorry missed your first comment have you removed or made update.php unreadable?

 
Comment by Peter
2007-08-02 22:24:28
Peter avatar

The storylink does not link to the external url. Is there a setting for this? Great work though.

 
Comment by Elephant789
2007-08-07 06:14:36
Elephant789 avatar

I need some help. I was doing fine until I got to step 5. 5. Go to Administer/voting actions Set the name as Promote node to front page and save Press edit and add the following … I don’t have this directory “Administer/voting actions” I do have voting actions in my settings though. Anyways I could not figure this out so I skipped 5 and did the rest on page 1. As a result my front page is “Welcome to your new Drupal website”. I assume that’s because of step 5. How can I fix this. Thanks.

 
Comment by Elephant789
2007-08-08 04:10:01
Elephant789 avatar

It turns out that I accidently downloaded voting_actions-5.x-2.0b2. Anyways, I put up the 4.7 and the directories look fine. But now I am getting the error message: user warning: Table ‘mysite_imga1.voting_actions’ doesn’t exist query: SELECT va.vasid, va.name, va.content_type, va.weight FROM voting_actions va ORDER BY va.weight in /home/ladipp/public_html/includes/database.mysql.inc on line 121. And I still can’t get rid of the Drupal front page. I might just start all over.

 
Comment by Sudeep Goyal
2007-08-10 15:00:05
Sudeep Goyal avatar

I have just released Drupaligg: Digg clone using Drupal. Check out at: http://www.programmingbulls.com/drupaligg-open-source-diggreddit-clone-using-php-b The demo is available at: http://drupaligg.programmingbulls.com/

 
Comment by hiutopor
2007-09-17 10:07:34
hiutopor avatar

Hello Very interesting information! Thanks! Bye

 
Comment by Binoy
2007-10-30 04:41:50
Binoy avatar

Thanks for the excellent step by step guide. I am incorporating some of the features described above in a website which is due in December.

 
Comment by Emil
2008-01-06 22:42:06
Emil avatar

Hi, I’m at step 5: Go to Administer/voting actions * Set the name as Promote node to front page and save * Press edit and add the following” I clicked on submit, but don’t have any EDIT button. Can you tell me what happend? I use drupal 5 Thanks

 
Comment by Emil
2008-01-06 23:26:34
Emil avatar

I did it:) but still have a problem…I go to create content/storylinks , put the title, the URL of the website, promote to the frontpage. the final result doesn’t provide the URL!

 
Comment by George Marcell
2008-02-20 14:29:00
George Marcell avatar

As designers we are often asked about these kind of scripts for social bookmarkers and news sites its great to see someone putting out the codes.

 
Comment by silvanov
2008-03-15 14:04:17
silvanov avatar

Not sure if it was covered, but theres an easier way, using drupal, or a custom install of it, called drigg. http://www.drigg-code.org for more information.

 
Comment by esteban
2008-05-23 21:23:14
esteban avatar

I followed all the steps but step 5 where it says Go to Administer/voting actions * Set the name as Promote node to front page and save * Press edit and add the following etc….etc…… I’m using Drupal 5, I downloaded the module voting actions for version 5 and when I to the administer area of the moudle there’s no edit link to take me to the area where I’m supposed to add: # Value type = points # Tag=vote # function=sum # 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 Could you explain a bit more on how to do this. Thanks

 

Responses to this post:

dont be an idiot, use a real name and all comments are moderated
Name Your name not your website(required)
E-mail (required - never shown publicly)
Website address (URL)
Web site name will be used as link text
Subscribe to comments via email
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.
Spam protection: Sum of 5 + 7 ?
Tim Nash consulting