![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| 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?
|
| |||
|
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.
|
| |||
|
That's a great idea. I would like to use that feature as well.
|
| ||||
|
hmmm, figured someone would have responded to this by now. anyone?
__________________ RunStream :: RSS feed creator | RSS Marketing Platform | TagBlast! ...and a Pligg site on deck! |
| |||
|
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.
__________________ Paper Crafts - All About Papers -- iWantTo - What do you want today? -- ToyRating - It's All About Toys -- RIA Forum for RIA Hobbyist |
| |||
|
im not sure I understand what you guys are trying to do. are you guys trying to count the number of times a user clicks on the story link and eliminate the vote box? if this is what you guys are trying to do, there is a way to do this ( i think ). but i'll wait for someone to answer if im on the right path before sharing my thought. |
| ||||
|
hey gary - thats how i understand it as well. clicks for a story (or essentially views) will advance the vote counter.
__________________ RunStream :: RSS feed creator | RSS Marketing Platform | TagBlast! ...and a Pligg site on deck! |
| |||
|
well, you see, if you guys want to achieve this. it should be extremely easy. it only involves taking the url for the vote button (the one that says: "VOTE") to the story article link. the only downside to this is that if people linked from another website to one of your pligg stories, the vote would not be counted because, technically, they didn't click on that story, instead, they entered the url and jumped directly to the story. if you get my drift. if people really want this piece of easy modification, then i can post the steps to doing this here. |
| |||
| 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.
__________________ Meshedlinks - Africa Web 2.0 Bookmarking Service Africa's top web 2.0 social bookmarking community presenting the best links from across the continent |
| The Following 3 Users Say Thank You to ozo For This Useful Post: | ||
![]() |
« Previous Thread
|
Next Thread »
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [mod] count clicks instead of votes | abcdefgary | Modification Tutorials | 8 | 06-14-2008 11:34 PM |
| News based on Clicks instead of Votes | mde05 | Modification Tutorials | 2 | 01-14-2008 08:32 AM |
| users total votes? | inggenia | General Help | 2 | 07-09-2007 07:44 AM |
| Counting Clicks instead of Votes | kahunabear | Modification Tutorials | 13 | 04-03-2007 09:18 AM |
| Registering Clicks instead of Votes | kahunabear | General Help | 2 | 02-01-2007 06:50 PM |




Linear Mode

