You are here

function kwresearch_format_report_links_value in Keyword Research 6

Same name and namespace in other branches
  1. 7 includes/stats_report.inc \kwresearch_format_report_links_value()
1 call to kwresearch_format_report_links_value()
theme_keyword_stats_report in includes/stats_report.inc
Themes keyword stats report

File

includes/stats_report.inc, line 368
Functions to generate the keyword stats report

Code

function kwresearch_format_report_links_value($value, $keyword, $type = 'term') {
  $labels = kwresearch_get_report_links_options();
  $icons_path = base_path() . drupal_get_path('module', 'kwresearch') . '/icons/';
  switch ($type) {
    case 'google_trends':
      $img = '<img src="' . $icons_path . 'google_trends.png" alt="' . $labels[$type] . '" />';
      $output = l($img, 'http://www.google.com/trends?ctab=0&date=all&geo=US&q=' . $keyword . '%2C+' . kwresearch_pluralize($keyword), array(
        'attributes' => array(
          'target' => $type,
          title => $labels[$type],
        ),
        'html' => TRUE,
      ));
      break;
    case 'google_traffic_estimator':
      $img = '<img src="' . $icons_path . 'google_traffic_estimator.png" alt="' . $labels[$type] . '" />';
      $output = l($img, 'https://adwords.google.com/select/TrafficEstimatorSandbox?currency=USD&language=en&save=save&keywords=' . $keyword . '%0A%22' . $keyword . '%22%0A[test] %0A' . kwresearch_pluralize($keyword) . '%0A%22' . kwresearch_pluralize($keyword) . ' %22%0A[' . kwresearch_pluralize($keyword) . ']', array(
        'attributes' => array(
          'target' => $type,
          title => $labels[$type],
        ),
        'html' => TRUE,
      ));
      break;
    case 'google_sb_kw_tool':
      $img = '<img src="' . $icons_path . 'google_search_based_kw_tool.png" alt="' . $labels[$type] . '" />';
      $output = l($img, 'http://www.google.com/sktool/#keywords?spm=true&q=' . $keyword, array(
        'attributes' => array(
          'target' => $type,
          title => $labels[$type],
        ),
        'html' => TRUE,
      ));
      break;
    case 'google_insights':
      $img = '<img src="' . $icons_path . 'google_insights_for_search.png" alt="' . $labels[$type] . '" />';
      $output = l($img, 'http://www.google.com/insights/search/#cat&q=' . $keyword . '%2C+' . kwresearch_pluralize($keyword), array(
        'attributes' => array(
          'target' => $type,
          title => $labels[$type],
        ),
        'html' => TRUE,
      ));
      break;
    case 'gorank_related':
      $img = '<img src="' . $icons_path . 'gorank_related_kws.png" alt="' . $labels[$type] . '" />';
      $output = l($img, 'http://www.gorank.com/seotools/ontology/index.php?keywords=' . $keyword, array(
        'attributes' => array(
          'target' => $type,
          title => $labels[$type],
        ),
        'html' => TRUE,
      ));
      break;
    case 'keyworddiscovery':
      $img = '<img src="' . $icons_path . 'trellian_search_term_suggestion.png" alt="' . $labels[$type] . '" />';
      $output = l($img, 'http://www.keyworddiscovery.com/search.html?query=' . $keyword, array(
        'attributes' => array(
          'target' => $type,
          title => $labels[$type],
        ),
        'html' => TRUE,
      ));
      break;
  }
  return $output;
}