Add subscription support for News items

(DBOINCP-164)
This commit is contained in:
Tristan Olive 2015-06-12 11:30:26 -04:00
parent 841ce3c6cc
commit b01962cafe
2 changed files with 13 additions and 4 deletions

View File

@ -219,6 +219,12 @@ function boinc_preprocess_node(&$vars, $hook) {
//$vars['sample_variable'] = t('Lorem ipsum.'); //$vars['sample_variable'] = t('Lorem ipsum.');
// Detach subscribe link from the Links list
if (!empty($vars['node']->links['flag-subscriptions']['title'])) {
$vars['subscribe_link'] = $vars['node']->links['flag-subscriptions']['title'];
unset($vars['node']->links['flag-subscriptions']);
}
// Optionally, run node-type-specific preprocess functions, like // Optionally, run node-type-specific preprocess functions, like
// boinc_preprocess_node_page() or boinc_preprocess_node_story(). // boinc_preprocess_node_page() or boinc_preprocess_node_story().
$function = __FUNCTION__ . '_' . $vars['node']->type; $function = __FUNCTION__ . '_' . $vars['node']->type;
@ -257,10 +263,6 @@ function boinc_preprocess_node_forum(&$vars, $hook) {
// Get the author of the node // Get the author of the node
$account = user_load($vars['uid']); $account = user_load($vars['uid']);
// Detach subscribe link from the Links list
$vars['subscribe_link'] = $vars['node']->links['flag-subscriptions']['title'];
unset($vars['node']->links['flag-subscriptions']);
// Add topic moderator controls // Add topic moderator controls
if (user_access('edit any forum topic')) { if (user_access('edit any forum topic')) {
$vars['moderator_links'] = array(); $vars['moderator_links'] = array();

View File

@ -73,6 +73,13 @@
* @see zen_process() * @see zen_process()
*/ */
?> ?>
<?php if ($subscribe_link): ?>
<div class="subscribe">
<?php print $subscribe_link; ?>
</div>
<?php endif; ?>
<div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix"> <div id="node-<?php print $node->nid; ?>" class="<?php print $classes; ?> clearfix">
<?php print $user_picture; ?> <?php print $user_picture; ?>