| 1 |
<?php
|
| 2 |
// $Id: weblinks_node_view.tpl.php,v 1.5.2.7.2.4 2009/04/30 17:11:42 nancyw Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* weblinks_node_view.tpl.php
|
| 7 |
* Theme implementation to display a list of related content.
|
| 8 |
*
|
| 9 |
* Available variables:
|
| 10 |
* - $node: node object that contains the URL.
|
| 11 |
* - $options: Options for the URL.
|
| 12 |
*/
|
| 13 |
if ($node->url != NULL) {
|
| 14 |
switch (variable_get('weblinks_view_as', 'url')) {
|
| 15 |
case 'url':
|
| 16 |
if (variable_get('weblinks_strip', FALSE)) {
|
| 17 |
$parts = parse_url($node->url);
|
| 18 |
$url = str_replace('www.', '', $parts['host']) . $parts['path'];
|
| 19 |
}
|
| 20 |
else {
|
| 21 |
$url = $node->url;
|
| 22 |
}
|
| 23 |
$title = _weblinks_trim($url, variable_get('weblinks_trim', 0));
|
| 24 |
break;
|
| 25 |
|
| 26 |
case 'visit':
|
| 27 |
$title_text = variable_get('weblinks_visit_text', t('Visit [title]'));
|
| 28 |
if (module_exists('token')) {
|
| 29 |
$title = token_replace($title_text, 'node', $node);
|
| 30 |
}
|
| 31 |
else {
|
| 32 |
$title = str_replace('[title]', $node->title, $title_text);
|
| 33 |
}
|
| 34 |
break;
|
| 35 |
}
|
| 36 |
if (variable_get('weblinks_redirect', FALSE)) {
|
| 37 |
$link = l($title, 'weblinks/goto/'. $node->nid, $options);
|
| 38 |
}
|
| 39 |
else {
|
| 40 |
$link = l($title, $node->url, $options);
|
| 41 |
}
|
| 42 |
echo '<div class="weblinks-linkview">'. $link .'</div><!--class="weblinks-linkview"-->';
|
| 43 |
}
|