Sign In With Apple
Der neue SSO-Dienst von Apple jetzt im Form eines Plugins.
Der neue SSO-Dienst von Apple jetzt im Form eines Plugins.
Mittlerweile gibt es einige Gaming-Communitys in den Weiten des Internets. Für diese Communitys gibt es nun die perfekte Lösung in Verbindung mit Steam. Diese Erweiterung erfüllt so gut wie alle Wünsche.
Dieses Plugin berechtigt zur Entfernung des Copyrights aus allen aktuellen und zukünftigen Plugins von Hanashi Development.
Hallo,
ich habe es mit viel Mühe und etwas Hilfe geschafft mit Hilfe der API Discord Server auf einer Seite anzuzeigen:
- CodeOASE - von Webmastern für Webmaster
Mit Hilfe eines Bots werden die Daten rausgepickt.
Nur möchte ich das ganze wie folgt in einer Box darstellen:
Der liebe Syntafin hatte es mal angefangen und kam nie an denn Code. Gibt es die Möglichkeit mit Hilfe meines Codes sowas darzustellen?
Mein Code:
<?php
if(!isset($_SESSION) && session_id() == ''){session_start();}
$token = 'MTA1NDc4MzE3NTk5OTYxOTA3NA.GsebcE.kbV6nbF3RqMa4-2piWYYW5mElz7hc7D9eBCRUE';
$url = 'https://discordapp.com/api/users/@me/guilds';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => array('Authorization: Bot '.$token),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_VERBOSE => 1,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_STDERR => $f
));
$response = curl_exec($ch);
$discord_servers = json_decode($response, true);
curl_close($ch);
foreach($discord_servers as $d) {
$id = $d['id'];
if(!isset($_SESSION['discord_'.$id])){
$url = 'https://discordapp.com/api/guilds/'.$id.'/preview';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => array('Authorization: Bot '.$token),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_VERBOSE => 1,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_STDERR => $f
));
$response = curl_exec($ch);
curl_close($ch);
$d = json_decode($response, true);
$url = 'https://discordapp.com/api/guilds/'.$id;
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => array('Authorization: Bot '.$token),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_VERBOSE => 1,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_STDERR => $f
));
$response = curl_exec($ch);
curl_close($ch);
$db = json_decode($response, true);
$oi = $db['owner_id'];
$url = 'https://discordapp.com/api/guilds/'.$id.'/channels';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => array('Authorization: Bot '.$token),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_VERBOSE => 1,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_STDERR => $f
));
$chal = array_values(json_decode(curl_exec($ch), true));
foreach($chal as $cha) {
$data = array(
'temporary' => true
);
$post_data = json_encode($data);
$url = 'https://discordapp.com/api/channels/'.$cha['id'].'/invites';
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $url,
CURLOPT_HTTPHEADER => array('Authorization: Bot '.$token, 'Content-Type: application/json'),
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_FOLLOWLOCATION => 1,
CURLOPT_VERBOSE => 1,
CURLOPT_SSL_VERIFYPEER => 0,
CURLOPT_STDERR => $f,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $post_data
));
$response = curl_exec($ch);
curl_close($ch);
$rd = json_decode($response, true);
$code = $rd['code'];
if(!isset($rd['message'])){
break;
}
}
$i_url = "https://discord.gg/".$code;
$_SESSION['discord_'.$id] = [
"d" => $d
];
} else {
$d = $_SESSION['discord_'.$id]['d'];
}
?>
<div style="margin: 20px; height: 260px; width: 500px; transition: all 0.5s; overflow: hidden; background-color: lightgray; color: gray; float: left; " id="container_<?php echo $d['id']; ?>">
<div style="width: 100%; height: 150px; display: flex; justify-content: center; align-items: center; ">
<div style="height: 85%; width: 420px; ">
<div style="width: 100%; height: 100%; position: relative; ">
<div style="position: absolute; top: 0px; left: 0px; bottom: 0px; width: 150px; display: flex; justify-content: center; align-items: center; ">
<img style="border-radius: 75px; height: 75px; " src="https://cdn.discordapp.com/icons/<?php echo $d['id']; ?>/<?php echo $d['icon']; ?>.png">
</div>
<div style="position: absolute; top: 0px; left: 150px; bottom: 0px; right: 0px; display: flex; justify-content: center; align-items: center; ">
<div style="height: 80%; width: 256px; ">
<strong><?php echo $d['name']; ?></strong><br>
<?php echo $d['approximate_member_count']; ?> Benutzer<br>
<?php echo $d['approximate_presence_count']; ?> Benutzer online
</div>
</div>
</div>
</div>
</div>
<div style="width: 100%; height: 60px; position: relative; font-size: 24px; ">
<div style="position: absolute; top: 0px; right: 0px; bottom: 0px; width: 150px; display: flex; justify-content: center; align-items: center;"><button style="height: 40px; width: auto; background-color: blue; color: white; font-size: 18px; border: 0px none; " onclick="window.location.href = '<?php echo $i_url; ?>';">Beitreten</button></div>
</div>
</div>
<?php
}
?>
Alles anzeigen
Der liebe Syntafin hatte es mal angefangen und kam nie an denn Code. Gibt es die Möglichkeit mit Hilfe meines Codes sowas darzustellen?
Wie kommst du eigentlich..... Auf der????
Ja ich könnte da Mal weiter machen, das Problem ist, das mir das nicht so ganz gefallen hat und ich einfach nie dahinter kam wie ich zB den im ACP ausgewählten discord server verwenden kann, statt einen eigenen anzugeben, beziehungsweise, wollte ich da ein Sropsow im ACP wo man die verfügbaren auswählen kann.
Wie kommst du eigentlich..... Auf der????
Ja ich könnte da Mal weiter machen, das Problem ist, das mir das nicht so ganz gefallen hat und ich einfach nie dahinter kam wie ich zB den im ACP ausgewählten discord server verwenden kann, statt einen eigenen anzugeben, beziehungsweise, wollte ich da ein Sropsow im ACP wo man die verfügbaren auswählen kann.
Weil ich seit Monaten leider keinen Kontakt mehr zu Dir habe und ich denn Code nie erhalten habe.
Mir geht es darum, dass ich nur ein Discord (unser eigenen) anzeigen möchte und ich gerne deines benutzen würde (so gern).
Könntest Du mir das aktuelle Code zur Verfügung stellen?