Pligg CMS Forums


Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials



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

Advanced Tutorials for Modifying your Pligg site


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-30-2006, 11:15 PM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Ajax dialog if user tries to vote without being logged in (digg-like)

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
Sponsor
  #2 (permalink)  
Old 11-30-2006, 11:17 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
{if $user_authenticated neq true}

maybe?

- Ash
Reply With Quote
  #3 (permalink)  
Old 11-30-2006, 11:19 PM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Tried that, no luck.
Reply With Quote
  #4 (permalink)  
Old 11-30-2006, 11:20 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
How about this....

{if $user_logged_in neq ""}

- Ash
Reply With Quote
  #5 (permalink)  
Old 11-30-2006, 11:24 PM
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 11-30-2006, 11:26 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
Well just change it!

{if $user_logged_in eq ""}


(removed the "n")

- Ash
Reply With Quote
  #7 (permalink)  
Old 11-30-2006, 11:27 PM
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 11-30-2006, 11:28 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
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.

- Ash
Reply With Quote
  #9 (permalink)  
Old 11-30-2006, 11:35 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
I like the site, but theres no mention of pligg. Wheres the love!?

- Ash
Reply With Quote
  #10 (permalink)  
Old 11-30-2006, 11:40 PM
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 Modification Tutorials 32 04-17-2009 06:26 AM
How to create a Login pop-up on Vote, like Digg abraxas General Help 1 02-26-2008 09:25 PM
user gets logged out afte password change unohoo General Help 0 10-02-2006 08:31 PM

Pligg Modules and Pligg Templates from Pligg Pro Find support on the Pligg CMS Forum - 24 hours a day! Use the coupon code PLIGG at Dreamhost.com to receive a discount of up to $84.00 Make a donation to support Pligg CMS development