Navigacija

Vartotojų tinkle

Prisijungusių svečių: 204
Prisijungusių narių: 0
Prisijungusių narių nėra

Registruoti nariai: 25,970
Naujausias narys: tadasl

Naujausi straipsniai

Paskutiniai nariai

tadasl 1 diena
Žmogus 3 dienos
finxlt 2 savaitės
Reikalas 8 savaitės
tanos11 savaitės
LnKnPrK116 savaitės
inti18 savaitės
kileedyg25 savaitės
Kižas31 savaitės
Bruksnys32 savaitės
laleceylan5034 savaitės
minimukas34 savaitės
N-2037 savaitės
Rytis38 savaitės
DjArtas39 savaitės
WolfHammer39 savaitės
Nostesi49 savaitės
Wisedocs50 savaitės
asdasdddz53 savaitės
Paslapties K...54 savaitės

Informacija:


OS: Unknown
Naršyklė: Nežinoma
IP: 216.73.216.50
Naujienų: 529
Straipsnių: 235
Temų: 52,594
Postų: 522,555
Postų pask. parą: 0
Shout'ų pask. parą: 0
P.S.C. pask. parą: 0
Nuorodų kataloge: 13

Lankomumo Statistika

Peržiūrų šiandien: 22

Iš viso peržiūrų: 22948724

Prisijungti

REGISTRUOTIS
Nario vardas

Slaptažodis



Pamiršai slaptažodį?
Paprašyk naujo

Aktyvuoti save

Šaukykla

Jei norite rašyti žinutes, turite prisijungti.

Žmogus
2026 Rugs. 27 11:09:17
Įstojimo data: 2006 gruodžio 8 17:12:08 Tai laikas bėga. O dar pamenu pačia pradžia kaip buvo smagu su phpsfusion kurtis tuos puslapius akinanti šypsen

Žmogus
2026 Rugs. 26 10:09:53
Ar dar yra gyvu? akinanti šypsen

LnKnPrK1
2026 Bir. 21 09:06:52
Sveiki, gal kas is administracijos gali parasyti man PM,aciu

minimukas
2026 Vas. 21 08:02:25
oi oi akinanti šypsen yra dar cia gyvu? akinanti šypsen

N-20
2026 Vas. 6 21:02:05
O mes dar gyvi šypsosi)

Šaukyklos archyvas

Apklausa

Ar esate patenkinti lietuviško vertimo kokybe?

Taip!

Taip, bet yra ką taisyti (parašysiu komentaruose)

Ne

Norėdamas balsuoti turite prisijungti.
Archyvas
Reklama 400x60
PHP: Kaip padaryti, kad teksta automatiškai keltu į kita eilute?
Forumas | PHP-Fusion, WordPress, Shopify, PHP ir MySQL (PROGRAMAVIMAS) | Kiti PHP, HTML, MySQL klausimai

Autorius: PyccKuu Peržiūrų: 3823      Spausdinti temą
2011 Geg. 18 10:05:58          1 žinutė iš 8
Spausdinti pranešimą
Štai kodo dalys:

 
$img = imagecreatefromjpeg( $srcFile );
list($w, $h) = getimagesize( $srcFile );
 
$ha1 = imagettfbbox($headerSize, 0, $font1, $header );
$ha2 = imagettfbbox($textSize, 0,$font, $text );
 
$wt1 = $ha1[2]-$ha1[0];
$ht1 = $ha1[1]-$ha1[7];
$wt2 = $ha2[2]-$ha2[0];
$ht2 = $ha2[1]-$ha2[7];
 
$fw = $w + 8 + $imageMargin * 2 + $borderPad * 2;
$fh = $h + 8 + $imageMargin * 2 + $borderPad * 2 + $ht1 + $ht2 + $spacing * 3;
$fon = imagecreatetruecolor($fw, $fh);
 
$white = imagecolorallocate( $fon, 255, 255, 255 );
$black = imagecolorallocate( $fon, 97, 161, 23 );
imagefill( $fon, 0, 0, $black );
 
imagecopy( $fon, $img, $imageMargin + $borderPad + 4, $imageMargin + $borderPad + 4, 0, 0, $w, $h );
 
