Back to top

Autore Topic: Tutorial per visualizzare Favicon animate su J1.6  (Letto 1855 volte)

Offline johjoh

  • Nuovo arrivato
  • *
  • Post: 9
    • Mostra profilo
Tutorial per visualizzare Favicon animate su J1.6
« il: 11 Mag 2011, 03:43:42 »
Ciao a tutti, per chi come me volesse abbellire la barra degli indirizzi con una Favicon Animata può procedere come segue:
1 - Da questo sito http://www.animatedfavicon.com/ generatevi la vostra favicon animata personalizzata, oppure usate il sito che più vi aggrada o meglio ancora createvela voi stessi.
2 - Il sito sopra riportato restituirà un file ZIP da scaricare in basso, scompattatelo e rinominate solo il file "animated_favicon.gif" in "favicon.gif"
3 - uplodate solo "favicon.ico" e "favicon.gif" nella cartella del template che avete installato "/sito/template/nometemplate"
4 - editate con un editor avanzato (io uso Notepad++) il file "/sito/libraries/joomla/document/html/html.php"
5 - la riga 211 originale è
Codice: [Seleziona]
public function addFavicon($href, $type = 'image/vnd.microsoft.icon', $relation = 'shortcut icon')
{
$href = str_replace('\\', '/', $href);
$this->_links[] = '<link href="'.$href.'" rel="'.$relation.'" type="'.$type.'"';
}

/**
* Adds a custom html string to the head block
*
* @param string The html to add to the head
* @return void
*/
dopo diventa...
Codice: [Seleziona]
public function addFavicon($href, $type = 'image/vnd.microsoft.icon', $relation = 'shortcut icon')
{
$href = str_replace('\\', '/', $href);
$this->_links[] = '<link href="'.$href.'" rel="'.$relation.'" type="'.$type.'"';
}
public function addAnimatedFavicon($href, $type = 'image/gif', $relation = 'icon')
{
$href = str_replace('\\', '/', $href);
$this->_links[] = '<link href="'.$href.'" rel="'.$relation.'" type="'.$type.'"';
}

/**
* Adds a custom html string to the head block
*
* @param string The html to add to the head
* @return void
*/
6 - la riga 429 originale è
Codice: [Seleziona]
// Try to find a favicon by checking the template and root folder
$path = $directory . DS;
$dirs = array($path, JPATH_BASE.DS);
foreach ($dirs as $dir)
{
$icon = $dir.'favicon.ico';
if (file_exists($icon))
{
$path = str_replace(JPATH_BASE . DS, '', $dir);
$path = str_replace('\\', '/', $path);
$this->addFavicon(JURI::base(true).'/'.$path.'favicon.ico');
break;
}
}

return $contents;
}
dopo diventa...
Codice: [Seleziona]
// Try to find a favicon by checking the template and root folder
$path = $directory . DS;
$dirs = array($path, JPATH_BASE.DS);
foreach ($dirs as $dir)
{
$icon = $dir.'favicon.ico';
if (file_exists($icon))
{
$path = str_replace(JPATH_BASE . DS, '', $dir);
$path = str_replace('\\', '/', $path);
$this->addFavicon(JURI::base(true).'/'.$path.'favicon.ico');
break;
}
}
$path = $directory . DS;
$dirs = array($path, JPATH_BASE.DS);
foreach ($dirs as $dir)
{
$icon = $dir.'favicon.gif';
if (file_exists($icon))
{
$path = str_replace(JPATH_BASE . DS, '', $dir);
$path = str_replace('\\', '/', $path);
$this->addAnimatedFavicon(JURI::base(true).'/'.$path.'favicon.gif');
break;
}
}

return $contents;
}

Magari si può snellire ancora il codice con l' aiuto di un valido programmatore.
Unico BUG riscontrato IdE9 (Internet disExplorer 9) come al solito...  :(

 



Web Design Bolzano Kreatif