counting clicks instead of votes

Register an Account
Reply
 
Thread Tools Display Modes
  #11 (permalink)  
Old 06-20-2007, 06:30 PM
Genghis's Avatar
Casual Pligger
 
Join Date: Mar 2007
Posts: 57
I'm talking about the one that ozo posted.

I think I have to mod something in link.php...but can't quite put my finger on it.
Reply With Quote
  #12 (permalink)  
Old 06-21-2007, 03:03 PM
ozo ozo is offline
Casual Pligger
 
Join Date: Jan 2007
Posts: 50
Hey thanks this is one thing I left out that is nice.

Add this code segment to story.php in your root pligg directory

//Update number of clicks here
$db->query("UPDATE " . table_links . " SET clicks = clicks + 1 WHERE link_id = " . $id);

before:
// log the pageview
$pageview = new Pageview;
$pageview->type='story';
$pageview->page_id=$link->id;
$pageview->user_id=$current_user->user_id;
require_once(mnminclude.'check_behind_proxy.php');
$pageview->user_ip=check_ip_behind_proxy();

That should do the trick. Cheers!
Reply With Quote
  #13 (permalink)  
Old 06-21-2007, 03:10 PM
P1mpPanther's Avatar
Constant Pligger
 
Join Date: Feb 2007
Posts: 277
Hey Ozo, is this bit of code missing from your original post or is this in response to Genghis?

Just trying to understand what this does?
Reply With Quote
  #14 (permalink)  
Old 06-21-2007, 03:53 PM
ozo ozo is offline
Casual Pligger
 
Join Date: Jan 2007
Posts: 50
Okay this is a response to his request. I created it to count the number of clicks when it links (outs) to the story. What he wants is the number of clicks to also increase when a user clicks the "read more" link, so this is basically an add on. If you want your clicks updated in that manner add it, otherwise you can disregard that post.

Last edited by ozo; 06-21-2007 at 03:55 PM. Reason: typo
Reply With Quote
  #15 (permalink)  
Old 06-21-2007, 03:55 PM
Genghis's Avatar
Casual Pligger
 
Join Date: Mar 2007
Posts: 57
I love the ozo brain! Thanks
Reply With Quote
  #16 (permalink)  
Old 06-21-2007, 04:06 PM
P1mpPanther's Avatar
Constant Pligger
 
Join Date: Feb 2007
Posts: 277
thats what i thought - just checking.

great mod ozo
Reply With Quote
  #17 (permalink)  
Old 10-08-2007, 05:55 PM
Casual Pligger
 
Join Date: Jan 2007
Posts: 46
Quote:
Originally Posted by ozo View Post
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 @ Meshedlinks / Popular, you can see it in action. Follow this steps - however this requires that you have a little, just a little, technical knowledge:
I implemented your mod on my site and it is working perfectly... now I see on Meshedlinks / Popular you have tabs that bring up pages sorted by views, how'd you do that?

Thanks!
Pandora Stations
Reply With Quote
  #18 (permalink)  
Old 10-11-2007, 01:07 AM
Casual Pligger
 
Join Date: Jan 2007
Posts: 46
Quote:
Originally Posted by timofsuburbia View Post
I implemented your mod on my site and it is working perfectly... now I see on Meshedlinks / Popular you have tabs that bring up pages sorted by views, how'd you do that?

Thanks!
Pandora Stations
OK, it's not the same as you did, but I modified my index.php so that it sorted by clicks, saved it as clicks.php then created a tab to point to the url. Good enough for now.
Reply With Quote
  #19 (permalink)  
Old 10-11-2007, 06:52 AM
Constant Pligger
 
Join Date: Feb 2007
Posts: 226
Thanks Ozo.
This feature seems nice but is it possible to use this if outlinks are disabled. If outlinks are disabled then the out.php is not in use and counting doesn't work. Could the out.php part be inserted to some other file?
Reply With Quote
  #20 (permalink)  
Old 10-11-2007, 02:53 PM
New Pligger
 
Join Date: Oct 2007
Posts: 10
there is a problem with this mod.

when someone comments a link, it will RESET the count db and it will become 0 again.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Counting Clicks instead of Votes kahunabear Questions and Comments 14 11-21-2010 09:57 PM
[mod] count clicks instead of votes abcdefgary Questions and Comments 6 06-15-2008 12:34 AM
News based on Clicks instead of Votes mde05 Questions and Comments 2 01-14-2008 09:32 AM
users total votes? inggenia Questions and Comments 2 07-09-2007 08:44 AM
Registering Clicks instead of Votes kahunabear Questions and Comments 2 02-01-2007 07:50 PM


Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Make a donation to support Pligg CMS development