| 1 |
<?php |
<?php |
| 2 |
|
|
| 3 |
|
drupal_rebuild_theme_registry(); |
| 4 |
|
|
| 5 |
/** |
/** |
| 6 |
* Allow themable wrapping of all comments. |
* Allow themable wrapping of all comments. |
| 7 |
*/ |
*/ |
| 11 |
return 'http://' . $host . $port . '/'; |
return 'http://' . $host . $port . '/'; |
| 12 |
} |
} |
| 13 |
|
|
|
function dark_node_wrapper($content, $type = null) { |
|
|
static $node_type; |
|
|
if (isset($type)) $node_type = $type; |
|
|
|
|
|
if (!$content || $node_type == 'forum') { |
|
|
return '<div id="comments">'. $content . '</div>'; |
|
|
} |
|
|
else { |
|
|
return '<div id="comments"><h2 class="comments">'. t('Comments') .'</h2>'. $content .'</div>'; |
|
|
} |
|
|
} |
|
|
|
|
| 14 |
function dark_node_submitted($node) { |
function dark_node_submitted($node) { |
| 15 |
return t('<span class="cmt-author">!username</span><span class="cmt-date">@datetime</span>', |
return t('<span class="cmt-author">!username</span><span class="cmt-date">!datetime</span>', |
| 16 |
array( |
array( |
| 17 |
'!username' => theme('username', $node), |
'!username' => theme('username', $node), |
| 18 |
'@datetime' => format_date($node->created, 'custom', 'M d,Y') |
'!datetime' => format_date($node->created, 'custom', 'M d,Y') |
| 19 |
)); |
) |
| 20 |
|
); |
| 21 |
} |
} |
| 22 |
|
|
| 23 |
function dark_node($node, $teaser = 0, $page = 0) { |
function dark_comment_submitted($comment) { |
| 24 |
if (module_exists('taxonomy')) { |
return t('<span class="cmt-author">!username</span><span class="post-date">!datetime</span>', |
| 25 |
$taxonomy = taxonomy_link('taxonomy terms', $node); |
array( |
| 26 |
} |
'!username' => theme('username', $comment), |
| 27 |
else { |
'!datetime' => format_date($comment->timestamp, 'custom', 'M d,Y') |
| 28 |
$taxonomy = array(); |
) |
|
} |
|
|
|
|
|
$variables = array( |
|
|
'content' => ($teaser && $node->teaser) ? $node->teaser : $node->body, |
|
|
'date' => format_date($node->created), |
|
|
'links' => $node->links ? theme('links', $node->links, array('class' => 'links inline')) : '', |
|
|
'name' => theme('username', $node), |
|
|
'node' => $node, // we pass the actual node to allow more customization |
|
|
'node_url' => url('node/'. $node->nid), |
|
|
'page' => $page, |
|
|
'taxonomy' => $taxonomy, |
|
|
'teaser' => $teaser, |
|
|
'terms' => theme('links', $taxonomy, array('class' => 'links inline')), |
|
|
'title' => check_plain($node->title) |
|
| 29 |
); |
); |
|
|
|
|
// Flatten the node object's member fields. |
|
|
$variables = array_merge((array)$node, $variables); |
|
|
|
|
|
// Display info only on certain node types. |
|
|
if (theme_get_setting('toggle_node_info_' . $node->type)) { |
|
|
$variables['submitted'] = t('<span class="cmt-author">!username</span><span class="post-date">@datetime</span>', array('!username' => theme('username', $node), '@datetime' => format_date($node->created, 'custom', 'M d,Y'))); |
|
|
$variables['picture'] = theme_get_setting('toggle_node_user_picture') ? theme('user_picture', $node) : ''; |
|
|
} |
|
|
else { |
|
|
$variables['submitted'] = ''; |
|
|
$variables['picture'] = ''; |
|
|
} |
|
|
|
|
|
return _phptemplate_callback('node', $variables, array('node-' . $node->type)); |
|
|
} |
|
|
/** |
|
|
* Prepare the values passed to the theme_comment function to be passed |
|
|
* into a pluggable template engine. |
|
|
*/ |
|
|
function dark_comment($comment, $links = 0) { |
|
|
return _phptemplate_callback('comment', array( |
|
|
'author' => theme('username', $comment), |
|
|
'comment' => $comment, |
|
|
'content' => $comment->comment, |
|
|
'date' => format_date($comment->timestamp), |
|
|
'links' => isset($links) ? theme('links', $links) : '', |
|
|
'new' => $comment->new ? t('new') : '', |
|
|
'picture' => theme_get_setting('toggle_comment_user_picture') ? theme('user_picture', $comment) : '', |
|
|
'submitted' => t('<span class="cmt-author">!username</span><span class="post-date">@datetime</span>', array('!username' => theme('username', $comment), '@datetime' => format_date($comment->timestamp, 'custom', 'M d,Y'))), |
|
|
'title' => l($comment->subject, $_GET['q'], NULL, NULL, "comment-$comment->cid") |
|
|
)); |
|
| 30 |
} |
} |
| 31 |
|
|
| 32 |
|
|
| 33 |
/** |
/** |
| 34 |
* Format an individual feed item for display on the aggregator page. |
* Format an individual feed item for display on the aggregator page. |
| 35 |
* |
* |