Jump to content

IPS - ip.board


chat5html

29,328 views

 Share

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

1123570692_annotely_image(1).png.60937ec11dd7a915f6c9df5c958e00c2.png

  • Choose these settings

Cattura.PNG

  • 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

1850434826_annotely_image(2).png.ca3518e3311f928d7880e1f77535020e.png

  • Create a page, to insert your chat;

500518413_annotely_image(3).png.4704f778e9f672f0103b255688e6cb7e.png

  • Use these settings

Cattura.PNG.4a2d0ad9be75ccb1574fc54e1e173469.PNG

  • Enter block id, created earlier
Quote

{block="blocco-index-chat"}

 

Create gender user

Go to profile fields

annotely_image.thumb.png.aea79f4e96b955faf4aa9d6f56e2ae03.png

Click on create new, I name the field gender

click the + button

1207926444_annotely_image(1).thumb.png.eb3b37baadcda00e25b00ac82ab7a5e3.png

Use these example parameter

Cattura.PNG.81b37b31b3cc5027cc0b2a38df513558.PNG 

 

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

 

 Share

0 Comments


Recommended Comments

There are no comments to display.

×
×
  • Create New...