News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

immagini in chat

Started by hollywood9111, February 03, 2013, 12:27:15 PM

Previous topic - Next topic

hollywood9111


emanuele

Non ne ho idea...hai provato ad usarle?


Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

hollywood9111

si con collegamenti bbcode o html resta tutto scritto
quindi senza mostrare le immagini

emanuele



Take a peek at what I'm doing! ;D




Hai bisogno di supporto in Italiano?

Aiutateci ad aiutarvi: spiegate bene il vostro problema: no, "non funziona" non è una spiegazione!!
1) Cosa fai,
2) cosa ti aspetti,
3) cosa ottieni.

hollywood9111

come faccio a implementarla?

belfa

#5
SMFPacks Shoutbox Released 1.0.4

Apri shoutbox.php che trovi nella cartella sources (regolare l'impostazione "max-height" all'altezza della shoutbox)


Cerchi :

// verifying word isn't too long... same SMF function ;)


Davanti aggiungi:

//images
$rep = array('[img]','[/img]','[IMG]','[/IMG]');
if (stristr($msg, '[img]http'))
{
$links = array();
foreach (explode(' ', $msg) as $w)
if (substr($w, 0, 9) == '[img]http' || '[IMG]http' && $smcFunc['strlen']($w) > 9)
$links[] = '<a href="' . str_replace($rep, '',$w) . '" target="_blank"><img style="max-height:375px" src="' . str_replace($rep, '',$w) . '" alt="Linked Image" /></a>';
else
$links[] = $w;
$msg = implode(' ', $links);
}


Nota: ci sono 2 posti nel file per aggiungere questo codice  (ti consiglio di fare una copia del file shoutbox.php)

Fatto sul mio forum / shoutbox e funziona bene sia per le immagini che per le gif animate  ;)

Advertisement: