Navigacija

Vartotojų tinkle

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

Registruoti nariai: 25,963
Naujausias narys: WolfHammer

Naujausi straipsniai

Paskutiniai nariai

DjArtas 6 dienos
WolfHammer 1 savaitė
Rytis 4 savaitės
Nostesi11 savaitės
Wisedocs11 savaitės
asdasdddz15 savaitės
Paslapties K...16 savaitės
Audrius_1718 savaitės
Reikalas23 savaitės
Simbijanas31 savaitės
Karinacraft31 savaitės
Žmogus35 savaitės
Bruksnys39 savaitės
Darexs41 savaitės
Nepas42 savaitės
keistuole44 savaitės
Gizmis46 savaitės
MaFetas59 savaitės
ozzWANTED61 savaitės
saulyzas63 savaitės

Informacija:


OS: Unknown
Naršyklė: Nežinoma
IP: 216.73.216.209
Naujienų: 529
Straipsnių: 235
Temų: 52,589
Postų: 522,549
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.

WolfHammer
2026 Sau. 25 01:01:35
drovus

Žmogus
2025 Geg. 31 10:05:18
Kas geresnio? šypsosi

Nepas
2025 Bal. 9 17:04:13
drovus

Nepas
2025 Bal. 9 17:04:08
drovus

Gizmis
2025 Kov. 15 14:03:50
OMG, smagu matyt sita puslapi veikianti

Š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ų: 3283      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ą: