External Vote Button (EVB)

Register an Account
Pligg Chat Room
Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-31-2006, 02:56 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 3,791
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
Demo Page

NOTE: This mod will be available with Pligg Beta 6, which I expect to have some type of version prepared by this weekend. You can not use this mod without the files that will be included with the next release, this is only for demonstrating purposes right now.

External Vote Button (EVB)

This vote button will allow you to create a vote link to an article automatically. The vote url is directed to the page the button appears on, so you will want to make sure that it appears only in the individual articles, not the archives. Once the first vote is cast it will change the "cast vote" image to "vote cast" and redirect clicks to the pligg article url. Technically you could just insert the html/php into your site's template so the vote button appears on every page and each page would be counted as seperate submissions. I'm not 100% sure if this is possible, but I believe that it could work this way.

Images used:


How to add an External Vote Button:
Add this code to a HTML enabled blog post or article where you want the vote button to appear:
HTML Code:
 <script type="text/javascript" src="http://domain.com/api/check_url.js"></script> 
Replace domain.com with your own domain where a Pligg install exists. If you wish to test a domain, try scadart.com and it should work.
For PHP pages:

PHP Code:
<?php 
         
include('../config.php');
          echo 
'<script type="text/javascript" src="http://domain.com/api/check_url.js.php"></script>';
         
?>
or if you want to use the vote button only on your own domain...

PHP Code:
<?php 
         
include('../config.php');
          echo 
'<script type="text/javascript" src="http://'.get_server_name().'/api/check_url.js.php"></script>';
         
?>
See anexample of a PHP vote image here.
Download the PHP example here. Make sure to rename it from phpvote.phps to phpvote.php
Attached Images
File Type: psd add-01.psd (152.0 KB, 527 views)
File Type: psd over-01.psd (152.8 KB, 298 views)
File Type: psd vote-01.psd (152.3 KB, 327 views)

Last edited by Yankidank; 02-24-2007 at 01:32 AM.
Reply With Quote
  #2 (permalink)  
Old 01-31-2006, 03:37 PM
Constant Pligger
 
Join Date: Jan 2006
Posts: 189
awsome! I was gonna mod somethign like this myself looks sweet dude!
Reply With Quote
  #3 (permalink)  
Old 01-31-2006, 06:45 PM
Casual Pligger
 
Join Date: Dec 2005
Posts: 56
Will you be able to release the photoshop or original file so we can change colors easily? As I said in IRC, it looks awesome and I'll definetly be using it!
Reply With Quote
  #4 (permalink)  
Old 01-31-2006, 07:36 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 3,791
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
I have included the photoshop files to the top post. The text requires the "Trebuchet MS" font, which I think is standard with Windows installations. Changing the text and color should only take about a minute for each image. The quickest way is probably Image->Adjustments->Hue/Saturation and just playing with the sliders until you get a nice color. Just a quick tip to help Photoshop noobies.
Reply With Quote
  #5 (permalink)  
Old 02-01-2006, 08:35 AM
Casual Pligger
 
Join Date: Jan 2006
Posts: 31
i like this , well done Yankidank
Reply With Quote
  #6 (permalink)  
Old 02-01-2006, 01:04 PM
Pligg Donor/Designer
 
Join Date: Jan 2006
Posts: 103
It would be great if the code was being generated automatically when the person submits a story so that he can just copy/paste it.
Reply With Quote
  #7 (permalink)  
Old 02-02-2006, 07:18 PM
Casual Pligger
 
Join Date: Jan 2006
Posts: 56
Great, well done
Reply With Quote
  #8 (permalink)  
Old 03-17-2006, 12:38 PM
New Pligger
 
Join Date: Feb 2006
Posts: 19
Hi

This works fantastic. Just what I wanted. Its all shaping up nicely.

Andy
Reply With Quote
  #9 (permalink)  
Old 03-17-2006, 02:45 PM
Yankidank's Avatar
Pligg Founder/Coder/Designer
Pligg Version: SVN
Pligg Template: Wistie
 
Join Date: Dec 2005
Location: Ocala, FL
Posts: 3,791
Send a message via AIM to Yankidank Send a message via Skype™ to Yankidank
I forgot to mention this with the Beta 6 release, but the EVBs are included in the /api directory. You can check http://yourdomain.com/api/evb.html for an example of it and instructions. You will have to edit 1 or two files in the api directory to point to your domain.

Now Available: Facebook Connect Module !
Reply With Quote
  #10 (permalink)  
Old 03-23-2006, 08:37 PM
New Pligger
 
Join Date: Feb 2006
Posts: 19
Hi

Now that I have used this a little I have found a small bug.

When an article has already been pligged then it works great. It shows the number of votes and takes you to the pligg story, as it should.

When you are a member and logged onto Pligg then the button goes to the submit page as it should, prefilling the fields etc.

But..

When you are not logged in clicking the pligg button results in a 404 as the url goes a bit wrong. It attempts to take you to the login screen but appends the url and therefore doesn't work.

Is this an easy fix?

Andy
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vote button not updating dynamically aufotookbigfoot Questions and Comments 5 04-18-2008 04:16 PM
External Vote Button and Google mankal Questions and Comments 1 03-27-2008 12:27 PM
Need help with External Vote Button Please! bbrian017 Questions and Comments 10 01-30-2008 06:28 PM
External Vote Button Bug pornlord Questions and Comments 4 05-15-2007 10:59 AM
Vote button links to story page after voted canadaka Questions and Comments 1 04-02-2007 12:12 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