Google Search

Tutorial su Drupal

Risorse su Drupal





Link al mio profilo
Contattami

E-mailpsicomantegmailcom

MSNpsicomantekatapekkianet

Google Talkpsicomantesugmaildotcom

Skypepsicomante

Your donations support ongoing development

Creative Commons License

Newsfeed RSS png image
Google Talk png image

Rimuovere "non verificato" dai commenti anonimi in Drupal

Submitted by psicomante on Wed, 2007-05-02 14:43.

In Drupal, purtroppo, di default il nome nei commenti anonimi è sempre seguito da "not verified" o "non verificato".

Questa aggiunta è hard-coded nel theme.inc. La funzione che ci interessa è theme_username()

Ora aprite o create nella cartella del vostro tema (attenzione: deve essere un tema realizzato con PHPTemplate), il file template.php ed aggiungete l'override della funzione, che ora si chiamerà phptemplate_username().

Ho semplicemente copiato la funzione presa pari pari dal theme.inc e ho commentato la riga relativa all'aggiunta di "non verificato".

<?php
function phptemplate_username($object) {

  if (
$object->uid && $object->name) {
   
// Shorten the name when it is too long or it will break many tables.
   
if (drupal_strlen($object->name) > 20) {
     
$name = drupal_substr($object->name, 0, 15) .'...';
    }
    else {
     
$name = $object->name;
    }

    if (
user_access('access user profiles')) {
     
$output = l($name, 'user/'. $object->uid, array('title' => t('View user profile.')));
    }
    else {
     
$output = check_plain($name);
    }
  }
  else if (
$object->name) {
   
// Sometimes modules display content composed by people who are
    // not registered members of the site (e.g. mailing list or news
    // aggregator modules). This clause enables modules to display
    // the true author of the content.
   
if ($object->homepage) {
     
$output = l($object->name, $object->homepage);
    }
    else {
     
$output = check_plain($object->name);
    }

   
//$output .= ' ('. t('not verified') .')';
 
}
  else {
   
$output = variable_get('anonymous', t('Anonymous'));
  }

}
?>


Ho sempre odiato il (non

Ho sempre odiato il (non verificato) con tutto il mio cuore

Io più brutalmente commento

Io più brutalmente commento la riga nel theme.inc Laughing out loud

poi pero' al primo upgrade

poi pero' al primo upgrade di drupal perdi tutte le modifiche!

Nel codice c'è una r di

Nel codice c'è una r di troppo in fondo Eye-wink

Ciao

...e manca una graffa

...e manca una graffa Sticking out tongue

Grazie Mavì

Grazie Mavì Sticking out tongue

Post new comment

Smileys
:);):(:D}:):P:O:?8):jawdrop::sick:
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <div> <br> <img> <strike> <div> <img>
  • Lines and paragraphs break automatically.
  • You may post PHP code. You should include <?php ?> tags.
  • Textual smileys will be replaced with graphical ones.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You may quote other posts using [quote] tags.

More information about formatting options

CAPTCHA
Rispondi alla domanda se sei umano!
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.

Recent comments

This site is proudly powered by Drupal 5.2 and Drupal Italia .


Creative Commons License

Commentatori più attivi

Ecco la lista dei 5 commentatori più attivi su Psicomante Blog!

Syndicate content5ThirtyOne Design | Psicomante's Blog | Top