Hi ;)
Congrats on getting the EVB going!

If you don't mind, I'll do the honours of posting the first feature request ;)

Please backport this to 5x for the poor souls who will be stuck with a live Drigg sites and will not be able to upgrade for many-many months to come.

I know that Merc said that he was planning to backport this. So here we are.

thanks

CommentFileSizeAuthor
#7 drigg_external.zip22.61 KBtaqwa

Comments

Andrew Cullison’s picture

I second the 5x backport request. I can't help test the module until I can activate it in a 5x install.

PGiro’s picture

Status: Active » Closed (won't fix)

I'm giving it a shot. There will be a snapshot release for D5 tomorrow, I have fixed the .info and .module file to work with D5 but I'm afraid the way templating is done is going to be totally broken.

I can't afford to spend any time on this. If someone can send me a patch,I will roll it in and release it

drupalina’s picture

I didn't mean it as a matter of urgency.
I think the priority should be to get it to work properly, fast and efficiently in 6x, and only then backport it ;)

wwwoliondorcom’s picture

Hi,

Any update about Drupal 5 backport?

Thanks.

taqwa’s picture

We've gotten a backport working on our site and, God willing, I will upload it later tonight.

PGiro’s picture

Version: 6.x-1.x-dev » 5.x-1.x-dev
Status: Closed (won't fix) » Active

@Lukas2000 : that's great, please post it here and I will commit it to the 5.x HEAD branch so that more people can test it (thse that don't read issue queues!).

taqwa’s picture

StatusFileSize
new22.61 KB

Attached is the drupal 5 backport. We actually changed a few things around for our site (which I reversed). What this means is that there's a slight possibility that this module might not work. Let me know if that happens.

You will also need to add the following code to your template.php file:

function phptemplate_drigg_external_button_vote($node = NULL, $widget_html = NULL) {
  // Pass to phptemplate, including translating the parameters to an associative array.
  // The element names are the names that the variables
  // will be assigned within your template.
  return _phptemplate_callback('drigg_external_button_vote', array('node' => $node, 'widget_html' => $widget_html));
}

function phptemplate_drigg_external_button_add($link = NULL) {
  // Pass to phptemplate, including translating the parameters to an associative array.
  // The element names are the names that the variables
  // will be assigned within your template.
  return _phptemplate_callback('drigg_external_button_add', array('link' => $link));
 
}
PGiro’s picture

Status: Active » Needs review

Thanks for your contribution I've commited your file to the 5.x SNAPSHOT release, I'll be waiting for some feedback before making an official release including some changes I made and the WP plugin

gaba’s picture

I followed your directions, but after loader I received: PHPTemplate was instructed to override the drigg_external_button_vote theme function, but no valid template file was found.
I have 2 drigg_exteral php files into my theme folder.
I changed template file following your directions.

Thanks.

alliax’s picture

subscribing so that whenever it's ready I will not have totally forgotten about it.

taqwa’s picture

try putting this in your template.php instead:

function phptemplate_drigg_external_button_vote($node = NULL, $widget_html = NULL) {
  // Pass to phptemplate, including translating the parameters to an associative array.
  // The element names are the names that the variables
  // will be assigned within your template.
  return _phptemplate_callback('drigg-external-button-vote', array('node' => $node, 'widget_html' => $widget_html));
}

function phptemplate_drigg_external_button_add($link = NULL) {
  // Pass to phptemplate, including translating the parameters to an associative array.
  // The element names are the names that the variables
  // will be assigned within your template.
  return _phptemplate_callback('drigg-external-button-add', array('link' => $link));

}
laperla’s picture

Subscribing as well. Can't wait for a working D5 voting button ;D

gaba’s picture

Everything is working now. Thank you veeery much.

You can see how EVB works here: http://webhr.blogspot.com/2008/12/atento-i-iskon-potpisali-sporazum-o.html
My Drigg site is www.novina.com

PGiro’s picture

great ! I will make a version in the close future and synchronize 6.x and 5.x.

In the meantime, everyone can use the snapshot release

laperla’s picture

Gaba, thanks for your live example. Really great to see it working on an actual site!

Sorry to be asking something unrelated, but there's no contact option in your profile. How did you get the post to Twitter link to show up for each node?

gaba’s picture

I just activated module: http://drupal.org/project/tweet

yossilac’s picture

I have installed the 5.x version, but after enabling the module I got the following error -

Parse error: syntax error, unexpected $end in /home/yossilac/public_html/drigg/drupal-5.12/sites/all/modules/drigg_external/drigg_external.module on line 163

Any thoughts?

graphicsguru’s picture

@ yossilac
add 1 more } to the drigg_external.module

so it ends with

}
}

Andrew Cullison’s picture

I have the module loaded. I pasted in the code from Lukas2000's post #7. I had the problem that yossilac had, and graphicsguru's response fixed it for me.

Now I have to configure the button. I'll report back when I get it working.

Andrew Cullison’s picture

UPDATE:
I've got the button up and working on a couple of test sites, but only the ADD feature works. Once the site has been added, instead of getting vote up/down options - I get the following error