imagerectangle( $fon, $imageMargin + $borderPad + 4 - 3, $imageMargin + $borderPad + 4 - 3,
$imageMargin + $borderPad + $w + 4 + 2, $imageMargin + $borderPad + $h + 4 + 2, $white );
imagerectangle( $fon, $imageMargin + $borderPad + 4 - 4, $imageMargin + $borderPad + 4 - 4,
$imageMargin + $borderPad + $w + 4 + 3, $imageMargin + $borderPad + $h + 4 + 3, $white );
 
imagettftext( $fon, $headerSize, 0,
($fw - $wt1) / 2, $imageMargin + $borderPad*2 + 8 + $h + $ht1 + $spacing,
$white, $font1, $header );
 
imagettftext( $fon, $textSize, 0,
($fw - $wt2) / 2, $imageMargin + $borderPad*2 + 8 + $h + $ht1 + $ht2 + $spacing*2,
$white, $font, $text );
$ts=$dirdem.time();
$ts1='/uploads/demotivation/'.time();
imagejpeg( $fon, $ts."_foto.jpg", 98 );
imagecolordeallocate( $fon, $black );
imagecolordeallocate( $fon, $white );
imagedestroy( $fon );
 


Čia kodas kuris užrašo mano pasirinkta teksta ant paveikslėlio. Bet jaigu mano tekstas labai ilgas jis ji raso viena eilute lb ilga ir matosi tik ta teksto dalys kuri yra ant paveikslelio. Kaip galima butu padaryti kad tas tekstas "lužtu" į stulpelius kai buna dydesnis nei paveikslėlio plotas?

;) Tikiuosi viska gerai paaiškinau :)

7 atsakymai:
2011 Geg. 18 12:05:47          2 žinutė iš 8
Spausdinti pranešimą
Pasinauduok nl2br(); funkcija.šypsosi
0

2011 Geg. 18 12:05:22          3 žinutė iš 8
Spausdinti pranešimą
Aš nemoku PHP be žado
0

2011 Geg. 18 13:05:30          4 žinutė iš 8
Spausdinti pranešimą
Kas padarys sumokėsiu. Skype mr.pycckuu parašyk tarsimės ! Kuo greičiau tuo geriau galvoja
0

2011 Geg. 18 19:05:26          5 žinutė iš 8
Spausdinti pranešimą
Kažkaip nematau šitam kode teksto atvaizdavimo sakinių. nustebęs
0


2011 Geg. 22 23:05:11          6 žinutė iš 8
Spausdinti pranešimą
Čia tekstas neatvaizduojamas, o dedamas ant paveikslėlio kaip watermarkasmerkia akį
0

2011 Geg. 22 23:05:24          7 žinutė iš 8
Spausdinti pranešimą
Nu taip, bet iš kur traukiamas tekstas? šypsosi
0


2011 Geg. 22 23:05:52          8 žinutė iš 8
Spausdinti pranešimą
Rašomas laukelije.

Va visas kodas:


 
<?php
if (!defined("DATALIFEENGINE"))
{
die("Hacking Attemp!");
}
 
$utf8 = iconv('windows-1251', 'utf-8', $ansi);
 
$dirdem=ROOT_DIR.'/uploads/demotivation/';
$tpl->load_template('demgen.tpl');
if (isset($_FILES["file"])){
$myfile = $_FILES["file"]["tmp_name"];
$font = str_replace ( "\\", "/", getcwd () )."/arial.ttf";
$font1 = $font;
$headerSize = 33.5;
$textSize = 24.0;
$imageMargin = 20;
$spacing = 16;
$borderPad = 16;
$srcFile = $myfile;
$header = ( $_POST["head"]);
$text = ($_POST["text"]);
if( !file_exists( $srcFile ) ){
echo "Paveiksliukas nerastas\n";
exit;
}
$img = imagecreatefromjpeg( $srcFile );
list($w, $h) = getimagesize( $srcFile );
 
$ha1 = imagettfbbox($headerSize, 0, $font1, $header );
$ha2 = imagettfbbox($textSize, 0,$font, $text );
 
$wt1 = $ha1[2]-$ha1[0];
$ht1 = $ha1[1]-$ha1[7];
$wt2 = $ha2[2]-$ha2[0];
$ht2 = $ha2[1]-$ha2[7];
 
$fw = $w + 8 + $imageMargin * 2 + $borderPad * 2;
$fh = $h + 8 + $imageMargin * 2 + $borderPad * 2 + $ht1 + $ht2 + $spacing * 3;
$fon = imagecreatetruecolor($fw, $fh);
 
$white = imagecolorallocate( $fon, 255, 255, 255 );
$black = imagecolorallocate( $fon, 97, 161, 23 );
imagefill( $fon, 0, 0, $black );
 
imagecopy( $fon, $img, $imageMargin + $borderPad + 4, $imageMargin + $borderPad + 4, 0, 0, $w, $h );
 
imagerectangle( $fon, $imageMargin + $borderPad + 4 - 3, $imageMargin + $borderPad + 4 - 3,
$imageMargin + $borderPad + $w + 4 + 2, $imageMargin + $borderPad + $h + 4 + 2, $white );
imagerectangle( $fon, $imageMargin + $borderPad + 4 - 4, $imageMargin + $borderPad + 4 - 4,
$imageMargin + $borderPad + $w + 4 + 3, $imageMargin + $borderPad + $h + 4 + 3, $white );
 
imagettftext( $fon, $headerSize, 0,
($fw - $wt1) / 2, $imageMargin + $borderPad*2 + 8 + $h + $ht1 + $spacing,
$white, $font1, $header );
 
imagettftext( $fon, $textSize, 0,
($fw - $wt2) / 2, $imageMargin + $borderPad*2 + 8 + $h + $ht1 + $ht2 + $spacing*2,
$white, $font, $text );
$ts=$dirdem.time();
$ts1='/uploads/demotivation/'.time();
imagejpeg( $fon, $ts."_demotiv.jpg", 98 );
imagecolordeallocate( $fon, $black );
imagecolordeallocate( $fon, $white );
imagedestroy( $fon );
$output=$ts1."_demotiv.jpg";
$wdr= <<<HTML
<center>
<img src="http://{$_SERVER['HTTP_HOST']}{$output}"><br>
<form enctype="multipart/form-data">
<tr><td width="120" height="30"><span style="font-size: xx-small;">» Tiesioginė nuoroda:</span></td><td><input type="text" name="head" value="http://{$_SERVER['HTTP_HOST']}{$output}" style="border:1px solid #ccc;height:16px;width:300px;padding-left:5px;"></td></tr>
<tr><td width="120" height="40"><span style="font-size: xx-small;">» Forumo kodas:</span></td><td><input type="text" name="head" value="[img]http://{$_SERVER['HTTP_HOST']}{$output}[/img]" style="border:1px solid #ccc;height:16px;width:300px;padding-left:5px;"></td></tr>
<tr><td width="120" height="30"><span style="font-size: xx-small;">» <span style="border-bottom: 1px dotted black;">HTML</span> Kodas:</span></td><td><input type="text" name="head" value="&lt;img src=&quot;http://{$_SERVER['HTTP_HOST']}{$output}&quot;&gt;" style="border:1px solid #ccc;height:16px;width:300px;padding-left:5px;"></td></tr>
</form>
</center>
<span style="border-bottom: 1px dotted black;">HTML</span>;
} else {
$wdr = <<<HTML
<center>
<form method="post" enctype="multipart/form-data">
<tr><td width="120" height="40"><span style="font-size: xx-small;">» <b>Nuotrauka:</b></span></td><td><input type="file" name="file"></td></tr>
<tr><td width="120" height="30"><span style="font-size: xx-small;">» <b>Pavadinimas:</b></span></td><td><input type="text" value="Įveskite pavadinimą..." onblur="if(this.value=='') this.value='Įveskite pavadinimą...';" onfocus="if(this.value=='Įveskite pavadinimą...') this.value='';" name="head" style="border:1px solid #ccc;height:16px;width:165px;padding-left:5px;"></td></tr>
<tr><td width="120" height="30"><span style="font-size: xx-small;">» <b>Aprašymas:</b></span></td><td><input type="text" value="Įveskite aprašymą..." onblur="if(this.value=='') this.value='Įveskite aprašymą...';" onfocus="if(this.value=='Įveskite aprašymą...') this.value='';" name="text" style="border:1px solid #ccc;height:16px;width:165px;padding-left:5px;" value=""></td></tr>
</table><br>
<center><input type="submit" name="submit" value="Patvirtinti" style="border:1px solid #ccc;height:22px;width:200px;padding-left:5px;"></center>
</form>
</center>
<span style="border-bottom: 1px dotted black;">HTML</span>;
 
}
$tpl->set('{cnt}', $wdr);
 
$tpl->compile('content');
$tpl->clear();
?>
 


Čia datalaifo modulis šypsosi
0

Peršokti į forumą: