Go Back   Pligg Forum > Pligg Development > Pligg Mods
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-20-2007, 01:45 PM
abcdefgary abcdefgary is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 236
Downloads: 5
Uploads: 0
Thanks: 20
Thanked 29 Times in 15 Posts
[mod] count clicks instead of votes

this small modification will allow pligg admins to count the clicks of the story title as votes, as requested here.

notes:
1.) when the user clicks the story title, the vote is calculated and "voted" shows up as well as disables voting again for the user, but the number of votes won't change unless you refresh the page.

2.) i don't recommend this (at all) because like I've said before, if someone places the link/url to that pligg story, the view/vote count of that story won't increase when someone opens up that url. the vote count will only increase if someone votes, or clicks the story link.

i dont recommend this! but whatever. erm, ok. here goes.

open up link_summary.tpl of your template ( I used yget 9.6 for this example) and find:

Code:
	<div class="top"> 
		<div class="toptitle" id="ls_thetitle-{$link_shakebox_index}">
			{if $use_title_as_link eq true}
				{if $url_short neq "http://" && $url_short neq "://"}
					<a href="{$url}" {if $open_in_new_window eq true} target="_blank"{/if}>{$title_short}</a>
				{else}
					<a href="{$story_url}">{$title_short}</a>
				{/if}
		     {else}
				{if $pagename eq "story"}
					<a href="{$url}">{$title_short}</a>
				{else} 
				  <a href="{$story_url}">{$title_short}</a>
				{/if}
			{/if}        
		</div>
at the bottom of that code... replace:

Code:
				{else} 
				  <a href="{$story_url}">{$title_short}</a>
				{/if}
			{/if}        
		</div>
with:

Code:
				{else} 
				 <a href="{$story_url}"{if $Voting_Method eq 1} onclick="javascript:{$link_shakebox_javascript_vote}"{/if}>{$title_short}</a>
				{/if}
			{/if}        
		</div>
Reply With Quote
The Following 5 Users Say Thank You to abcdefgary For This Useful Post:
Sponsored Links
  #2 (permalink)  
Old 06-20-2007, 01:50 PM
abcdefgary abcdefgary is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 236
Downloads: 5
Uploads: 0
Thanks: 20
Thanked 29 Times in 15 Posts
ozo has posted another method. his allows a separate count for the number of clicks to that story, while my method counts the click as a "vote".

check here: counting clicks instead of votes
Reply With Quote
  #3 (permalink)  
Old 06-20-2007, 01:53 PM
P1mpPanther's Avatar
P1mpPanther P1mpPanther is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 293
Downloads: 20
Uploads: 0
Thanks: 47
Thanked 10 Times in 9 Posts
even if i don't wind up using this, i wanted to thank gary for acknowledging the communities request and banging this out. its a 'good thing' for the forum
__________________
RunStream :: RSS feed creator | RSS Marketing Platform | TagBlast!

...and a Pligg site on deck!
Reply With Quote
  #4 (permalink)  
Old 06-20-2007, 03:02 PM
harlem harlem is offline
Send a message via Skype™ to harlem
Casual Pligger
 
Join Date: Mar 2007
Location: Salem, Oregon
Posts: 52
Downloads: 29
Uploads: 0
Thanks: 18
Thanked 0 Times in 0 Posts
Will this work with earlier version of Pligg. Im still using 9.1. I hope it does this would be perfect.
Reply With Quote
  #5 (permalink)  
Old 06-20-2007, 04:03 PM
abcdefgary abcdefgary is offline
Constant Pligger
 
Join Date: Feb 2007
Posts: 236
Downloads: 5
Uploads: 0
Thanks: 20
Thanked 29 Times in 15 Posts
Quote:
Originally Posted by harlem View Post
Will this work with earlier version of Pligg. Im still using 9.1. I hope it does this would be perfect.
well, I don't know because I have no idea where I can download earlier versions of Pligg.

But yes, I think this will work. But I like ozo's modification better since the view count is separate from the voting. but it's your choice which one to use.
Reply With Quote
  #6 (permalink)  
Old 06-20-2007, 11:50 PM
jc007 jc007 is offline
Casual Pligger
 
Join Date: Mar 2007
Posts: 75
Downloads: 84
Uploads: 0
Thanks: 9
Thanked 0 Times in 0 Posts
Great mod, thanks!

However, would recommend instead of using

This
{else}
<a href="{$story_url}"{if $Voting_Method eq 1} onclick="javascript:{$link_shakebox_javascript_vot e}"{/if}>{$title_short}</a>
{/if}
{/if}
</div>

I recommend this
{else}
<a href="{$story_url}"{if $Voting_Method eq 1 && $link_shakebox_currentuser_votes eq 0 && $link_shakebox_currentuser_reports eq 0} onclick="javascript:{$link_shakebox_javascript_vot e}"{/if}>{$title_short}</a>
{/if}
{/if}
</div>


This will about getting the popup saying that the story is already voted
Reply With Quote
  #7 (permalink)  
Old 02-29-2008, 11:54 AM
SemiLOOSE SemiLOOSE is offline
New Pligger
 
Join Date: Feb 2008
Posts: 10
Downloads: 1
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
will this work with 9.9.0?

not working on my site..

tamil+ / Published News
Reply With Quote
  #8 (permalink)  
Old 03-28-2008, 06:48 PM
BHealth BHealth is offline
New Pligger
 
Join Date: Mar 2008
Posts: 4
Downloads: 0
Uploads: 0
Thanks: 0
Thanked 0 Times in 0 Posts
worked for me mostly

hey loose,

It worked on my site. There are a few little things that you have to take care of. If you copy and paste, you have to make sure that you post the word "vote" as one word, not as "vot" (space) "e" which can happen due to the line break in the post.

Also you have to paste the code into 5 different places, not one as implied above. You have to paste the code to replace the three other similar spaces directly above (the <a> links with either $url or $story_url). You will then have to adjust the code you are pasting ($url is either remains $url or changes to $story_url accordingly). Then you have to look down the page into the section for newly submitted stories, and paste the code once there, replacing a similar piece of code.

Hope this helps, I know the examples aren't illustrated as clearly as possible, but it should be enough to get you past this little bump in devel.


B
medicalschoolresources.com
Reply With Quote
  #9 (permalink)  
Old 06-14-2008, 10:34 PM
sach4isha sach4isha is offline
New Pligger
Pligg Version: 9.9
Pligg Template: starnews
 
Join Date: Dec 2007
Posts: 19
Downloads: 19
Uploads: 0
Thanks: 1
Thanked 0 Times in 0 Posts
hey thanks for this

but I saw that the mod only counts register users vote not others can someone help me out
Reply With Quote
Reply



Thread Tools
Display Modes
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Similar Threads
Thread Thread Starter Forum Replies Last Post
counting clicks instead of votes lumpen5 Pligg Mods 41 01-04-2008 04:47 PM
Query count - logged in vs not logged in? Simon Core Development 7 04-05-2007 11:19 PM
Counting Clicks instead of Votes kahunabear Pligg Mods 13 04-03-2007 08:18 AM
Registering Clicks instead of Votes kahunabear General Help 2 02-01-2007 05:50 PM
Count script. LG-2 Pligg Mods 6 10-10-2006 01:19 AM


LinkBacks Enabled by vBSEO 3.0.0