Page 1 of 5 123 ... LastLast
Results 1 to 10 of 46
  1. #1
    Pligg Donor lumpen5's Avatar
    Joined
    Mar 2007
    Posts
    50
    Thanks
    Received:0
    Given: 0

    counting clicks instead of votes

    i want to have my site count clicks instead of votes. I know there was a thread on this but it was back in February and when i tried it, well the code has changed a bit since then. Does anyone have an updated hack for this?

  2. #2
    Casual Pligger harlem's Avatar
    Joined
    Mar 2007
    Posts
    31
    Thanks
    Received:0
    Given: 0
    Yes, I agree. My site has a couple hundred unique hits a day but none bother to vote on the content. Habitually, once you are off the main site having found what you need it is rare that they come back. This makes voting almost irrelevant. A passive voting method would be beneficial to many sites struggling to get users to vote.

  3. #3
    Casual Pligger racerman28's Avatar
    Joined
    Jun 2007
    Posts
    68
    Thanks
    Received:0
    Given: 0
    That's a great idea. I would like to use that feature as well.

  4. #4
    Constant Pligger P1mpPanther's Avatar
    Joined
    Feb 2007
    Posts
    277
    Thanks
    Received:0
    Given: 0
    hmmm, figured someone would have responded to this by now.

    anyone?

  5. #5
    Casual Pligger jc007's Avatar
    Joined
    Mar 2007
    Posts
    47
    Thanks
    Received:0
    Given: 0
    I think is possible and not very hard because you already have the pageview count. Let me see if I can find something, I would love to have this functionality too.

  6. #6
    Constant Pligger P1mpPanther's Avatar
    Joined
    Feb 2007
    Posts
    277
    Thanks
    Received:0
    Given: 0
    hey gary - thats how i understand it as well.

    clicks for a story (or essentially views) will advance the vote counter.

  7. #7
    Casual Pligger Genghis's Avatar
    Joined
    Mar 2007
    Posts
    57
    Thanks
    Received:0
    Given: 0

    Yes!

    abcdefgary, if you could post the steps on how to do this for pligg 9.5 beta...well, I would really appreciate it!

  8. #8
    ozo
    ozo is offline
    Casual Pligger ozo's Avatar
    Joined
    Jan 2007
    Posts
    50
    Thanks
    Received:0
    Given: 0

    Couting Number of clicks - how to

    Hey I implemented a way to do this but I don't vouch that this is the best way to do it, but it worked for me @ www.meshedlinks.com, you can see it in action. Follow this steps - however this requires that you have a little, just a little, technical knowledge:

    1. create a field in your pligg_links table to store the number of clicks (NOTE: I guess this can be done simply by using extrafields, but I guess someone can work on this solution and have something better)
    To create field in your pligg_links table execute this against your database :
    ALTER TABLE pligg_links ADD COLUMN clicks BIGINT DEFAULT 1;

    2. Modify link.php (in libs folder as follows):
    a. add var $clicks = 1; just after var $current_user_reports = 0;
    b. replace this:
    $db->query("UPDATE " . table_links . " set link_summary='$link_summary', link_title_url='$link_title_url', link_url='$link_url', link_url_title='$link_url_title', link_title='$link_title', link_content='$link_content', link_tags='$link_tags', link_field1='$link_field1', link_field2='$link_field2', link_field3='$link_field3', link_field4='$link_field4', link_field5='$link_field5', link_field6='$link_field6', link_field7='$link_field7', link_field8='$link_field8', link_field9='$link_field9', link_field10='$link_field10', link_field11='$link_field11', link_field12='$link_field12', link_field13='$link_field13', link_field14='$link_field14', link_field15='$link_field15', clicks='$clicks' WHERE link_id=$this->id");
    with the $db->query you have in the store function. or alternatively just include ,clicks='$clicks' after $link_field15 in the $db->query function in the store function.
    c. In the read function look for if($link) and at the end of it where you have $this->link_summary = $link->link_summary; include $this->clicks = $link->clicks; just below it.
    d. In read_basic function replace the $db->get_row.... by $db->get_row("SELECT link_author, link_status, link_randkey, link_category, link_date, link_votes, link_karma, link_published_date, clicks FROM " . table_links . " WHERE link_id = $id"))) OR simply append , clicks to $db->get row just after link_published_date
    e. add $this->clicks=$link->clicks; just after $this->published_date=unixtimestamp($date); still in read_basic
    f. add this entry : $smarty->assign('clicks', $this->clicks); just after $smarty->assign('link_category', $this->category_name());
    That is all for that file

    3. Open out.php in your pliggroot directory. include this:
    $db->query("UPDATE " . table_links . " SET clicks = clicks + 1 WHERE link_id = " . $id); just before header("HTTP/1.1 301 Moved Permanently");

    4. open up link_summary.tpl in your templates directory and include this:
    <span class="clicks">
    Views : {$clicks}
    </span>
    where you want the clicks to be displayed. In your css fine you can define how it should look by creating an entry class clicks and defining it.

    Well, that is about it. As I said this is my solution. I am certain there can be an optimized version, but this method does get things to work. Remember you can check it out at www.meshedlinks.com

    Am working on displaying and viewing links by votes. So for instance you have a tab at the top that says top links by votes or upcoming links by votes, if you get what I mean.

    If you have any questions don't hesitate to post them.

  9. #9
    Constant Pligger P1mpPanther's Avatar
    Joined
    Feb 2007
    Posts
    277
    Thanks
    Received:0
    Given: 0
    looks like you and gary have been working on the same thing, but how cool that there are two different ways to implement. thanks ozo

  10. #10
    Casual Pligger Genghis's Avatar
    Joined
    Mar 2007
    Posts
    57
    Thanks
    Received:0
    Given: 0
    How can you alter this mod so that it not ONLY registers Title URL clicks, but also the 'read more' clicks that link to story.php?

    I ask this question because no clicks register for editorials (posts with no URLs).

    Thanks.

Page 1 of 5 123 ... LastLast

Similar Threads

  1. [mod] count clicks instead of votes
    By abcdefgary in forum Questions & Comments
    Replies: 7
    Last Post: 03-15-2013, 06:47 AM
  2. Clicks instead of Votes (Again)
    By KevinChristman in forum Questions & Comments
    Replies: 4
    Last Post: 05-05-2011, 11:04 PM
  3. Counting Clicks instead of Votes
    By kahunabear in forum Questions & Comments
    Replies: 14
    Last Post: 11-21-2010, 05:57 PM
  4. News based on Clicks instead of Votes
    By mde05 in forum Questions & Comments
    Replies: 2
    Last Post: 01-14-2008, 05:32 AM
  5. Registering Clicks instead of Votes
    By kahunabear in forum Questions & Comments
    Replies: 2
    Last Post: 02-01-2007, 03:50 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Pligg Modules and Pligg Templates from Pligg Pro Web Hosting Services by Midphase Dreamhost Web Hosting Donate to Pligg