Demo

Probiere ClanSphere aus und teste daran herum. Demo


Antworten: 5
Seite [1]
zeipet


Wannabe poster




Beiträge: 25
# Thema - 17.12.2011 um 13:30 Uhr
Ich will auf meiner Site ein kleines Query Modul für Minecraft unter Servers einbinden.
Da GameQ Minecraft nicht unterstützt habe ich ein kleines skript:

Php Skript +-

/*
* MCList for Minequery PHP
* Copyright (C) 2011 Vex Software LLC & Sheer Design
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

require('minequery.class.php');
$data = Minequery::query('localhost');

// LANGUAGE CONFIG
$lookup = array('serverPort','playerCount','maxPlayers',' latency');
$replace = array('Server Port','Players Online','Max Players','Latency');
// replace value with null if you have your own
$style = '<style type="text/css">' . "\n\t" .
'.mclist {' . "\n\t\t" .
'background-color: #DDD;' . "\n\t\t" .
'padding: 4px;' . "\n\t\t" .
'max-width: 250px;' . "\n\t\t" .
'font-family: tahoma;' . "\n\t\t" .
'font-size: 12px;' . "\n\t\t" .
'color: #777;' . "\n\t\t" .
'min-height: 90px;' . "\n\t" .
'}' . "\n" .
'</style>';
// Display Minecraft Face or List?
$face = ( isset( $_GET['face'] ) ) ? 1 : 0;

switch ( $face ) {
case 0:
echo $style . '<div class="mclist">';
$latency = str_replace( '.', '', substr( $data['latency'], 0, 4 ) );
if ( $latency > 400 ) {
echo '<div class="mcsignal"><img src="./images/signal_4.png" alt="Excellent Connection" /></div>';
} elseif ( $latency > 300 ) {
echo '<div class="mcsignal"><img src="./images/signal_3.png" alt="Fairly Good Connection" /></div>';
} elseif ( $latency > 200 ) {
echo '<div class="mcsignal"><img src="./images/signal_2.png" alt="Stressed Connection" /></div>';
} elseif ( $latency > 100 ) {
echo '<div class="mcsignal"><img src="./images/signal_1.png" alt="Poor Connection" /></div>';
}
$i = 0;
$max = count( $data );
foreach ( $data as $k => $v ) {

if ( in_array( $k, $lookup ) ) {
$k = str_replace( $lookup, $replace, $k );
}
if ( is_array( $v ) ) {
if ( ! empty( $v[0] ) ) {
echo "\n\t" . '<p><b>Players Online</b></p>';
$i2 = 0;
foreach ( $v as $username ) {
if( $i2 == count( $v ) ) {
echo "\n\t\t" . '&nbsp;&nbsp;&nbsp;&nbsp;<img src="./mclist.php?face=1&user=' . $username . '" width="16" />&nbsp;<b>' . $username . '</b><br />';
} else {
echo "\n\t\t" . '&nbsp;&nbsp;&nbsp;&nbsp;<img src="./mclist.php?face=1&user=' . $username . '" width="16" />&nbsp;<b>' . $username . '</b><br /><br />';
}
$i2++;
}

}
} elseif ( $k == $replace[3] ) {
echo "\n\t" . '<b>' . $k . '</b>: ' . $latency . 'ms<br />';
} else {
echo "\n\t" . '<b>' . $k . '</b>: ' . $v . '<br />';
}
$i++;

}
echo '</div>';

break;
case 1:
// Display Minecraft Skin Face
$username=$_GET['user'];
$filename = 'http://www.minecraft.net/skin/' . $username . '.png';
header( 'Content-type: image/png' );
$image_p = imagecreatetruecolor( 64, 64 );
$image = imagecreatefrompng( $filename );
imagecopyresampled( $image_p, $image, 0, 0, 8, 8, 64, 64, 8, 8 );
imagepng( $image_p );
break;
}

?>



Die dazugehörige htm +-

<html>

<head>
<title>MCList Example Usage</title>
<style type="text/css">
.mclist {
dispay: block;
margin: 0 auto;
background-color: #DDD;
padding: 4px;
max-width: 250px;
font-family: tahoma;
font-size: 12px;
color: #777;
min-height: 90px;
-moz-box-shadow: 0px 0px 5px #BBB;
-webkit-box-shadow: 0px 0px 5px #BBB;
box-shadow: 0px 0px 5px #BBB;
-moz-border-radius: 10px;
-webkit-border-radius: 5px;
border-radius: 5px;
-khtml-border-radius: 5px;
border: 1px solid #BBB;
}
.mcsignal {
float:right;
background-color:#EEE;
padding:15px;
margin: 4px;
-moz-box-shadow: 0px 0px 5px #BBB;
-webkit-box-shadow: 0px 0px 5px #BBB;
box-shadow: 0px 0px 5px #BBB;
-webkit-border-radius: 5px;
border-radius: 5px;
-khtml-border-radius: 5px;
}
</style>
</head>
<body>

<p align="center">Welcomie to my Server!</p>

<?php
// Place this wherever the list should display...
require_once('./mclist.php');
?>
</body>
</html>


Die Info soll in der Serverliste auftauchen.
online User:
online ja oder nein

Und einen link will ich auf einen static content.
Es gibt von Haus aus einen Link: /%7Bservers:servers_link%7D
aber der geht immer ins leere den müsste ich anpassen.

Ich hätt mir auch schon gedacht dass ich für Serber und Query komplett einen static Content machen, aber ich würde schon gerne das Modul dazu nutzen, wenns schon da ist...

Bitte helft mir, ich steh momentan vor einer Wand.

Meine Seite Testseite: http://zeipet.at/clantest/

Denke!
Peter
Inaktiv
palle ClanSphere Team

Supporter
Supporter




Beiträge: 3073
# Antwort: 1 - 17.12.2011 um 14:42 Uhr
Kein ScriptInfo, kein Support.
Jemand der nicht mit dem Handy online ist wird dir das erklären.


------------------
I like the part where it says 'nyan'



Inaktiv
|
sgraewe ClanSphere Team

Supporter
Supporter




Beiträge: 6116
# Antwort: 2 - 17.12.2011 um 14:55 Uhr
Jop, bitte das Scriptinfo wieder verlinken

http://www.csphere.eu/support/static/view/id/6


Inaktiv
|
zeipet
Thread-Ersteller


Wannabe poster




Beiträge: 25
# Antwort: 3 - 17.12.2011 um 15:04 Uhr
mv * /dev/null

Und was jetzt? *gg*

Nein klar, ist eine Testseite, werde es trotzdem wieder online stellen..

Telefoniert du immer?
Script kommt von da: link

Das Script funktioniert, ich müsste nur wissen wie und wo ich es im Modul servers am besten einfüge.



Zuletzt editiert von zeipet am 17.12.2011 um 15:09 Uhr (1x Editiert)
Inaktiv
|
sgraewe ClanSphere Team

Supporter
Supporter




Beiträge: 6116
# Antwort: 4 - 17.12.2011 um 15:07 Uhr
Der Clansphere-About link fehlt, bitte dazu die info seite, die ich oben gelesen habe, durchlesen und wieder verlinken.


Inaktiv
|
zeipet
Thread-Ersteller


Wannabe poster




Beiträge: 25
# Antwort: 5 - 17.12.2011 um 15:13 Uhr
schon passiert, ich arbeite gerade an einem dynamischen Menü, darum wars vorübergehend weg.
Ehrlich! War keine Absicht.

hier wars immer online:http://zeipet.at/clansphere


EDIT:
Habs schon durch sehr viel Probieren geschafft mit einem Iframe...
Nicht perfekt, aber funktioniert.

http://www.zeipet.at/clansphere/index.php?mod=servers&action=list

Ein Punkt abgehakt auf der Baustelle.


Zuletzt editiert von zeipet am 17.12.2011 um 17:35 Uhr (2x Editiert)
Inaktiv
|
Antworten: 5
Seite [1]


Sie müssen sich registrieren, um zu antworten.