Re: Updates
SiliconMind - November 7, 2006 - 16:01
| Project: | Bookmark Us |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
<?php
function bookmark_us_block_code() {
global $base_url;
$path = drupal_get_path('module', 'bookmark_us');
$bmarkus_stitle = variable_get('bookmark_us_site', t('Bookmark Website'));
$bmarkus_ptitle = variable_get('bookmark_us_page', t('Bookmark Page'));
$bmarkus_icons = variable_get('bookmark_us_icons', 1);
$sitename = variable_get('site_name', 'drupal');
$slogan = variable_get('site_slogan', '');
$pagetitle = strip_tags(drupal_get_title());
$head_title = $pagetitle ? $pagetitle . ' | ' . $sitename : $sitename;
$output = '';
$output .= drupal_add_js($path . '/bookmark_us.js');
if($bmarkus_icons) $output .= '<img src="' . $base_url. "/". $path . '/bookmark_site.gif" alt="' . $bmarkus_stitle . '" align="absmiddle" />';
$output .= ' ';
$output .= '<script type="text/javascript"> displayLink("1","' . $base_url . '","' . $sitename . '","' . $bmarkus_stitle . '"); </script>';
$output .= '<br />';
if($bmarkus_icons) $output .= '<img src="' . $base_url. "/". $path . '/bookmark_page.gif" alt="' . $bmarkus_ptitle . '" align="absmiddle" />';
$output .= ' ';
$output .= '<script type="text/javascript"> displayLink("3","","' . $head_title . '","' . $bmarkus_ptitle . '"); </script>';
return $output;
?>line $output .= drupal_add_js($path . '/bookmark_us.js'); won't do anything because it is called after drupal call to drupal_get_html_head and thus no additional scripts are put into html header.
this needs fixing but i have no idea where drupal_add_js($path . '/bookmark_us.js') should be to assure outputing bookmark_us.js script tag to the browser.

#1
But the module seems to work fine most where. Can you be yor configuration/changes specific?
#2
i have no idea why this is happening. i've installed bookmark_us on clean install of drupal 4.7.4. the line i mentioned, with call to drupal_add_js has no effect and the bookmark_us.js script is never added to the page head.
#3
Please reopen is necessary. Seems to work fine.
#4