Go Back   Pligg CMS Forum > Pligg Development > Modification Tutorials

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-30-2006, 11:15 PM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Thanks: 2
Thanked 2 Times in 1 Post
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
  #2 (permalink)  
Old 11-30-2006, 11:17 PM
AshDigg's Avatar
Coder
 
Join Date: Dec 2005
Posts: 1,574
Thanks: 235
Thanked 345 Times in 206 Posts
{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
Thanks: 2
Thanked 2 Times in 1 Post
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
Thanks: 235
Thanked 345 Times in 206 Posts
How about this....

{if $user_logged_in neq ""}
__________________
- Ash
Reply With Quote
The Following User Says Thank You to AshDigg For This Useful Post:
  #5 (permalink)  
Old 11-30-2006, 11:24 PM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Thanks: 2
Thanked 2 Times in 1 Post
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
Thanks: 235
Thanked 345 Times in 206 Posts
Well just change it!

{if $user_logged_in eq ""}


(removed the "n")
__________________
- Ash
Reply With Quote
The Following 2 Users Say Thank You to AshDigg For This Useful Post:
  #7 (permalink)  
Old 11-30-2006, 11:27 PM
New Pligger
 
Join Date: Nov 2006
Posts: 6
Thanks: 2
Thanked 2 Times in 1 Post
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
Thanks: 235
Thanked 345 Times in 206 Posts
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
Thanks: 235
Thanked 345 Times in 206 Posts
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
Thanks: 2
Thanked 2 Times in 1 Post
I'm officially ashamed of myself for that. It's solved now.
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

BB 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
Star Vote Problems 9.6 - 9.7 not2serious Bug Report 7 03-03-2008 06:00 AM
How to create a Login pop-up on Vote, like Digg abraxas General Help 1 02-26-2008 09:25 PM
[MOD] Digg like AJAX login on top of the page!! dollars5 Modification Tutorials 30 02-16-2008 07:00 AM
user gets logged out afte password change unohoo General Help 0 10-02-2006 08:31 PM
User vote count shouldn't include discarded stories gragland Bug Report 0 07-26-2006 08:14 PM


Search Engine Friendly URLs by vBSEO 3.2.0