Hello all

I want to assign a blink word like "NEW" for the last article from last 2 days?
I want to put this word in front of title.
How can I do that? It is possible?

Thank You in advance for any help.

Comments

Kisugi Ai’s picture

Hi,
Sorry for the late answare.

maybe ýou can use the drupal function or variable like in forum posts or comment post
and add this at the

<h2 class="title"><a href="<?php print $node_url?>"><?php print $title?></a></h2> or
<h1 class="title"><?php print $title ?></h1>
<h1 class="title">
<?php if ($node->new) : ?>
    <a id="new"></a>
    <span class="new"><?php print drupal_ucfirst($new) ?></span>
  <?php endif; ?>
<?php print $title ?></h1>

maybe its wor maybe not because i have no ideea about Drupal 5 and the api from it.

greetings

ps.: maybe i can add this in D7/D8 versions but first i have someting another to do

gelusi’s picture

not working :(

Kisugi Ai’s picture

so sorry for the late answer
but do you raely use drupal 5?
because i have not worked with drupal 5
maybe that you can use the function "phptemplate_node" or else

for drupal7 its the funktion

function newsflash_preprocess_node(&$variables) {
  $variables['title_attributes_array']['class'][] = 'title';
  if ($variables['created'] >= (TIME() - ( 2 * 24 * 60 *60 ))) { // ( 2 * 24 * 60 *60 ) = two Days
    $variables['title_attributes_array']['class'][] = 'new';
  }
}

if the created time grater then the actual time - 2days then it will implement in the title the class new.

and for this you can add a CSS like

.node-teaser .new a {
  background: url(images/new_icon_blink.gif) left no-repeat;
  padding: 3px 3px 3px 30px;
}
Kisugi Ai’s picture

Status: Active » Closed (fixed)