Prijava na forum:
Ime:
Lozinka:
Prijavi me trajno:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:

ConQUIZtador
Trenutno vreme je: 19. Apr 2024, 21:09:57
nazadnapred
Korisnici koji su trenutno na forumu 0 članova i 1 gost pregledaju ovu temu.


Tema za pitanja
o SMF forumu, phpBB2 i phpBB3 forumu, Wordpress i Joomla CMS sistemima!

Za vecinu drugih pitanja nacicete odgovor citajuci Top teme!

Idi dole
Stranice:
Počni novu temu Nova anketa Odgovor Štampaj Dodaj temu u favorite Pogledajte svoje poruke u temi
Tema: Šta da radim sa ovim? :D  (Pročitano 1192 puta)
09. Dec 2005, 11:11:38
Prijatelj foruma
Zvezda u usponu


Zodijak Leo
Pol Muškarac
Poruke 1127
Zastava Vladimirci, Srbija
OS
Windows XP
Browser
Internet Explorer 6.0
mob
Nokia N70
Citat
<?php

    Header("Content-type: image/png");

// Fill in your own server information here:     
    $host = "zazbot.com";
    $port = "8030";
    $fp = fsockopen("$host", $port, &$errno, &$errstr, 30); //open connection
    if(!$fp) {
        $success=2;  //se-t if no connection
    }
    if($success!=2){ //if connection
        fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //get 7.html
        while(!feof($fp)) {
            $page .= fgets($fp, 1000);
        }
        fclose($fp); //close connection
        $page = ereg_replace(".*<body>", "", $page); //extract data
        $page = ereg_replace("</body>.*", ",", $page); //extract data
        $numbers = explode(",",$page); //extract data
        $currentlisteners=$numbers[0]; //set variable
        $connected=$numbers[1]; //set variable

        if($connected==1) //if DSP is connected
            $wordconnected="yes"; //set variable
        else //if no DSP connection
            $wordconnected="no"; //set variable
        $peaklisteners=$numbers[2]; //set variable
        $maxlisteners=$numbers[3]; //set variable
        $reportedlisteners=$numbers[4]; //set variable
    }

// Image size can be changed here: (x, y)
    $im = ImageCreate(100,32);
     
// Background color in R(ed)G(reen)B(lue) below
    $background_color = ImageColorAllocate($im,91,141,0);
     
// text colors also in RGB
    $text_color1 = ImageColorAllocate($im,255,255,255);
    $text_color2 = ImageColorAllocate($im,255,255,255);
     
    if($success!=2 && $connected==1){

// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
        $song=explode(" - ",$numbers[6]);
         
// strings can of course be replaced with your own bla
        $string1= "Now playing";
        $string2= $song[0];
        $string3= $song[1];
    }
    else {
        $string1= "Offline";
        $string2= "";
        $string3= "";
    }
     
// positioning below
    $px = (imagesx($im)-5*strlen($string1))/2;
    ImageString($im,1,$px,0,$string1,$text_color1);
//             (image,font (from 1 to 5),starting x position, y position,line of text,color)
    $px = (imagesx($im)-5*strlen($string2))/2;
    ImageString($im,1,$px,10,$string2,$text_color2);
    $px = (imagesx($im)-5*strlen($string3))/2;
    ImageString($im,1,$px,18,$string3,$text_color2);
    ImagePng($im);
                            // In response to KXRM's reaction:
                            // if you want to cache the picture, you should place this script in
                            // your internetpage, remove line 5 (Header-call)
                            // and use ImagePng($im, "filename.png");
                            // NB: filename.png must have the right permission settings
                            // (CHMOD 777 does it)
                            //
                            // Then you can place filename.png in the same html-file.
    ImageDestroy($im);
?>

Ovo je bi trebalo da je skripta za "Now playing" baner za net radio...
Iskren da bude o PHP ne znam mnogo tako da ne znam šta da uradim sa njom...  Smile
Treba da je snimim kao poseban fajl pa da je onda pozovem u html?
Da, da ne zaboravim treba mi za HTML sajt...  Smile
IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Veteran foruma
Poznata licnost


Moj licni tekst :-?

Zodijak Gemini
Pol Muškarac
Poruke 3589
Zastava Oreskovica
OS
Windows XP
Browser
Mozilla Firefox 1.5
mob
Apple iPhone 4
Pa nista, to stavis u .php fajl i tamo gde hoces da ti se prikaze upises sledece:

Kod:
<img src="fajl.php">

To je to... a ako hoces recimo da stavis za potpis negde na nekom sajtu kao sliku, a taj sajt ne dozvoljava da slika bude generisana preko php-a, onda promenis ekstenziju iz php u png ali moras preko .htaccess da 'kazes' serveru da taj png fajl ne cita kao sliku vec kao php i sve ce raditi kako treba Wink

Evo i jednog primera:

IP sačuvana
social share
Pozdrav, Nenad ® !
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Prijatelj foruma
Zvezda u usponu


Zodijak Leo
Pol Muškarac
Poruke 1127
Zastava Vladimirci, Srbija
OS
Windows XP
Browser
Internet Explorer 6.0
mob
Nokia N70
Snimim sve to kao pesma.php i ubacim u html taj kod
Citat
<img src="fajl.php">
i ne prikaze mi ništa...
Gde grešim?
I taj baner Domaći radija ima u sebi sliku, u tom prvom kodu gore ja ne vidim mesto gde mogu da ubacim moju sliku kao pozadinu...
IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Prijatelj foruma
Zvezda u usponu


Zodijak Leo
Pol Muškarac
Poruke 1127
Zastava Vladimirci, Srbija
OS
Windows XP
Browser
Internet Explorer 6.0
mob
Nokia N70
Ili taj kod ne mogu da ubacim u html već samo u php?
IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Prijatelj foruma
Zvezda u usponu


Zodijak Leo
Pol Muškarac
Poruke 1127
Zastava Vladimirci, Srbija
OS
Windows XP
Browser
Internet Explorer 6.0
mob
Nokia N70
Hmmm... Pitam gluposti... Smiley
Uspelo mi je ovo, ali još me muči to pitanje kako da ubacim nešto moje, neku pozadinu... Smile
IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Veteran foruma
Poznata licnost


Moj licni tekst :-?

Zodijak Gemini
Pol Muškarac
Poruke 3589
Zastava Oreskovica
OS
Windows XP
Browser
Mozilla Firefox 1.5
mob
Apple iPhone 4
Kod:
<?php

    Header
("Content-type: image/png");

// Fill in your own server information here:     
    
$host "zazbot.com";
    
$port "8030";
    
$fp fsockopen("$host"$port, &$errno, &$errstr30); //open connection
    
if(!$fp) {
        
$success=2;  //se-t if no connection
    
}
    if(
$success!=2){ //if connection
        
fputs($fp,"GET /7.html HTTP/1.0\r\nUser-Agent: XML Getter (Mozilla Compatible)\r\n\r\n"); //get 7.html
        
while(!feof($fp)) {
            
$page .= fgets($fp1000);
        }
        
fclose($fp); //close connection
        
$page ereg_replace(".*<body>"""$page); //extract data
        
$page ereg_replace("</body>.*"","$page); //extract data
        
$numbers explode(",",$page); //extract data
        
$currentlisteners=$numbers[0]; //set variable
        
$connected=$numbers[1]; //set variable

        
if($connected==1//if DSP is connected
            
$wordconnected="yes"//set variable
        
else //if no DSP connection
            
$wordconnected="no"//set variable
        
$peaklisteners=$numbers[2]; //set variable
        
$maxlisteners=$numbers[3]; //set variable
        
$reportedlisteners=$numbers[4]; //set variable
    
}

// Image size can be changed here: (x, y)
    // $im = ImageCreate(100,32);
$image "radio_01.png";
$im imagecreatefrompng($image);
     
// Background color in R(ed)G(reen)B(lue) below
    // $background_color = ImageColorAllocate($im,0,0,0);
     
// text colors also in RGB
    
$text_color1 ImageColorAllocate($im,255,0,0);
    
$text_color2 ImageColorAllocate($im,0,0,0);
     
    if(
$success!=&& $connected==1){

// song information is splitted in artist - title:
// This requires consistent artist & title format (no ' - ' in title/artist)
// else you can use $numbers[6] as current song info below
        
$song=explode(" - ",$numbers[6]);
         
// strings can of course be replaced with your own bla
        
$string1"Now playing";
        
$string2$song[0];
        
$string3$song[1];
    }
    else {
        
$string1"Offline";
        
$string2"";
        
$string3"";
    }
     
// positioning below
    
$px = (imagesx($im)-5*strlen($string1))/2;
    
ImageString($im,1,$px,0,$string1,$text_color1);
//             (image,font (from 1 to 5),starting x position, y position,line of text,color)
    
$px = (imagesx($im)-5*strlen($string2))/2;
    
ImageString($im,1,$px,10,$string2,$text_color2);
    
$px = (imagesx($im)-5*strlen($string3))/2;
    
ImageString($im,1,$px,18,$string3,$text_color2);
    
ImagePng($im);
                            
// In response to KXRM's reaction:
                            // if you want to cache the picture, you should place this script in
                            // your internetpage, remove line 5 (Header-call)
                            // and use ImagePng($im, "filename.png");
                            // NB: filename.png must have the right permission settings
                            // (CHMOD 777 does it)
                            //
                            // Then you can place filename.png in the same html-file.
    
ImageDestroy($im);
?>
IP sačuvana
social share
Pozdrav, Nenad ® !
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Prijatelj foruma
Zvezda u usponu


Zodijak Leo
Pol Muškarac
Poruke 1127
Zastava Vladimirci, Srbija
OS
Windows XP
Browser
Mozilla
mob
Nokia N70
Veliko hvala Wink Smiley
IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Veteran foruma
Poznata licnost


Moj licni tekst :-?

Zodijak Gemini
Pol Muškarac
Poruke 3589
Zastava Oreskovica
OS
Windows XP
Browser
Mozilla Firefox 1.5
mob
Apple iPhone 4
Nema na cemu, e ti sad dalje probaj... izmena boje slova, velicina, font, pozicija itd...
IP sačuvana
social share
Pozdrav, Nenad ® !
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Prijatelj foruma
Zvezda u usponu


Zodijak Leo
Pol Muškarac
Poruke 1127
Zastava Vladimirci, Srbija
OS
Windows XP
Browser
Internet Explorer 6.0
mob
Nokia N70
To mi već nije problem... Smiley
IP sačuvana
social share
Pogledaj profil WWW
 
Prijava na forum:
Ime:
Lozinka:
Zelim biti prijavljen:
Trajanje:
Registruj nalog:
Ime:
Lozinka:
Ponovi Lozinku:
E-mail:
Idi gore
Stranice:
Počni novu temu Nova anketa Odgovor Štampaj Dodaj temu u favorite Pogledajte svoje poruke u temi
Trenutno vreme je: 19. Apr 2024, 21:09:57
nazadnapred
Prebaci se na:  

Poslednji odgovor u temi napisan je pre više od 6 meseci.  

Temu ne bi trebalo "iskopavati" osim u slučaju da imate nešto važno da dodate. Ako ipak želite napisati komentar, kliknite na dugme "Odgovori" u meniju iznad ove poruke. Postoje teme kod kojih su odgovori dobrodošli bez obzira na to koliko je vremena od prošlog prošlo. Npr. teme o određenom piscu, knjizi, muzičaru, glumcu i sl. Nemojte da vas ovaj spisak ograničava, ali nemojte ni pisati na teme koje su završena priča.

web design

Forum Info: Banneri Foruma :: Burek Toolbar :: Burek Prodavnica :: Burek Quiz :: Najcesca pitanja :: Tim Foruma :: Prijava zloupotrebe

Izvori vesti: Blic :: Wikipedia :: Mondo :: Press :: Naša mreža :: Sportska Centrala :: Glas Javnosti :: Kurir :: Mikro :: B92 Sport :: RTS :: Danas

Prijatelji foruma: Triviador :: Domaci :: Morazzia :: TotalCar :: FTW.rs :: MojaPijaca :: Pojacalo :: 011info :: Burgos :: Alfaprevod

Pravne Informacije: Pravilnik Foruma :: Politika privatnosti :: Uslovi koriscenja :: O nama :: Marketing :: Kontakt :: Sitemap

All content on this website is property of "Burek.com" and, as such, they may not be used on other websites without written permission.

Copyright © 2002- "Burek.com", all rights reserved. Performance: 0.1 sec za 16 q. Powered by: SMF. © 2005, Simple Machines LLC.