Ajax dialog if user tries to vote without being logged in (digg-like)

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #11 (permalink)  
Old 12-02-2006, 04:17 PM
New Pligger
 
Join Date: Oct 2006
Posts: 2
We would like to know the code that makes available this fantastic mod in a pligg web. It looks like digg when you try to vote unregistered, it's a fantastic mod!

Can you share the code with us?

Thanks and congratulations!








Quote:
Originally Posted by elder View Post
Hello.

I'm working at a digg-like addon for my site that will popup an ajax login box if the user tries to vote without being logged in (rather than redirecting to login.php). Technically, it's Thickbox with minor modifications.

Now, I kind of need some help. In link_summary.tpl, after the line:
Code:
<li class="menealo" id="mnmlink-{$link_shakebox_index}">
I pasted the following line:
Code:
{if $user_authenticated ne true} {* show only if NOT logged in *}
then my thickbox code, which is nothing more than changing the "javascript:{$link_shakebox_javascript_vote}" thingie into an URL, and I thought it would work. The good news is that if I try to vote and I'm logged out, it works. It pops the ajax dialog. The bad news is that it does the same thing even when logged in. What the heck am I missing here? I spent the last 4 hours figuring this out (no, I'm not a pro) and still no results.

The website is www.wowtick.com (world of warcraft related). Right now it's live, so the buttons are on "default" (no ajax-thickbox-thingie). If you want to see the dialog, there's a "Test" link in the site's footer.

Thanks in advance.
Reply With Quote
  #12 (permalink)  
Old 12-02-2006, 07:45 PM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Quote:
Originally Posted by airsparrow View Post
We would like to know the code that makes available this fantastic mod in a pligg web. It looks like digg when you try to vote unregistered, it's a fantastic mod!

Can you share the code with us?

Thanks and congratulations!
Well, as I said before, it's not my code, it's an open source java script that I blended into my site. The script is called Thickbox.

On the page you'll find instructions about installing it on your server and whatnot. I used the "Ajax content" example.

What I did to implement it in pligg was:

1. I created a login.html page that contains the normal login form of the Pligg site.
2. Following the Thickbox instructions, I got a link that looks like this one: http://www.mysite.com/login.html?height=200&width=400
Note that the "?height=200&width=400" is for the Ajax box's dimensions. Oh, and in the code, you need to have class="thickbox" on the link you want to trigger the box
3. I replaced the "Vote" link (menealo(blahblah) for the unregistered users with my own, by adding something like this in "link_summary.tpl", between " {if $Voting_Method eq 1}" (should be line 2) and its respective {/if}:
Code:
<ul class="news-shakeit">
			<li class="mnm-published" id="cat{$category_id}"><a id="mnms-{$link_shakebox_index}" href="{$story_url}">{$link_shakebox_votes}</a></li>
			<li class="menealo" id="mnmlink-{$link_shakebox_index}">
			{if $user_logged_in eq ""} {* show only if NOT logged in *}
					<a href="http://www.mysite.com/login.html?height=200&width=400" class="thickbox">{#PLIGG_Visual_Vote_For_It#}</a>
			{else}
				{if $link_shakebox_currentuser_votes eq 0}
					<a href="javascript:{$link_shakebox_javascript_vote}">{#PLIGG_Visual_Vote_For_It#}</a>
				{else}
					<span>{#PLIGG_Visual_Vote_Cast#}</span>
				{/if}
			{/if}
			</li>
		</ul>

Last edited by elder; 12-02-2006 at 08:08 PM.
Reply With Quote
  #13 (permalink)  
Old 12-03-2006, 04:52 PM
New Pligger
 
Join Date: Nov 2006
Posts: 20
excellent mod elder.

btw - you might want to change your tagline to "news that matters"
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vote error for users who are not logged in dgsalles Questions and Comments 1 07-22-2009 05:56 PM
[MOD] Digg like AJAX login on top of the page!! dollars5 Questions and Comments 32 04-17-2009 07:26 AM
Star Vote Problems 9.6 - 9.7 not2serious Questions and Comments 7 03-03-2008 07:00 AM
How to create a Login pop-up on Vote, like Digg abraxas Questions and Comments 1 02-26-2008 10:25 PM
User vote count shouldn't include discarded stories gragland Questions and Comments 0 07-26-2006 09:14 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