I have a Pay2Publish module, which gets no support these days, so I have to turn to the community for the help. I guess this is a simple PHP question:
I want to take the messages generated by Pay2Publish module and display them bellow each node teaser.
Here's the code from the module:
/**
* Implements hook_node_view()
*
* Displays the Message for the author of a node
*/
function ms_paypublish_node_view($node, $view_mode, $langcode) {
$plans = variable_get('ms_paypublish_plan_' . $node->type, array());
$pp_node = ms_paypublish_load_node_nid($node->nid);
if ($pp_node AND !empty($plans)) {
if ($view_mode == 'full' AND user_access('renew own pay to publish nodes')) {
global $user;
if ($node->uid == $user->uid) {
switch ($pp_node->status) {
case 0: // Not Published
drupal_set_message(
str_replace(
'!link',
l(t('Publish'), 'ms_paypublish/publish/' . $node->nid),
variable_get('ms_paypublish_not_published_text', 'This content is not published. To publish, please click here: !link')
)
);
break;
case 1: // Published
if ($pp_node->expiration_date) {
drupal_set_message(
str_replace(
array('!days','!link'),
array(
ms_paypublish_get_expiration_string(ms_paypublish_get_expiration($node->nid)),
l(t('Promote / Extend'), 'ms_paypublish/publish/' . $node->nid)
),
variable_get('ms_paypublish_published_text', 'This content will expire in !days days. To Promote / Extend, please click here: !link')
)
);
}
break;
case 2: // Awaiting Admin Approval
case 5:
drupal_set_message(variable_get('ms_paypublish_approval_text', 'This content is Awaiting Admin Approval. It will be published shortly.'));
break;
case 3: // Not yet published
drupal_set_message(str_replace('!link', l(t('Publish'), 'ms_paypublish/publish/' . $node->nid), variable_get('ms_paypublish_publish_text', 'This content has not been published yet. To publish, please click here: !link')));
break;
}
}
}
}
}
What do I need to put inside my custom node--content-type.tpl.php so that these messages are displayed below each teaser?