Closed (fixed)
Project:
Follow
Version:
7.x-1.x-dev
Component:
Documentation
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Aug 2011 at 21:31 UTC
Updated:
6 Jun 2012 at 02:51 UTC
The current follow.api.php file is incorrect and can lead anyone trying to add his/her own networks down the path of frustration and resentment :)
It should read:
/**
* Alter the available networks to the Follow module.
*
* @param $networks
* Associative array of networks that are available.
* @param $uid
* The User ID of the networks to be displayed. If 0 is provided, will be the
* networks for the website rather then an individual user.
*/
function hook_follow_networks_alter(&$networks, $uid = 0) {
// Add a network.
$networks[$uid]['mailinglist'] = array(
'title' => t('Mailing List'),
'domain' => 'mailinglist.domain.com',
);
// Replace Twitter with Identi.ca
unset($networks[$uid]['twitter']);
$networks[$uid]['identica'] = array(
'title' => t('Identi.ca'),
'domain' => 'identi.ca',
);
}
Patch below.
| Comment | File | Size | Author |
|---|---|---|---|
| follow_api_updated.patch | 652 bytes | perusio |
Comments
Comment #1
stefanx commentedPlease excuse my ignorance I still don't understand what to do. How can I, a Drupal newbie, enable Identi.ca and a Mailinglist in Follow module?
Comment #2
perusio commentedCreate your own module, let's call it, foobar. Then add the code in foobar.module:
Enable the module and you're done.
Comment #3
stefanx commentedI intent to add Identi.ca in addition to Twitter, not replacing it. In this case, I assume I have to remove the line "unset($networks[$uid]['twitter']);". Correct?
Ahhh, create an own module! :-) I did so, installed and enabled the module successfully. But no mailinglist and identi.ca links are displayed. :-( Any idea?
Here is the content of my .info file:
Comment #4
perusio commentedThis should work (myfollow.module):
And the info file (myfollow.info):
Comment #5
stefanx commentedThanks a lot for your support. This works. :-)
In order to display icons, I will add the following code to follow.css and add the icons into the folders.
a.follow-link-identica {
background-image: url(icons/small/icon-identica.png);
}
a.follow-link-mailinglist {
background-image: url(icons/small/icon-mailinglist.png);
}
Hope it is sufficient.
What I don't understand is why identi.ca and mailinglist support are not included in the module by default. Since you already wrote the code, why not integrate it into the module by default and make user's life easier. :-)
Comment #6
Chris CharltonThe patch provided (above #1) works as expected.
Comment #7
rogert commentedThe patch supplied works.
Comment #8
q0rban commentedSorry for the delay on this. Committed!
http://drupalcode.org/project/follow.git/commitdiff/a0eebe8
http://drupalcode.org/project/follow.git/commitdiff/e123b31