Navigacija

Vartotojų tinkle

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

Registruoti nariai: 25,952
Naujausias narys: tomeem

Naujausi straipsniai

Paskutiniai nariai

asirija 2 savaitės
tomeem 4 savaitės
Reikalas 5 savaitės
weberiz 7 savaitės
mRokass10 savaitės
kartoonas11 savaitės
iaescortsmap11 savaitės
ozzWANTED12 savaitės
grunskiz13 savaitės
Bruksnys14 savaitės
illusion14 savaitės
ordo15 savaitės
Jurgaila16 savaitės
originalcs1616 savaitės
Rytis16 savaitės
halis18 savaitės
junkus21 savaitės
morlis21 savaitės
Majakas22 savaitės
andsoft23 savaitės

Informacija:


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

ozzWANTED
2024 Sau. 17 01:01:00
Desperatiškus komentarus šaukykloje su accountu po mėnesio prasibuvimo, ištryniau. Pasaulis ir taip juodas. Įjungiam šviesą, prašviesės. šypsosi

Majakas
2023 Gru. 10 19:12:39
Negaliu patikėti jog žinutės/pranešimai visi yra nuo 2008 m akinanti šypsen

Žmogus
2023 Rugs. 7 21:09:14
O gal BloodKiller pasijungs?

Apocal
2023 Rugs. 2 18:09:23
Nu davai nuveikiam kažką akinanti šypsen. Prisijungti kada visi čia akinanti šypsen.

Apocal
2023 Rugs. 2 00:09:18
Šiaip atėjau pažiūrėti ar dar lopas nesby yra ar koks ten buvo.

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