Would be great there were a place (forums, or a code snippets page in the handbook) where people can list their home-grown add-ons for service links. For lack of a link to this in the readme or on the project description page, I'll start right here with mine for the time being...
A user of one of my client's sites requested the ability to post on MySpace. Being that it is somewhat ubiquitous now, I decided to implement it and found it quite easy with the recently created MySpace API; here's the snippet:
$links['service_links_myspace'] = theme('service_links_build_link', t('MySpace'), "http://www.myspace.com/index.cfm?fuseaction=postto&u=$url&t=$title&l=1&c=", t("Post to MySpace!"), 'myspace.gif', $nodelink);
Note:
Add this line at the end of function service_links_render() in service_links.module.
Download attached image myspace.gif and place in service_links folder.
| Comment | File | Size | Author |
|---|---|---|---|
| myspace.gif | 910 bytes | jwilson3 |
Comments
Comment #1
TheCrow commentedi provided a space for that here: http://servicelinks.altervista.org/?q=service with some more service.
This is just the start and the work is not yet completed :)
Comment #2
midmood commentedHi, i want to add the friendfeed snippet you posted on your site, but don't know how to do.
Can't find
service_links_render()Maybe the post above is a bit outdated for drupal 7.
Can you help?
thank you
Simone
Comment #3
TheCrow commentedYes the example made by jwilson is for 5.x-1.1 but i relaunched the idea for the new x.x-2.x, the things are differents, now you can build a custom module which implement the hook_service_links()
Here the guide http://drupal.org/node/949406#customizations
You can find examples reading services/general_services.module either any other file .module in the same folder.
Comment #4
midmood commentedWorked perfectly... thank you.
Yesterday I was a bit tired, this is maybe why i didn't think to dig into the other modules folders... sorry for bothering
*** typo edited
Comment #5
TheCrow commentedAdded on http://servicelinks.altervista.org/?q=service a system that generate automatically the code also for moultiple services, javascript enabled needed!