Quote:
Originally Posted by airsparrow 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>