I've wondered in the past when using the Service Links module for Drupal how to quickly change the images that are provided by the module. There can be multiple ways to accomplish this, but only one real way to provide new images without "hacking" the service links module. I've come across several posts that mention adding images to the images folder in the service links module, which I consider bad practice. There may be some changes in the 2.x branch of service links that make this a bit easier, but there are really two ways to "properly" do this in Drupal 6 with the 1.x branch of Service Links.
Option 1 - Overwrite the images in the service links folder
Don't do this. Kittens everywhere will be screaming in pain, and if you update your module, the images would be overwritten at a later date.
Option 2 - Declare new service links using hook_service_links()
Right off the bat, I'll let you know this is NOT the option I chose to use in my theme, but it is still a valid option. Using hook_service_links() you can declare "new" service links, and declare your image in the hook on each item. Doing it this way would require you using a custom module in order to declare the new service links, which in this case would be a copy of the ones you'd like to use, along with defining an image.
function YOURMODULE_service_links
() {
$links = array();
$links['stumbleupon'] = array (
'name' => 'StumbleUpon',
'description' => t
('Thumb this up at StumbleUpon'),
'link' => 'http://www.stumbleupon.com/submit?url=<encoded-url>&title=<encoded-title>',
'icon' => drupal_get_path
('module', 'YOURMODULE') . '/images/stumbleit.png',
);
}
Recent comments
4 days 4 hours ago
1 week 4 hours ago
1 week 3 days ago
2 weeks 2 days ago
2 weeks 5 days ago
3 weeks 4 days ago
5 weeks 3 hours ago
6 weeks 5 hours ago
6 weeks 5 hours ago
6 weeks 18 hours ago