Widget error cannot eval following PHP : extra_voting_forms_show_form($node,'n',3);

PGiro’s picture

The answer is here #337248: Widget error cannot eval following PHP : extra_voting_forms_show_form($node,'n',3);. Please report if it works on your side so I can close this thread

graphicsguru’s picture

@ Andrew Cullison

Go to drigg_user settings and add change the form values from

extra_voting_forms_show_form($node,'n',3);

to

return extra_voting_forms_show_form($node,'n',3);

Andrew Cullison’s picture

It works! Thanks @PGiro and @graphicsguru! Thanks to anyone else who put work into this module. I'm ready to pay that bounty!

yossilac’s picture

Thank you all for your help.

I've followed graphicsguru's and PGiro's advice, and it's closer to working than before.
However, in my blog, where I have added the button code, all I see is a square showing the top right corner of my drigg site (my site is right-to-left, so that is a piece of the drigg logo) and not the add this/vote button.

Any ideas as to why this is happening?

Thank you,
Yossi.

PGiro’s picture

@Andrew : great news. Concerning the bounty, that would indeed be great. Please contact me via my contact form. As I said in #199190: External Vote Button(EVB), I will give 75% to merc, the creator of Drigg.

@yossilac : more than likely, you are getting a page not found, check the content of the IFRAME HTML by resizing it or use something like Firebug to inspect into it. If it is indeed a page not found, check that the module is enabled and then check the URL created dynamically by the javascript (again with Firebug)

yossilac’s picture

@PGiro -

Indeed, I got a page not found.
Expanding the iframe, I see this address -

http://www.ladoog.co.il/drigg_external/display_button?url=http%3A//ubercart.lacoua.com/digg_test&destination=http%3A//www.ladoog.co.il/drigg_external/display_button%3Furl%3Dhttp%253A//ubercart.lacoua.com/digg_test

(where "www.ladoog.co.il" is my drigg site, and "ubercart.lacoua.com/digg_test" is a test page where the external button was put).

Using button-new.js instead of button.js does work, though.
Is there something missing on my site that causes button.js not to work?

Thanks,

Yossi.

graphicsguru’s picture

Try this
drigg-external-vote-button-for-drupal-5-install-and-configuration-tutorial

http://socialcmsbuzz.com/drigg-external-vote-button-for-drupal-5-install...

yossilac’s picture

@graphicsguru - Didn't help. The fixed version behaves exactly the same as the original one (what's the difference, anyway?).

PGiro’s picture

can you attach which button is which. Unfortunately, I have created some confusion on this since they were exchanged from one version to another. Did you change the base url parameter in both when you were testing ?

yossilac’s picture

Of course.

button-new.js (working, but only showing the first button on the page. The rest are always showing the "loading" animated gif) -

if(!window.DRIGG_EVB_i) { 
  //first time the button script is executed in the page
  function DRIGG_EVB_process_buttons() {
      DRIGG_EVB_j++;
      if (DRIGG_EVB_i==DRIGG_EVB_j)
       return;
       
      var full_url=base_url+'drigg_external/display_button?url='+escape(DRIGG_EVB_urls[DRIGG_EVB_j]);
      frames['DRIGG_EVB-'+DRIGG_EVB_j].location.href=full_url;
  }
  var DRIGG_EVB_urls=[];
  var DRIGG_EVB_i=0;
  var DRIGG_EVB_j=-1;
  var base_url="http://www.ladoog.co.il/";
  window.onload=DRIGG_EVB_process_buttons;
}
if (!window.url_site) 
  var url_site=""; 
  
DRIGG_EVB_urls[DRIGG_EVB_i]=url_site;
var div_id='DRIGG_EVB-'+DRIGG_EVB_i;
document.write('<iframe scrolling="no" allowTransparency="true" name="'+div_id+'" id="'+div_id+'" src="'+base_url+'sites/all/modules/drigg_external/loader.html" frameborder="0" style="border-color:gray;border-style:solid;border-width:0px;" scrolling="0" width="50" height="73"></iframe>');
DRIGG_EVB_i=DRIGG_EVB_i+1;
delete url_site;

button.js (not working for me at all, getting a "page not found" on the site) -


//WILL WORK ON THIS FOR THE FINAL RELEASE
var base_url="http://www.ladoog.co.il/";

//
//I'm also wondering if I can't make this work with a single call to the drupal server
//each of these button.js would add its data to a stack and register a call back on the document.load event
//then that event can get the info from the stack, batch send it to the server and a get an object back for each
//button, then populate each button with its data... ?
if (typeof DRIGG_EVB!="function")
{
  function DRIGG_EVB(counter,divId,fullUrl) {
    frames[divId].location.href=fullUrl+'&destination='+escape(fullUrl); 
  }
} 

if (!window.url_site) 
  var url_site=""; 

if(!window.DRIGG_EVB_i) 
  var DRIGG_EVB_i=0;

