IPS - ip.board
This method is compatible with any version of IP.board
If you use ip.board, I'll teach you how to add a page for your chat application
- First create a block
- Choose these settings
- Inside enter all this code you see below
<?php $_id_account = 82; $name = \IPS\Member::loggedIn()->name; $member_id = \IPS\Member::loggedIn()->member_id; $gender = \IPS\Member::loggedIn()->profileFields()["core_pfieldgroups_1"]["core_pfield_2"]; // Impostazione del cookie se non esiste if (empty($_COOKIE['numero_cookie'])) { setcookie('numero_cookie', rand(100, 999), time() + 3600, '/'); } // Conversione del genere da testo a numerico if ($gender == 'Maschio') { $gender = 1; } else { $gender = 2; } // Estrazione dell'età $bday_day = \IPS\Member::loggedIn()->bday_day; $bday_month = \IPS\Member::loggedIn()->bday_month; $bday_year = \IPS\Member::loggedIn()->bday_year; $dateOfBirth = "$bday_year-$bday_month-$bday_day"; $anni_ = (date("md", date("U", mktime(0, 0, 0, $bday_month, $bday_day, $bday_year))) > date("md")) ? ((date("Y") - $bday_year) - 1) : (date("Y") - $bday_year); if ($anni_ > 100) { $anni_ = 0; } // Generazione dei ruoli $mgroup_others = \IPS\Member::loggedIn()->mgroup_others; $member_group_id = \IPS\Member::loggedIn()->member_group_id; // Creazione dei ruoli if ($member_group_id == 9 || $member_group_id == 4) { $Ruolo = 'admin'; } elseif ($member_group_id == 6) { $Ruolo = 'moderator'; } elseif ($member_group_id == 10) { $Ruolo = 'deejay'; } elseif ($member_group_id == 3) { $Ruolo = 'user'; } else { // Impostazione dei dati per un ospite $name = $_POST['nickname'] . '_' . $_COOKIE['numero_cookie']; $anni_ = $_POST['age']; $sesso = $_POST['gender']; $Ruolo = 'ospite'; // Debug: Mostra i dati ricevuti if (empty($_POST['nickname'])) { $new_url = 'https://www.crazyradiodance.top/index.php?/accedi-da-ospite/'; header('Location: ' . $new_url); exit(); } } // Variabili POST $id_code_pass = 'my token'; $id_room = 'my room'; $sesso = $gender; $anni_ = '23'; $get_profile = '/index.php?/profile/' . $member_id . '-' . $name . '/'; $json = json_encode(array( 'password' => $id_code_pass, 'id_account' => $_id_account, 'username' => $name, 'gender' => $sesso, 'role' => $Ruolo, 'birthyear' => $anni_, 'profile_link' => "$get_profile", 'immage_user' => 'https://www.html5-videochat.com/homepage/img/logo_a.png', 'room_id' => '170420379182' )); $encoded = file_get_contents("https://html5-videochat.com/applications/chat_webcam_personale/crypt.php/?code_crypt=" . base64_encode($json)); echo <<<HTML <style> body, html { margin: 0; padding: 0; height: 100%; width: 100%; font-family: Arial, sans-serif; overflow: hidden; } #container { display: flex; flex-direction: column; height: 100%; } #header iframe { width: 100%; height: 100%; overflow: hidden; border: none; } #header { height: 45px; width: 100%; background-color: #ffffff; border-bottom: 1px solid #ccc; background-image: url(index.php); border: none; } #content { flex-grow: 1; width: 100%; } #iframeChat { width: 100%; height: 100%; border: none; } </style> <div id="container"> <div id="header"> <!-- Contenuto dell'intestazione, incluso l'iframe --> <iframe id="myIframe" src="my-site.com/radio.html" scrolling="no"></iframe> </div> <div id="content"> <iframe id="iframeChat" width="100%" height="100%" src="https://www.html5-videochat.com/index.php?/chat/$encoded" allowfullscreen="" allow="geolocation; microphone; camera; allowfullscreen; autoplay;"></iframe> </div> </div> HTML; ?>
- get the block id
- Create a page, to insert your chat;
- Use these settings
- Enter block id, created earlier
Quote{block="blocco-index-chat"}
Create gender user
Go to profile fields
Click on create new, I name the field gender
click the + button
Use these example parameter
At this point go to the created page and you will see your active chat, contact us to find any difficulties, we will give you support
0 Comments
Recommended Comments
There are no comments to display.