код вставки изображения

Discussion in 'PHP' started by mixdw, 17 May 2008.

  1. mixdw

    mixdw Banned

    Joined:
    27 Mar 2008
    Messages:
    81
    Likes Received:
    30
    Reputations:
    0
    Собственно,есть мониторинг сервера контры,он встроен в изображение.
    Суть моей ситуации такая.Хочу в мониторинг добавить строку,что выводил ещё карты игры из какой-то дирриктории.Изображения в формате .jpg.
    Пробовал сам,но без результатно...

    Вот ещё не знаю в какой файл пхп всовывать строку...
    Однин файл:
    PHP:
    <?
    require_once(
    "class_PQ.php");
    $height=80;
    $width=300;
    $path="C:/xampp/htdocs/cs/mon1/"// путь до картинки))
    $image="cs.png";

    Header("Content-type: image/png");
    $im=imagecreatefrompng($path.$image);
    $black ImageColorAllocate($im0,0,0);
    $white ImageColorAllocate($im255,255,255);
    imageFill($im00$white);

    $pqinfo = array();
    $pq PQ::create(array('ip' => "10.3.145.2:27015"'querytype' => "halflife_new_queries",));
    $pqinfo $pq->query(array('players','info''rules'));


    ImageString($im212010$pqinfo['name'], $black);
    ImageString($im212025"IP: ".$pqinfo['ip'].":".$pqinfo['int_port'], $black);
    ImageString($im212040"Map: ".$pqinfo['map'], $black);
    ImageString($im212055"Player: ".$pqinfo['totalplayers']."/".$pqinfo['maxplayers'], $black);

    ImageRectangle($im00$width-1$height-1$black);
    Imagejpeg($im);
    ImageDestroy($im);
    ?>
    И ещё один:
    PHP:
    <?php
    Error_Reporting
    (E_ALL & ~E_NOTICE);
    /********

        Main PsychoQuery Factory class. This returns a new PQ object based on the type of server you intend to query.
        This is the only file you need to 'include' into your applications. The PQ directory must be somewhere in your
        'include_path'.

        Example:

            include("class_PQ.php");

            $pq = PQ::create($conf);
            print_r($pq->query_info('10.3.145.2:27015'));

    ********/

    if (defined("CLASS_PQ_PHP")) return 1;
    define("CLASS_PQ_PHP"1);

    include_once(
    "PQ/PQ_PARENT.php");

    class 
    PQ {

    // Our factory method to create a valid object for our querytype specified
    function &create($conf) {
        if (!
    is_array($conf)) {            // force $conf into an array.
            
    $ip $conf;            // If $conf is not an array it's assumed to be an ipaddr[:port]
            
    $conf = array( 'ip' => $ip );
            unset(
    $ip);
        }

        
    // Add defaults to the config. Defaults do not override values passed in the $conf array
        
    $conf += array(
            
    'ip'        => '',
            
    'port'        => '',
            
    'querytype'    => 'halflife',
            
    'master'    => 0,
            
    'timeout'    => 3,
            
    'retries'    => 1,
        );

        
    // Separate IP:Port if needed
        
    if (strpos($conf['ip'], ':') !== FALSE) {
            
    $ipport $conf['ip'];
            list(
    $conf['ip'], $conf['port']) = explode(':'$ipport2);
            if (!
    is_numeric($conf['port'])) {
                
    $conf['port'] = '';
            }
        } else {
            
    $conf['port'] = '';        // default to no port (will be determined later in the query process)
        
    }

        
    // If no 'querytype' is specified default to 'halflife'
        
    if (!$conf['querytype']) {
            
    $conf['querytype'] = 'halflife';
        }
        
    // Attempt to load the proper class for our specified 'querytype'.
        
    $filename strtolower($conf['querytype']);
        
          
    $class "PQ_" $filename;

        if (!include_once(
    "PQ/" $filename ".php")) {
            
    trigger_error("Unsupported 'querytype' specified (${conf['querytype']}) for new PQ object"E_USER_ERROR);
        } else {
            return new 
    $class($conf);
        }
    }

    }  
    // end of class PQ


    Но это не все,есть ещё папка PQ.
    Но там видимо только выполняется считывание инфы,я так думаю...

    Если не достаточно объяснил ситуацию,извеняйте.