DRIGG_EVB_i=DRIGG_EVB_i+1; 
var full_url=base_url+'drigg_external/display_button?url='+escape(url_site);
var div_id='DRIGG_EVB-'+DRIGG_EVB_i;
document.write('<iframe scrolling="no" allowTransparency="true" name="'+div_id+'" id="'+div_id+'" src="'+base_url+'sites/all/modules/drigg_external/loader.html" frameborder="0" style="border-color:gray;border-style:solid;border-width:0px;" scrolling="0" width="50" height="68"></iframe>');
var callString="DRIGG_EVB("+DRIGG_EVB_i+",'"+div_id+"','"+full_url+"')";
setTimeout(callString,2500*DRIGG_EVB_i);

As I mentioned, button-new.js works, but only shows one button per page. The rest of the buttons, if there are, are showing the "loading" image.
As you can see, the base url has been changed in both.

One thing I didn't mention, but perhaps is relevant - I am not using drigg's path system (so a scoop's url is not www.ladoog.co.il/categoryname/title, but www.ladoog.co.il/scoop/234).

Thanks,
Yossi.

PGiro’s picture

@yossi : only the second copy-paste code works. Replace your existing button.js by that one.

As for the page not found, are you sure drigg_external is enabled ? The whole thing doesn't rely on drigg's path system but does rely on the fact the the url_site variable contains something in the URL column of table drigg_noed

yossilac’s picture

Hi @PGiro, sorry for the delay in response.

As I have said, it is the first code that works for me, but only for the single button on the page.
The second code simply does not work.

The drigg_external module is enabled, of course (when I have disabled it, the first code stopped working as well, naturally).

Yossi.

PGiro’s picture

@yossilac : yes I know the first one works but the problem with it is that only displays the first button, that's "normal" and the problem with it
The second should work, other people have reported that it does and I've been using it for weeks. So you're going to have to debug that on your own unless you give me another hint that will give me an idea of what is wrong

socialnicheguru’s picture

i am glad I found this thread. My screen went white when I installed this module (took me sometime to figure out it was this one). Now I am off to the races.

in comment 21 and 22, where do I make these changes?

PGiro’s picture

That's in the Drigg configuration at /admin/settings/drigg

bflora’s picture

I'm running into two things now that I'm not getting the white screen of death out of the box.

1. CSS - I customized my stylesheet for the External Voting Forms and now with this button it looks pretty weird. Is there a style sheet for the EVB I can use rather than being stuck using my EVF style sheet?

2. The button was working for a bit on the blog I used it on. I submitted the story just fine but now when I go back to the page I submitted, it just shows the swirling load animation forever. What could be the problem and how does one get it to stop loading all the time and actually work?

Thanks.

PGiro’s picture

@bflora :
1) are you sure that you have emptied your brower cache and that you are not caching the stylesheets server-side ? There is no style shhet for the EVB as this module entirely relies on the voting button theming mechanism.
2) Are you sure you are using the correct script ? I caused some confusion on this issue. See #30, you should be using the second. You can change the javascript so it displays the URL called on your site and then put that URL in your browser. It should display the button but if it doesn't, please tell me.
To do so, change
frames[divId].location.href=fullUrl+'&destination='+escape(fullUrl);
to
document.write('URL ='+fullUrl+'&destination='+escape(fullUrl));

jacksone’s picture

Priority: Normal » Critical

Hi i am using drigg_external button but it is not working i have uplied as given but when testing with other site it is not loading button.
I am using below function as it is any change needed with given

function phptemplate_drigg_external_button_vote($node = NULL, $widget_html = NULL) {
// Pass to phptemplate, including translating the parameters to an associative array.
// The element names are the names that the variables
// will be assigned within your template.
return _phptemplate_callback('drigg-external-button-vote', array('node' => $node, 'widget_html' => $widget_html));
}

function phptemplate_drigg_external_button_add($link = NULL) {
// Pass to phptemplate, including translating the parameters to an associative array.
// The element names are the names that the variables
// will be assigned within your template.
return _phptemplate_callback('drigg-external-button-add', array('link' => $link));

}

jacksone’s picture

Hi ,

with my site drigg_external button is loading full site button.js is not working properly since the external cal dispaly whole site in place of button

please help me out

jacksone’s picture

Probabily showing the error

"No url to display button for. Did you set the javacript 'url_site' variable ?"

Thanks

marcolav’s picture

Hello

I have now tried both buttons and both with different results , none of which are the expected ones..

button-new.js would display the loader forever
button.js would display a 'button-hole' view of my site. In any case none of them shows the URL to vote for, i.e they link simply to my homepage not to a voting page so to speak (hope it makes sense I am not a tech...). What I mean is it takes you to http://fxbookmarks.com instead of, for example, http://www.fxbookmarks.com/content/forex-trading-click-button
Or did I misunderstand it it?
The results vary depending whether I use it on WP or other CMS, but in no case is what I wanted...

Marco

MyFriendsHotel’s picture

Hi,

I've a simple but fundamental problem!

I've followed the install instructions but I can't activate the module as it does not show up in the Drigg admin section.

Can anyone help please.

My site is here: http:myfriendshotel.com/weblinks

Thanks,
Pete

alliax’s picture

It's better not to put it anyway, because it would eat your server ressources and is not really useful anyway.