[Erledigt] Grafik in Script einbinden

S

SF1975

Guest
Hallo,
Ich möchte gerne in dem Script, welches mir den Status meiner Rufnummern anzeigt, die Grafik des ABs aus dem Script "pseudoanrufbeantworter.php" anzeigen.
PHP:
<div style="font-size:12px;text-align:right;width:310px;position:absolute;top:-20px;"><img src="'.picdesign("telab1.png").'" border="0"></div>
Sie soll einfach nur rechts zu sehen sein und damit wäre es gut.
Leider sind meine Versuche bisher erfolglos. Es fehlt entweder eine der 3 "LEDs" oder das Script ist nicht "aktiv", hat also einen Fehler.
Vielleicht kann mir ja jemand über die Straße helfen?

pseudofbf-msn-1und1.php
PHP:
 <?php

        /*
                +---------------------------------------------------------------------+
                |                                                                     |
                |   SensorAndSwitch Automation Pro                                    |
                |   PseudoGeräte-Script                                               |
                |   ===============================================================   |
                |   -> SIP                                                            |
                |      Fritz!Box 1&1-Rufnummern-Status                                |
                |                                                                     |
                +---------------------------------------------------------------------+
        */

        error_reporting(0);
        include "include/includefunctions.php";
        include "include/includefritzbox.php";
        include "include/includedateien.php";
        include "include/includeconf.php";
        include "include/includeconfig.php";
        include "include/includedefine.php";

        $Login=$Conf["FB"]."/login_sid.lua";
        $user=$Conf["USER"];
        $password=$Conf["PASSWORD"];
        $url=FB."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=sip:status/sip7/connect";
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
        curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $Status1 = curl_exec($ch);
        curl_close($ch);
        $Login=$Conf["FB"]."/login_sid.lua";
        $user=$Conf["USER"];
        $password=$Conf["PASSWORD"];
        $url=FB."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=sip:status/sip9/connect";
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
        curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $Status2 = curl_exec($ch);
        curl_close($ch);
        $Login=$Conf["FB"]."/login_sid.lua";
        $user=$Conf["USER"];
        $password=$Conf["PASSWORD"];
        $url=FB."/query.lua?sid=".GetSessionID($Login,$user,$password)."&wlan=sip:status/sip8/connect";
        $ch = curl_init();
        $timeout = 5;
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);
        curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
        $Status3 = curl_exec($ch);
        curl_close($ch);
        $t1="2";
        $t2="2";
    $t3="2";
        $x1=explode('"',$Status1);
        if ($x1[3]=="1" or $x1[3]=="2") {
            $t1=$x1[3]-1;
        }
        $x2=explode('"',$Status2);
        if ($x2[3]=="1" or $x2[3]=="2") {
            $t2=$x2[3]-1;
        }
        $x3=explode('"',$Status3);
        if ($x3[3]=="1" or $x3[3]=="2") {
            $t3=$x3[3]-1;
        }
        echo 'P#1&1-MSM-Status: <img src="'.PIC.'mled'.$t1.'.png"> <img src="'.PIC.'mled'.$t2.'.png"> <img src="'.PIC.'mled'.$t3.'.png">  <img src="'.PIC.'mled'.$t3.'.png">*HTML#';
        exit;
?>

[EDIT]
Die Zeile muss wie folgt lauten:
PHP:
echo 'P#<div style="font-size:12px;text-align:right;width:322px;position:absolute;top:-20px;"><img src="'.picdesign("telab1.png").'" border="0"></div><div style="font-size:22px;text-align:right;width:240px;position:absolute;top:2px;"><div>1&1: <img src="'.PIC.'mled'.$t1.'.png"> <img src="'.PIC.'mled'.$t2.'.png"> <img src="'.PIC.'mled'.$t3.'.png"></div>*HTML#';
 
Zuletzt bearbeitet von einem Moderator:
Das sieht doch aus, als ob es passt. :)

Es ist nicht zwingend notwendig, aber packe Bilder in die picdesign()-Funktion, damit auch je ausgewähltem Design die Bilder angezeigt werden, sofern ein designabhängiges Bild dafür verfügbar ist.
PHP:
echo 'P#<div style="font-size:12px;text-align:right;width:322px;position:absolute;top:-20px;"><img src="'."telab1.png").'" border="0"></div><div style="font-size:22px;text-align:right;width:240px;position:absolute;top:2px;"><div>1&1: <img src="'.picdesign("mled".$t1.".png").'"> <img src="'.picdesign("mled".$t2.".png").'"> <img src="'.picdesign("mled".$t3.".png").'"></div>*HTML#';
Ist nur ein Tipp am Rande. ;)
 
Hallo,
Thx :) werde ich mir mal anschauen. Mittels C&P ging es erst einmal am Laptop in die Hose. Ich mache es die Tage am PC besser ;)
 
Ich hoffe, ich hab kein Anführungszeichen vergessen. Bei der Menge und ohne Test kann das passieren. Aber versuchs mal. :)
 
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.