Mchat Dice addon

Forum misto con frammenti di codice
Rispondi
Avatar utente
Galandas
Staff phpBB3World
Staff phpBB3World
Messaggi: 792
Iscritto il: 4 nov 2012, 9:18
Località: phpbb3world
Contatta:

Mchat Dice addon

Messaggio da Galandas » 13 ott 2016, 12:20

Ecco l'addon Dice per Mchat.
Steve ha fatto la maggior parte di esso se non ricordo corretto:?

Apri mchat.php
Cerca:

Codice: Seleziona tutto

$sql_ary = array(
			'forum_id' 			=> 0,
Aggiungi prima:

Codice: Seleziona tutto

$find_chars = array("//roll_dice");
        $roll_dice = mt_rand(2,12);
       
        switch ($roll_dice)
        {
            case $roll_dice == '1':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice1.gif" width="32" height="32" alt="1" />';
            break;
           
            case $roll_dice == '2':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice2.gif" width="32" height="32" alt="2" />';
            break;
           
            case $roll_dice == '3':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice3.gif" width="32" height="32" alt="3" />';
            break;
           
            case $roll_dice == '4':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice4.gif" width="32" height="32" alt="4" />';
            break;
           
            case $roll_dice == '5':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice5.gif" width="32" height="32" alt="5" />';
            break;
           
            case $roll_dice == '6':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice6.gif" width="32" height="32" alt="6" />';
            break;
           
            case $roll_dice == '7':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice6.gif" width="32" height="32" alt="6" /> <img src="' . $phpbb_root_path . 'images/dice1.gif" width="32" height="32" alt="7" />';
            break;
           
            case $roll_dice == '8':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice6.gif" width="32" height="32" alt="6" /> <img src="' . $phpbb_root_path . 'images/dice2.gif" width="32" height="32" alt="8" />';
            break;
           
            case $roll_dice == '9':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice6.gif" width="32" height="32" alt="6" /> <img src="' . $phpbb_root_path . 'images/dice3.gif" width="32" height="32" alt="9" />';
            break;
           
            case $roll_dice == '10':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice6.gif" width="32" height="32" alt="6" /> <img src="' . $phpbb_root_path . 'images/dice4.gif" width="32" height="32" alt="10" />';
            break;
           
            case $roll_dice == '11':
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice6.gif" width="32" height="32" alt="6" /> <img src="' . $phpbb_root_path . 'images/dice5.gif" width="32" height="32" alt="11" />';
            break;
           
            case $roll_dice == '12':   
                $roll_dice = '<img src="' . $phpbb_root_path . 'images/dice6.gif" width="32" height="32" alt="6" /> <img src="' . $phpbb_root_path . 'images/dice6.gif" width="32" height="32" alt="12" />';
            break;
        }
		$message = str_replace($find_chars, $roll_dice, $message);
Dices.zip
Non hai i permessi necessari per visualizzare i file allegati in questo messaggio.


Ultimo bump di Galandas effettuato il 13 ott 2016, 12:20.
Menu Forum ha scritto:

Rispondi

Torna a “Snippets”

Chi c’è in linea

Visitano il forum: Nessuno e 5 ospiti