Active
Project:
Google Plus One Button | Google+ Badge
Version:
6.x-1.0-beta2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
2 Jun 2011 at 23:28 UTC
Updated:
8 Jun 2011 at 10:04 UTC
It would be nice if this module could take the JSON returned by Google and execute a custom PHP snippet. I suggest a PHP-input field for each possible callback state.
Comments
Comment #1
gregglesCan you explain how this would help?
The only thing I can think is "that sounds insecure."
Comment #2
MacRonin commentedI haven't looked at the returned JSON to verify, but if it gave some type of completion details about the "+1" just executed. It might be nice to be able to log internally that the user had just executed the "+1" option. That info could be added to an analytics tracking system such as Google's or Piwik or OWA or potentially used to issue userpoints
Comment #3
corbacho commentedThe button has a option for a Javascript callback, that could be used to trigger an ajax notification to Drupal. "Hey, someone voted +1"
I could add that Javascript callback function in the admin settings, but the implementation of the AJAX won't be in this module. Also because it could be faked easily by somone triggering the ajax callback directly.
btw, Greg, you are "tha mAsteR of the aliases" :) ...do you think is the best way to grab the absolute node path like this in Drupal 7:
$node_url = $base_url . '/' . drupal_get_path_alias($node->uri['path']);In drupal 6, node path is present in the node object (thanks to path_nodeapi), so I grabbed like this:
$node_url = $base_url . '/' . $node->path;Comment #4
gregglesI suggest:
<? $node_url = url($node->nid, array('absolute' => TRUE); ?>
btw, that's documented in the pathauto readme.txt ;)
Comment #5
sbefort commentedI was thinking about using Google +1 instead of Vote Up/Down. I would want the vote total available to Views, so a CCK counter field would need to be updated with the JSON callback. Yes, faking the JSON might be a problem.
Comment #6
corbacho commentedThanks greggles. I changed it in 7.x branch already. But notice that was missing the 'node/' part
url("node/$node->nid" ......"@sbefort It's interesting idea. I don't have time now to explore that option, but tell here if you do.