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

Register an Account
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 12-01-2006, 12:15 AM
New Pligger
 
Join Date: Nov 2006
Posts: 6
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
  #2 (permalink)  
Old 12-01-2006, 12:17 AM
AshDigg's Avatar
Mayor of PliggVille/Coder
 
Join Date: Dec 2005
Posts: 1,515
{if $user_authenticated neq true}

maybe?
Reply With Quote
  #3 (permalink)  
Old 12-01-2006, 12:19 AM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Tried that, no luck.
Reply With Quote
  #4 (permalink)  
Old 12-01-2006, 12:20 AM
AshDigg's Avatar
Mayor of PliggVille/Coder
 
Join Date: Dec 2005
Posts: 1,515
How about this....

{if $user_logged_in neq ""}
Reply With Quote
  #5 (permalink)  
Old 12-01-2006, 12:24 AM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Now it's exactly the opposite: logged in users get the ajax, guests get the menealo(...) link.

Edit: I tried {if $user_logged_in eq ""} (it seemed the obvoius choice) and it seems to work fine. If I don't find anything wrong, I'll confirm. Thanks a lot, AshDigg!
Reply With Quote
  #6 (permalink)  
Old 12-01-2006, 12:26 AM
AshDigg's Avatar
Mayor of PliggVille/Coder
 
Join Date: Dec 2005
Posts: 1,515
Well just change it!

{if $user_logged_in eq ""}


(removed the "n")
Reply With Quote
  #7 (permalink)  
Old 12-01-2006, 12:27 AM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Done that just before refreshing the thread here. Seemed the obvious choice. Thanks a lot, Ash, it works.

(And forgive the ones not so savvy)
Reply With Quote
  #8 (permalink)  
Old 12-01-2006, 12:28 AM
AshDigg's Avatar
Mayor of PliggVille/Coder
 
Join Date: Dec 2005
Posts: 1,515
No prob.

The next version of pligg comes with Leightbox. What I like about that is that the cursor will blink when you're in a textbox. I didn't at first realize that I could type in those textboxes.
Reply With Quote
  #9 (permalink)  
Old 12-01-2006, 12:35 AM
AshDigg's Avatar
Mayor of PliggVille/Coder
 
Join Date: Dec 2005
Posts: 1,515
I like the site, but theres no mention of pligg. Wheres the love!?
Reply With Quote
  #10 (permalink)  
Old 12-01-2006, 12:40 AM
New Pligger
 
Join Date: Nov 2006
Posts: 6
I'm officially ashamed of myself for that. It's solved now.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[MOD] Digg like AJAX login on top of the page!! dollars5 Questions and Comments 34 01-28-2011 01:18 AM
Vote error for users who are not logged in dgsalles Questions and Comments 1 07-22-2009 05:56 PM
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