My EVB

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-20-2007, 10:14 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Code last updated: 19th July, 2007 - adding missing quotes

This is a re-make of the pligg External Vote Button. Includes configurable multiple target urls, and automatic voting for logged in users. Demo here. Instructions are included in the attachment, and below:

INSTALLATION:

1.) Transfer the "upload" directory to your pligg root folder. Delete the default evb directory first.
2.) Open up button.php and configure the variables $server, $url_mod - each variable is commented
3.) Open up url.php and configure the variables $web1, $web2, $db_table, $server - each variable is commented

USAGE:

(a) Standard Method - display one instance of the button on a single web page:

Code:
<script type="text/javascript" src="http://domain.com/evb/button.php"></script>
(b) Advanced Method - display single or multiple buttons on a page, each pointing to a different target url:

Code:
<script type="text/javascript">submit_url = 'http://www.targeturl.com';</script>
<script type="text/javascript" src="http://domain.com/evb/button.php"></script>
The advanced method is good for blogs and other sites that display link to multiple stories / pages on the same web page. For example, if using Wordpress, you can configure the submit_url to use the permalink in the front page template.

If using Wordpress, you will need to add the javascript directly to the template files through FTP, and not just use the admin template editor, which seems to strip out javascript.

If you want to change what the button does, simply open up url.php and edit the html that makes up the button display, at the bottom of the file.
Attached Files
File Type: zip evb.zip (5.1 KB, 1119 views)

Last edited by Simon; 07-19-2007 at 01:23 PM.
Reply With Quote
  #2 (permalink)  
Old 03-21-2007, 08:35 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Added an auto-voting config option in url.php - set it to 1 to let people vote from other sites. Same principle as for the main site: (1) if logged in, you can vote if you haven't already done so (2) if anonymous voting allowed, anyone can vote if they haven't already done so.

Download and usage instructions in the post above. You can try out the auto-vote functionality here. Remember, if you use this, you must have anonymous voting set to true if you want anyone to be able to vote, otherwise only those who are logged into the pligg site can vote using the EVB.

Last edited by Simon; 03-26-2007 at 01:17 PM.
Reply With Quote
  #3 (permalink)  
Old 03-21-2007, 09:32 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
I've just updated the vote button in the 1st post - it should now work without requiring an id when using multiple buttons, I also got rid of a javascript function that was slowing down the display.

I'll clean up the auto-vote code next and get that posted in a few minutes.
Reply With Quote
  #4 (permalink)  
Old 03-21-2007, 09:37 PM
kbeeveer46's Avatar
Pligg Developer/Admin
Pligg Version: 0
Pligg Template: none
 
Join Date: Jun 2006
Location: Muncie, Indiana
Posts: 3,215
Thanks for all of this. I've saved it for this weekend when I will look at it.
Reply With Quote
  #5 (permalink)  
Old 03-21-2007, 09:50 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Quote:
Originally Posted by kbeeveer46 View Post
Thanks for all of this. I've saved it for this weekend when I will look at it.
No problem.

Auto-vote button (2nd post) also updated, instructions still the same as in the 1st post - you can try out a demo of the functionality here.

Last edited by Simon; 03-21-2007 at 09:57 PM.
Reply With Quote
  #6 (permalink)  
Old 03-23-2007, 10:39 AM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Apparently the (anonymous) voting isn't working on IE6 - could anyone confirm this for me? And for IE7 too if possible!

I hate Internet Explorer....
Reply With Quote
  #7 (permalink)  
Old 03-23-2007, 12:24 PM
New Pligger
 
Join Date: Jan 2007
Posts: 20
I all over again used anonymous voting on the site. A week later I have switched to voting only for registered at the request of users who want to see who has voted for article.
For what anonymous voting is necessary in general?
On all Digg-like sites voting after registration is necessary.
Reply With Quote
  #8 (permalink)  
Old 03-23-2007, 12:29 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
I won't personally be using anonymous voting later on, but if some people want that functionality then fair enough.
Reply With Quote
  #9 (permalink)  
Old 03-25-2007, 03:19 AM
Iceburg's Avatar
Pligg Donor
 
Join Date: Sep 2006
Posts: 79
Send a message via ICQ to Iceburg Send a message via AIM to Iceburg Send a message via MSN to Iceburg Send a message via Yahoo to Iceburg
I think there is a problem wtih the mod, it seems to almost work.

In the URL: http://news.oioplus.com/test1.php as the test that the op set up, if I click on the button, then the image changes to the top left part of news.oioplus.com. Image:



So I installed thinking there was a clitch, I edited the button to be what I wanted, and the exact same thing happens to me. Image:



My link is: http://www.feedthebull.com/evb/ Try it out, and you'll see.

It looks like the anonymous vote works, but if you click on the link it assume the button is a frame instead of opening the URL in a new window.

Last edited by Iceburg; 03-25-2007 at 03:27 AM.
Reply With Quote
  #10 (permalink)  
Old 03-25-2007, 06:08 PM
Constant Pligger
 
Join Date: Mar 2006
Posts: 537
Thanks for that, seems to be a bug that displays in IE. I'll have another look at it soon.

Unfortunately I can't seem to replicate the error in IE6 right now, but you could try replacing the current javascript in url.php with the following, to see if it helps:

Code:
<script type="text/javascript">
<!--
function refresh(){
    setTimeout("path()", 500);
}
function path(){
    var sURL = '<?php echo $server ?>/evb/url.php?url=<?php echo $url; ?>';
    window.location.replace( sURL );
}
//-->
</script>

Last edited by Simon; 03-25-2007 at 06:57 PM.
Reply With Quote
Reply

Thread Tools
Display Modes




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